Skip to content

Enrich & customize chrome://tracing data to contain threadid, processid, tags #8

Description

@y2kappa

It would be cool to add at least:

  • processId - afaik this should be easy, but not sure how expensive it it
  • threadId - from my research this was not obvious without using nightly, but maybe there is another way

But it would be great to also add tags, and as such, to add an extra macro derive attribute:

#[timed::timed(printer = "info!", tracing=true, tags = ["foo", "baz"])]
fn main() { } 

For this you'd need to modify:

#[derive(Debug, FromMeta)]
struct MacroArgs {
    #[darling(default)]
    printer: Option<String>,
    #[darling(default)]
    tracing: Option<bool>,
}

inside the macro crate: timed_prod_macros and add tags and process id and all the stuff to the Hop object

fn codegen_tracing(options: &MacroArgs, function_name: &str) -> (Option<Code>, Option<Code>) {
// stuff..
    timed::Trace::collect(timed::Hop { ph: timed::Phase::E, name: #function_name.to_string(), ts});
//
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions