aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-02-25 11:35:51 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-02-25 11:39:59 -0500
commit5a925d4579b00f74a013f792e21a5586269206ff (patch)
tree10fe9815931ece476dbf91eda29bc060416f0cd2
parente97fce6d4719aff4637d9411e93717191895c6c7 (diff)
trace-cmd: extract command needs to record all events
When changing the code to limit the events recorded into the trace file to the events chosen by the user, it broke the extract code. The extract does not know what events are needed so it must record all events. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-record.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/trace-record.c b/trace-record.c
index d73d37d..9343822 100644
--- a/trace-record.c
+++ b/trace-record.c
@@ -1794,6 +1794,21 @@ void set_buffer_size(void)
1794 close(fd); 1794 close(fd);
1795} 1795}
1796 1796
1797static void record_all_events(void)
1798{
1799 struct tracecmd_event_list *list;
1800
1801 while (listed_events) {
1802 list = listed_events;
1803 listed_events = list->next;
1804 free(list);
1805 }
1806 list = malloc_or_die(sizeof(*list));
1807 list->next = NULL;
1808 list->glob = "*/*";
1809 listed_events = list;
1810}
1811
1797void trace_record (int argc, char **argv) 1812void trace_record (int argc, char **argv)
1798{ 1813{
1799 const char *plugin = NULL; 1814 const char *plugin = NULL;
@@ -1862,15 +1877,7 @@ void trace_record (int argc, char **argv)
1862 break; 1877 break;
1863 case 'a': 1878 case 'a':
1864 record_all = 1; 1879 record_all = 1;
1865 while (listed_events) { 1880 record_all_events();
1866 list = listed_events;
1867 listed_events = list->next;
1868 free(list);
1869 }
1870 list = malloc_or_die(sizeof(*list));
1871 list->next = NULL;
1872 list->glob = "*/*";
1873 listed_events = list;
1874 1881
1875 break; 1882 break;
1876 case 'e': 1883 case 'e':
@@ -2030,6 +2037,10 @@ void trace_record (int argc, char **argv)
2030 2037
2031 tracing_on_init_val = read_tracing_on(); 2038 tracing_on_init_val = read_tracing_on();
2032 2039
2040 /* Extracting data records all events in the system. */
2041 if (extract)
2042 record_all_events();
2043
2033 if (event_selection) 2044 if (event_selection)
2034 expand_event_list(); 2045 expand_event_list();
2035 2046