aboutsummaryrefslogtreecommitdiffstats
path: root/trace-cmd.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-10-04 09:30:29 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-10-04 21:15:32 -0400
commit087ef940eac18e561078e09b20e9e3cdb22ad9ff (patch)
treeaf0ebfbf16350347cff9862de596aa372c9250b9 /trace-cmd.c
parent84d78973993710e0964aa801d5dcf1b5c4690216 (diff)
trace-cmd: Added trace stack command
Added the command "trace-cmd stack" to run the stack tracer. It simply enables the stack tracer and depending on the options it will ouput the current stack, or disable it. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-cmd.c')
-rw-r--r--trace-cmd.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/trace-cmd.c b/trace-cmd.c
index cce499a..9cbe362 100644
--- a/trace-cmd.c
+++ b/trace-cmd.c
@@ -55,6 +55,19 @@
55int silence_warnings; 55int silence_warnings;
56int show_status; 56int show_status;
57 57
58static char *get_tracing_file(const char *name);
59static void put_tracing_file(char *file);
60
61char *tracecmd_get_tracing_file(const char *name)
62{
63 return get_tracing_file(name);
64}
65
66void tracecmd_put_tracing_file(char *name)
67{
68 put_tracing_file(name);
69}
70
58static int tracing_on_init_val; 71static int tracing_on_init_val;
59 72
60static int rt_prio; 73static int rt_prio;
@@ -286,9 +299,6 @@ static int set_ftrace(int set)
286 return 0; 299 return 0;
287} 300}
288 301
289static char *get_tracing_file(const char *name);
290static void put_tracing_file(char *file);
291
292static void clear_trace(void) 302static void clear_trace(void)
293{ 303{
294 FILE *fp; 304 FILE *fp;
@@ -1439,6 +1449,9 @@ int main (int argc, char **argv)
1439 } else if (strcmp(argv[1], "restore") == 0) { 1449 } else if (strcmp(argv[1], "restore") == 0) {
1440 trace_restore(argc, argv); 1450 trace_restore(argc, argv);
1441 exit(0); 1451 exit(0);
1452 } else if (strcmp(argv[1], "stack") == 0) {
1453 trace_stack(argc, argv);
1454 exit(0);
1442 } else if ((record = (strcmp(argv[1], "record") == 0)) || 1455 } else if ((record = (strcmp(argv[1], "record") == 0)) ||
1443 (strcmp(argv[1], "start") == 0) || 1456 (strcmp(argv[1], "start") == 0) ||
1444 ((extract = strcmp(argv[1], "extract") == 0))) { 1457 ((extract = strcmp(argv[1], "extract") == 0))) {