diff options
Diffstat (limited to 'trace-cmd.c')
-rw-r--r-- | trace-cmd.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/trace-cmd.c b/trace-cmd.c index 5407a6c..384e218 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -162,7 +162,19 @@ int main (int argc, char **argv) | |||
162 | char *tracing; | 162 | char *tracing; |
163 | int ret; | 163 | int ret; |
164 | struct pevent *pevent = NULL; | 164 | struct pevent *pevent = NULL; |
165 | struct plugin_list *list = NULL; | ||
165 | 166 | ||
167 | while ((c = getopt(argc-1, argv+1, "+hN")) >= 0) { | ||
168 | switch (c) { | ||
169 | case 'h': | ||
170 | default: | ||
171 | usage(argv); | ||
172 | break; | ||
173 | case 'N': | ||
174 | tracecmd_disable_plugins = 1; | ||
175 | break; | ||
176 | } | ||
177 | } | ||
166 | tracing = tracecmd_find_tracing_dir(); | 178 | tracing = tracecmd_find_tracing_dir(); |
167 | 179 | ||
168 | if (!tracing) { | 180 | if (!tracing) { |
@@ -174,10 +186,14 @@ int main (int argc, char **argv) | |||
174 | exit(EINVAL); | 186 | exit(EINVAL); |
175 | } | 187 | } |
176 | 188 | ||
177 | ret = 0; | 189 | pevent = pevent_alloc(); |
178 | pevent = tracecmd_local_events(tracing); | 190 | if (!pevent) |
179 | if (!pevent || pevent->parsing_failures) | 191 | exit(EINVAL); |
192 | list = tracecmd_load_plugins(pevent); | ||
193 | ret = tracecmd_fill_local_events(tracing, pevent); | ||
194 | if (ret || pevent->parsing_failures) | ||
180 | ret = EINVAL; | 195 | ret = EINVAL; |
196 | tracecmd_unload_plugins(list); | ||
181 | pevent_free(pevent); | 197 | pevent_free(pevent); |
182 | exit(ret); | 198 | exit(ret); |
183 | 199 | ||