-
Notifications
You must be signed in to change notification settings - Fork 478
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
record: Add -C/--caller-filter option #166
Conversation
I made a new option -C/--caller-filter to provide parent filter as we discussed in the previous meeting. This is |
0ff1d59
to
471d3d5
Compare
-F/--filter option is useful when tracing the callee functions, but sometime it's also useful to see its callers in a reverse way. This patch adds -C/--caller-filter to show caller functions by tracing the call path to the given function. The same purpose could be acheived by time-filter with `trace` trigger but it's a kind of weird combination to general users. So this adds a new option to provide the same feature. The below shows the example to trace the call path to 'free' and its callers. Before: $ uftrace -t 1000s -T free@trace <program> After: $ uftrace -C free <program> # DURATION TID FUNCTION [32587] | main() { [32587] | v8::Shell::Main() { [32587] | v8::V8::InitializeICUDefaultLocation() { [32587] | v8::internal::InitializeICUDefaultLocation() { 1.380 us [32587] | free(); 2.493 ms [32587] | } /* v8::internal::InitializeICUDefaultLocation */ 2.496 ms [32587] | } /* v8::V8::InitializeICUDefaultLocation */ [32587] | v8::V8::InitializeExternalStartupData() { [32587] | v8::internal::InitializeExternalStartupData() { 0.099 us [32587] | free(); 0.049 us [32587] | free(); 653.622 us [32587] | } /* v8::internal::InitializeExternalStartupData */ 653.826 us [32587] | } /* v8::V8::InitializeExternalStartupData */ ... Signed-off-by: Honggyu Kim <[email protected]>
471d3d5
to
d638429
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A problem with this approach is that it disables the time filter. User may want to use time filter along with the caller filter - ex) show all memory allocation paths which take longer than XXX.
You'd better adding a new flag for the caller filter and check both of time and caller filters if they are given. And let the 'trace' trigger overrules them.
Could you please take a look at review/caller-filter-v1? It'd work together with the time filter (and others). |
@namhyung It works great with clang as follows:
|
But it fails for node example.
|
Ah.. It seems that uftrace doesn't catch
|
It works great with time filter. Thanks a lot!
|
Merged: dc6fd55 |
-F/--filter option is useful when tracing the callee functions, but
sometime it's also useful to see its callers in a reverse way.
This patch adds -C/--caller-filter to show caller functions by tracing
the call path to the given function.
The same purpose could be acheived by time-filter with
trace
triggerbut it's a kind of weird combination to general users. So this adds a
new option to provide the same feature.
The below shows the example to trace the call path to 'free' and its
callers.
The example output is as follows:
Signed-off-by: Honggyu Kim [email protected]