diff options
-rw-r--r-- | Documentation/trace-cmd-record.1.txt | 9 | ||||
-rw-r--r-- | trace-cmd.c | 10 | ||||
-rw-r--r-- | trace-usage.c | 1 |
3 files changed, 18 insertions, 2 deletions
diff --git a/Documentation/trace-cmd-record.1.txt b/Documentation/trace-cmd-record.1.txt index 81e37ac..9a51f91 100644 --- a/Documentation/trace-cmd-record.1.txt +++ b/Documentation/trace-cmd-record.1.txt | |||
@@ -138,6 +138,15 @@ OPTIONS | |||
138 | inside the kernel. Using "-b 10000" on a machine with 4 CPUs will make | 138 | inside the kernel. Using "-b 10000" on a machine with 4 CPUs will make |
139 | Ftrace have a total buffer size of 40 Megs. | 139 | Ftrace have a total buffer size of 40 Megs. |
140 | 140 | ||
141 | *-k*:: | ||
142 | By default, when trace-cmd is finished tracing, it will reset the buffers | ||
143 | and disable all the tracing that it enabled. This option keeps trace-cmd | ||
144 | from disabling the tracer and reseting the buffer. This option is useful for | ||
145 | debugging trace-cmd. | ||
146 | |||
147 | Note: usually trace-cmd will set the "tracing_on" file back to what it | ||
148 | was before it was called. This option will leave that file set to zero. | ||
149 | |||
141 | *-N* 'host:port':: | 150 | *-N* 'host:port':: |
142 | If another machine is running "trace-cmd listen", this option is used to | 151 | If another machine is running "trace-cmd listen", this option is used to |
143 | have the data sent to that machine with UDP packets. Instead of writing | 152 | have the data sent to that machine with UDP packets. Instead of writing |
diff --git a/trace-cmd.c b/trace-cmd.c index bd5254a..cdb0735 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -1407,6 +1407,7 @@ int main (int argc, char **argv) | |||
1407 | int extract = 0; | 1407 | int extract = 0; |
1408 | int run_command = 0; | 1408 | int run_command = 0; |
1409 | int neg_event = 0; | 1409 | int neg_event = 0; |
1410 | int keep = 0; | ||
1410 | int fset; | 1411 | int fset; |
1411 | int cpu; | 1412 | int cpu; |
1412 | 1413 | ||
@@ -1430,7 +1431,7 @@ int main (int argc, char **argv) | |||
1430 | (strcmp(argv[1], "start") == 0) || | 1431 | (strcmp(argv[1], "start") == 0) || |
1431 | ((extract = strcmp(argv[1], "extract") == 0))) { | 1432 | ((extract = strcmp(argv[1], "extract") == 0))) { |
1432 | 1433 | ||
1433 | while ((c = getopt(argc-1, argv+1, "+he:f:Fp:do:O:s:r:vg:l:n:P:N:tb:")) >= 0) { | 1434 | while ((c = getopt(argc-1, argv+1, "+he:f:Fp:do:O:s:r:vg:l:n:P:N:tb:k")) >= 0) { |
1434 | switch (c) { | 1435 | switch (c) { |
1435 | case 'h': | 1436 | case 'h': |
1436 | usage(argv); | 1437 | usage(argv); |
@@ -1539,6 +1540,9 @@ int main (int argc, char **argv) | |||
1539 | case 'b': | 1540 | case 'b': |
1540 | buffer_size = atoi(optarg); | 1541 | buffer_size = atoi(optarg); |
1541 | break; | 1542 | break; |
1543 | case 'k': | ||
1544 | keep = 1; | ||
1545 | break; | ||
1542 | } | 1546 | } |
1543 | } | 1547 | } |
1544 | 1548 | ||
@@ -1707,6 +1711,9 @@ int main (int argc, char **argv) | |||
1707 | printf("\n"); | 1711 | printf("\n"); |
1708 | } | 1712 | } |
1709 | 1713 | ||
1714 | if (keep) | ||
1715 | exit(0); | ||
1716 | |||
1710 | /* Turn off everything */ | 1717 | /* Turn off everything */ |
1711 | disable_all(); | 1718 | disable_all(); |
1712 | 1719 | ||
@@ -1714,7 +1721,6 @@ int main (int argc, char **argv) | |||
1714 | if (tracing_on_init_val) | 1721 | if (tracing_on_init_val) |
1715 | write_tracing_on(tracing_on_init_val); | 1722 | write_tracing_on(tracing_on_init_val); |
1716 | 1723 | ||
1717 | |||
1718 | exit(0); | 1724 | exit(0); |
1719 | 1725 | ||
1720 | return 0; | 1726 | return 0; |
diff --git a/trace-usage.c b/trace-usage.c index 9df19eb..2d7b668 100644 --- a/trace-usage.c +++ b/trace-usage.c | |||
@@ -36,6 +36,7 @@ static struct usage_help usage_help[] = { | |||
36 | " -N host:port to connect to (see listen)\n" | 36 | " -N host:port to connect to (see listen)\n" |
37 | " -t used with -N, forces use of tcp in live trace\n" | 37 | " -t used with -N, forces use of tcp in live trace\n" |
38 | " -b change kernel buffersize (in kilobytes per CPU)\n" | 38 | " -b change kernel buffersize (in kilobytes per CPU)\n" |
39 | " -k do not reset the buffers after tracing.\n" | ||
39 | }, | 40 | }, |
40 | { | 41 | { |
41 | "start", | 42 | "start", |