diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-03-11 15:50:01 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-03-11 15:50:01 -0500 |
commit | 96651c4917bb38ed015d5595d50212761289375a (patch) | |
tree | 80792ed6e5418dbfcff252baaaf466e8e0458bed | |
parent | f8726fadc1849cdb65b7257eadaf50b89f5decef (diff) |
trace-cmd: Add -T option to perform stacktraces on each event
Add -T option to perform a stacktrace on each event:
kworker/3:2-2393 [003] 58549.282806: sched_switch: kworker/3:2:2393 [120] S ==> trace-cmd:2603 [120]
kworker/3:2-2393 [003] 58549.282808: kernel_stack: <stack trace>
=> schedule (ffffffff814b260e)
=> worker_thread (ffffffff8106edd7)
=> kthread (ffffffff81072b43)
=> kernel_thread_helper (ffffffff814bcbe4)
<idle>-0 [000] 58549.282866: sched_switch: swapper:0 [120] R ==> trace-cmd:2600 [120]
<idle>-0 [000] 58549.282869: kernel_stack: <stack trace>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | Documentation/trace-cmd-record.1.txt | 9 | ||||
-rw-r--r-- | trace-record.c | 5 | ||||
-rw-r--r-- | trace-usage.c | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/Documentation/trace-cmd-record.1.txt b/Documentation/trace-cmd-record.1.txt index 2ae6748..87e4f97 100644 --- a/Documentation/trace-cmd-record.1.txt +++ b/Documentation/trace-cmd-record.1.txt | |||
@@ -55,6 +55,15 @@ OPTIONS | |||
55 | not be able to display them. If this is the case, then specify the | 55 | not be able to display them. If this is the case, then specify the |
56 | *-a* option and the format for all events in the system will be saved. | 56 | *-a* option and the format for all events in the system will be saved. |
57 | 57 | ||
58 | *-T*:: | ||
59 | Enable a stacktrace on each event. For example: | ||
60 | |||
61 | <idle>-0 [003] 58549.289091: sched_switch: kworker/0:1:0 [120] R ==> trace-cmd:2603 [120] | ||
62 | <idle>-0 [003] 58549.289092: kernel_stack: <stack trace> | ||
63 | => schedule (ffffffff814b260e) | ||
64 | => cpu_idle (ffffffff8100a38c) | ||
65 | => start_secondary (ffffffff814ab828) | ||
66 | |||
58 | *-f* 'filter':: | 67 | *-f* 'filter':: |
59 | Specify a filter for the previous event. This must come after a *-e*. This | 68 | Specify a filter for the previous event. This must come after a *-e*. This |
60 | will filter what events get recorded based on the content of the event. | 69 | will filter what events get recorded based on the content of the event. |
diff --git a/trace-record.c b/trace-record.c index 2611bfa..a4642bf 100644 --- a/trace-record.c +++ b/trace-record.c | |||
@@ -1867,7 +1867,7 @@ void trace_record (int argc, char **argv) | |||
1867 | {NULL, 0, NULL, 0} | 1867 | {NULL, 0, NULL, 0} |
1868 | }; | 1868 | }; |
1869 | 1869 | ||
1870 | c = getopt_long (argc-1, argv+1, "+hae:f:Fp:cdo:O:s:r:vg:l:n:P:N:tb:ki", | 1870 | c = getopt_long (argc-1, argv+1, "+hae:f:Fp:cdo:O:s:r:vg:l:n:P:N:tb:kiT", |
1871 | long_options, &option_index); | 1871 | long_options, &option_index); |
1872 | if (c == -1) | 1872 | if (c == -1) |
1873 | break; | 1873 | break; |
@@ -1975,6 +1975,9 @@ void trace_record (int argc, char **argv) | |||
1975 | option = optarg; | 1975 | option = optarg; |
1976 | save_option(option); | 1976 | save_option(option); |
1977 | break; | 1977 | break; |
1978 | case 'T': | ||
1979 | save_option("stacktrace"); | ||
1980 | break; | ||
1978 | case 's': | 1981 | case 's': |
1979 | if (extract) | 1982 | if (extract) |
1980 | usage(argv); | 1983 | usage(argv); |
diff --git a/trace-usage.c b/trace-usage.c index d1f3bfd..1ecc8fa 100644 --- a/trace-usage.c +++ b/trace-usage.c | |||
@@ -25,6 +25,7 @@ static struct usage_help usage_help[] = { | |||
25 | " -F filter only on the given process\n" | 25 | " -F filter only on the given process\n" |
26 | " -P trace the given pid like -F for the command\n" | 26 | " -P trace the given pid like -F for the command\n" |
27 | " -c also trace the childen of -F or -P\n" | 27 | " -c also trace the childen of -F or -P\n" |
28 | " -T do a stacktrace on all events\n" | ||
28 | " -l filter function name\n" | 29 | " -l filter function name\n" |
29 | " -g set graph function\n" | 30 | " -g set graph function\n" |
30 | " -n do not trace function\n" | 31 | " -n do not trace function\n" |