Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
y2kappa opened this issue Oct 20, 2020 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@y2kappa
Copy link
Owner

y2kappa commented Oct 20, 2020

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});
//
}
@y2kappa y2kappa added good first issue Good for newcomers help wanted Extra attention is needed labels Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant