diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2011-01-04 20:07:38 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2011-01-04 20:07:38 -0500 |
| commit | f1b412402cff36987736748c150bd5c90dd5300b (patch) | |
| tree | d00ab609d5efad163830259f6d4190b44d93218a | |
| parent | 3de68e3ec662285bbd612c923308dbdc953420ac (diff) | |
trace-cmd: Add -a option to record to record all events
Add the -a option to trace-cmd record that will bring back the old
behavior of recording the format of all events.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
| -rw-r--r-- | Documentation/trace-cmd-record.1.txt | 8 | ||||
| -rw-r--r-- | trace-cmd.c | 26 |
2 files changed, 29 insertions, 5 deletions
diff --git a/Documentation/trace-cmd-record.1.txt b/Documentation/trace-cmd-record.1.txt index a8c9b98..0954540 100644 --- a/Documentation/trace-cmd-record.1.txt +++ b/Documentation/trace-cmd-record.1.txt | |||
| @@ -47,6 +47,14 @@ OPTIONS | |||
| 47 | 47 | ||
| 48 | The keyword 'all' can be used to enable all events. | 48 | The keyword 'all' can be used to enable all events. |
| 49 | 49 | ||
| 50 | *-a*:: | ||
| 51 | Every event that is being recorded has its output format file saved | ||
| 52 | in the output file to be able to display it later. But if other | ||
| 53 | events are enabled in the trace without trace-cmd's knowledge, the | ||
| 54 | formats of those events will not be recorded and trace-cmd report will | ||
| 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. | ||
| 57 | |||
| 50 | *-f* 'filter':: | 58 | *-f* 'filter':: |
| 51 | Specify a filter for the previous event. This must come after a *-e*. This | 59 | Specify a filter for the previous event. This must come after a *-e*. This |
| 52 | will filter what events get recorded based on the content of the event. | 60 | will filter what events get recorded based on the content of the event. |
diff --git a/trace-cmd.c b/trace-cmd.c index a8e99de..f54af18 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
| @@ -1420,6 +1420,7 @@ int main (int argc, char **argv) | |||
| 1420 | struct event_list *last_event; | 1420 | struct event_list *last_event; |
| 1421 | struct tracecmd_event_list *list; | 1421 | struct tracecmd_event_list *list; |
| 1422 | struct trace_seq s; | 1422 | struct trace_seq s; |
| 1423 | int record_all = 0; | ||
| 1423 | int disable = 0; | 1424 | int disable = 0; |
| 1424 | int plug = 0; | 1425 | int plug = 0; |
| 1425 | int events = 0; | 1426 | int events = 0; |
| @@ -1458,11 +1459,24 @@ int main (int argc, char **argv) | |||
| 1458 | (strcmp(argv[1], "start") == 0) || | 1459 | (strcmp(argv[1], "start") == 0) || |
| 1459 | ((extract = strcmp(argv[1], "extract") == 0))) { | 1460 | ((extract = strcmp(argv[1], "extract") == 0))) { |
| 1460 | 1461 | ||
| 1461 | while ((c = getopt(argc-1, argv+1, "+he:f:Fp:do:O:s:r:vg:l:n:P:N:tb:ki")) >= 0) { | 1462 | while ((c = getopt(argc-1, argv+1, "+hae:f:Fp:do:O:s:r:vg:l:n:P:N:tb:ki")) >= 0) { |
| 1462 | switch (c) { | 1463 | switch (c) { |
| 1463 | case 'h': | 1464 | case 'h': |
| 1464 | usage(argv); | 1465 | usage(argv); |
| 1465 | break; | 1466 | break; |
| 1467 | case 'a': | ||
| 1468 | record_all = 1; | ||
| 1469 | while (listed_events) { | ||
| 1470 | list = listed_events; | ||
| 1471 | listed_events = list->next; | ||
| 1472 | free(list); | ||
| 1473 | } | ||
| 1474 | list = malloc_or_die(sizeof(*list)); | ||
| 1475 | list->next = NULL; | ||
| 1476 | list->glob = "*/*"; | ||
| 1477 | listed_events = list; | ||
| 1478 | |||
| 1479 | break; | ||
| 1466 | case 'e': | 1480 | case 'e': |
| 1467 | if (extract) | 1481 | if (extract) |
| 1468 | usage(argv); | 1482 | usage(argv); |
| @@ -1475,10 +1489,12 @@ int main (int argc, char **argv) | |||
| 1475 | event->filter = NULL; | 1489 | event->filter = NULL; |
| 1476 | last_event = event; | 1490 | last_event = event; |
| 1477 | 1491 | ||
| 1478 | list = malloc_or_die(sizeof(*list)); | 1492 | if (!record_all) { |
| 1479 | list->next = listed_events; | 1493 | list = malloc_or_die(sizeof(*list)); |
| 1480 | list->glob = optarg; | 1494 | list->next = listed_events; |
| 1481 | listed_events = list; | 1495 | list->glob = optarg; |
| 1496 | listed_events = list; | ||
| 1497 | } | ||
| 1482 | 1498 | ||
| 1483 | break; | 1499 | break; |
| 1484 | case 'f': | 1500 | case 'f': |
