Commit | Line | Data |
---|---|---|
514f1c67 | 1 | #include "builtin.h" |
752fde44 | 2 | #include "util/color.h" |
514f1c67 | 3 | #include "util/evlist.h" |
752fde44 ACM |
4 | #include "util/machine.h" |
5 | #include "util/thread.h" | |
514f1c67 ACM |
6 | #include "util/parse-options.h" |
7 | #include "util/thread_map.h" | |
8 | #include "event-parse.h" | |
9 | ||
10 | #include <libaudit.h> | |
11 | #include <stdlib.h> | |
12 | ||
13 | static struct syscall_fmt { | |
14 | const char *name; | |
aec1930b | 15 | const char *alias; |
514f1c67 ACM |
16 | bool errmsg; |
17 | bool timeout; | |
18 | } syscall_fmts[] = { | |
aec1930b ACM |
19 | { .name = "arch_prctl", .errmsg = true, .alias = "prctl", }, |
20 | { .name = "fstat", .errmsg = true, .alias = "newfstat", }, | |
21 | { .name = "fstatat", .errmsg = true, .alias = "newfstatat", }, | |
22 | { .name = "futex", .errmsg = true, }, | |
23 | { .name = "poll", .errmsg = true, .timeout = true, }, | |
24 | { .name = "ppoll", .errmsg = true, .timeout = true, }, | |
25 | { .name = "read", .errmsg = true, }, | |
26 | { .name = "recvfrom", .errmsg = true, }, | |
27 | { .name = "select", .errmsg = true, .timeout = true, }, | |
28 | { .name = "stat", .errmsg = true, .alias = "newstat", }, | |
514f1c67 ACM |
29 | }; |
30 | ||
31 | static int syscall_fmt__cmp(const void *name, const void *fmtp) | |
32 | { | |
33 | const struct syscall_fmt *fmt = fmtp; | |
34 | return strcmp(name, fmt->name); | |
35 | } | |
36 | ||
37 | static struct syscall_fmt *syscall_fmt__find(const char *name) | |
38 | { | |
39 | const int nmemb = ARRAY_SIZE(syscall_fmts); | |
40 | return bsearch(name, syscall_fmts, nmemb, sizeof(struct syscall_fmt), syscall_fmt__cmp); | |
41 | } | |
42 | ||
43 | struct syscall { | |
44 | struct event_format *tp_format; | |
45 | const char *name; | |
46 | struct syscall_fmt *fmt; | |
47 | }; | |
48 | ||
60c907ab ACM |
49 | static size_t fprintf_duration(unsigned long t, FILE *fp) |
50 | { | |
51 | double duration = (double)t / NSEC_PER_MSEC; | |
52 | size_t printed = fprintf(fp, "("); | |
53 | ||
54 | if (duration >= 1.0) | |
55 | printed += color_fprintf(fp, PERF_COLOR_RED, "%6.3f ms", duration); | |
56 | else if (duration >= 0.01) | |
57 | printed += color_fprintf(fp, PERF_COLOR_YELLOW, "%6.3f ms", duration); | |
58 | else | |
59 | printed += color_fprintf(fp, PERF_COLOR_NORMAL, "%6.3f ms", duration); | |
60 | return printed + fprintf(stdout, "): "); | |
61 | } | |
62 | ||
752fde44 ACM |
63 | struct thread_trace { |
64 | u64 entry_time; | |
65 | u64 exit_time; | |
66 | bool entry_pending; | |
67 | char *entry_str; | |
68 | }; | |
69 | ||
70 | static struct thread_trace *thread_trace__new(void) | |
71 | { | |
72 | return zalloc(sizeof(struct thread_trace)); | |
73 | } | |
74 | ||
75 | static struct thread_trace *thread__trace(struct thread *thread) | |
76 | { | |
77 | if (thread == NULL) | |
78 | goto fail; | |
79 | ||
80 | if (thread->priv == NULL) | |
81 | thread->priv = thread_trace__new(); | |
82 | ||
83 | if (thread->priv == NULL) | |
84 | goto fail; | |
85 | ||
86 | return thread->priv; | |
87 | fail: | |
88 | color_fprintf(stdout, PERF_COLOR_RED, | |
89 | "WARNING: not enough memory, dropping samples!\n"); | |
90 | return NULL; | |
91 | } | |
92 | ||
514f1c67 ACM |
93 | struct trace { |
94 | int audit_machine; | |
95 | struct { | |
96 | int max; | |
97 | struct syscall *table; | |
98 | } syscalls; | |
99 | struct perf_record_opts opts; | |
752fde44 ACM |
100 | struct machine host; |
101 | u64 base_time; | |
102 | bool multiple_threads; | |
514f1c67 ACM |
103 | }; |
104 | ||
752fde44 ACM |
105 | static size_t trace__fprintf_tstamp(struct trace *trace, u64 tstamp, FILE *fp) |
106 | { | |
107 | double ts = (double)(tstamp - trace->base_time) / NSEC_PER_MSEC; | |
108 | ||
60c907ab | 109 | return fprintf(fp, "%10.3f ", ts); |
752fde44 ACM |
110 | } |
111 | ||
f15eb531 NK |
112 | static bool done = false; |
113 | ||
114 | static void sig_handler(int sig __maybe_unused) | |
115 | { | |
116 | done = true; | |
117 | } | |
118 | ||
752fde44 | 119 | static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread, |
60c907ab | 120 | u64 duration, u64 tstamp, FILE *fp) |
752fde44 ACM |
121 | { |
122 | size_t printed = trace__fprintf_tstamp(trace, tstamp, fp); | |
60c907ab | 123 | printed += fprintf_duration(duration, fp); |
752fde44 ACM |
124 | |
125 | if (trace->multiple_threads) | |
126 | printed += fprintf(fp, "%d ", thread->pid); | |
127 | ||
128 | return printed; | |
129 | } | |
130 | ||
131 | static int trace__process_event(struct machine *machine, union perf_event *event) | |
132 | { | |
133 | int ret = 0; | |
134 | ||
135 | switch (event->header.type) { | |
136 | case PERF_RECORD_LOST: | |
137 | color_fprintf(stdout, PERF_COLOR_RED, | |
138 | "LOST %" PRIu64 " events!\n", event->lost.lost); | |
139 | ret = machine__process_lost_event(machine, event); | |
140 | default: | |
141 | ret = machine__process_event(machine, event); | |
142 | break; | |
143 | } | |
144 | ||
145 | return ret; | |
146 | } | |
147 | ||
148 | static int trace__tool_process(struct perf_tool *tool __maybe_unused, | |
149 | union perf_event *event, | |
150 | struct perf_sample *sample __maybe_unused, | |
151 | struct machine *machine) | |
152 | { | |
153 | return trace__process_event(machine, event); | |
154 | } | |
155 | ||
156 | static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist) | |
157 | { | |
158 | int err = symbol__init(); | |
159 | ||
160 | if (err) | |
161 | return err; | |
162 | ||
163 | machine__init(&trace->host, "", HOST_KERNEL_ID); | |
164 | machine__create_kernel_maps(&trace->host); | |
165 | ||
166 | if (perf_target__has_task(&trace->opts.target)) { | |
167 | err = perf_event__synthesize_thread_map(NULL, evlist->threads, | |
168 | trace__tool_process, | |
169 | &trace->host); | |
170 | } else { | |
171 | err = perf_event__synthesize_threads(NULL, trace__tool_process, | |
172 | &trace->host); | |
173 | } | |
174 | ||
175 | if (err) | |
176 | symbol__exit(); | |
177 | ||
178 | return err; | |
179 | } | |
180 | ||
514f1c67 ACM |
181 | static int trace__read_syscall_info(struct trace *trace, int id) |
182 | { | |
183 | char tp_name[128]; | |
184 | struct syscall *sc; | |
3a531260 ACM |
185 | const char *name = audit_syscall_to_name(id, trace->audit_machine); |
186 | ||
187 | if (name == NULL) | |
188 | return -1; | |
514f1c67 ACM |
189 | |
190 | if (id > trace->syscalls.max) { | |
191 | struct syscall *nsyscalls = realloc(trace->syscalls.table, (id + 1) * sizeof(*sc)); | |
192 | ||
193 | if (nsyscalls == NULL) | |
194 | return -1; | |
195 | ||
196 | if (trace->syscalls.max != -1) { | |
197 | memset(nsyscalls + trace->syscalls.max + 1, 0, | |
198 | (id - trace->syscalls.max) * sizeof(*sc)); | |
199 | } else { | |
200 | memset(nsyscalls, 0, (id + 1) * sizeof(*sc)); | |
201 | } | |
202 | ||
203 | trace->syscalls.table = nsyscalls; | |
204 | trace->syscalls.max = id; | |
205 | } | |
206 | ||
207 | sc = trace->syscalls.table + id; | |
3a531260 ACM |
208 | sc->name = name; |
209 | sc->fmt = syscall_fmt__find(sc->name); | |
514f1c67 | 210 | |
aec1930b | 211 | snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name); |
514f1c67 | 212 | sc->tp_format = event_format__new("syscalls", tp_name); |
aec1930b ACM |
213 | |
214 | if (sc->tp_format == NULL && sc->fmt && sc->fmt->alias) { | |
215 | snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->fmt->alias); | |
216 | sc->tp_format = event_format__new("syscalls", tp_name); | |
217 | } | |
514f1c67 ACM |
218 | |
219 | return sc->tp_format != NULL ? 0 : -1; | |
220 | } | |
221 | ||
752fde44 ACM |
222 | static size_t syscall__scnprintf_args(struct syscall *sc, char *bf, size_t size, |
223 | unsigned long *args) | |
514f1c67 ACM |
224 | { |
225 | int i = 0; | |
226 | size_t printed = 0; | |
227 | ||
228 | if (sc->tp_format != NULL) { | |
229 | struct format_field *field; | |
230 | ||
231 | for (field = sc->tp_format->format.fields->next; field; field = field->next) { | |
752fde44 ACM |
232 | printed += scnprintf(bf + printed, size - printed, |
233 | "%s%s: %ld", printed ? ", " : "", | |
234 | field->name, args[i++]); | |
514f1c67 ACM |
235 | } |
236 | } else { | |
237 | while (i < 6) { | |
752fde44 ACM |
238 | printed += scnprintf(bf + printed, size - printed, |
239 | "%sarg%d: %ld", | |
240 | printed ? ", " : "", i, args[i]); | |
514f1c67 ACM |
241 | ++i; |
242 | } | |
243 | } | |
244 | ||
245 | return printed; | |
246 | } | |
247 | ||
ba3d7dee ACM |
248 | typedef int (*tracepoint_handler)(struct trace *trace, struct perf_evsel *evsel, |
249 | struct perf_sample *sample); | |
250 | ||
251 | static struct syscall *trace__syscall_info(struct trace *trace, | |
252 | struct perf_evsel *evsel, | |
253 | struct perf_sample *sample) | |
254 | { | |
255 | int id = perf_evsel__intval(evsel, sample, "id"); | |
256 | ||
257 | if (id < 0) { | |
258 | printf("Invalid syscall %d id, skipping...\n", id); | |
259 | return NULL; | |
260 | } | |
261 | ||
262 | if ((id > trace->syscalls.max || trace->syscalls.table[id].name == NULL) && | |
263 | trace__read_syscall_info(trace, id)) | |
264 | goto out_cant_read; | |
265 | ||
266 | if ((id > trace->syscalls.max || trace->syscalls.table[id].name == NULL)) | |
267 | goto out_cant_read; | |
268 | ||
269 | return &trace->syscalls.table[id]; | |
270 | ||
271 | out_cant_read: | |
272 | printf("Problems reading syscall %d information\n", id); | |
273 | return NULL; | |
274 | } | |
275 | ||
276 | static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, | |
277 | struct perf_sample *sample) | |
278 | { | |
752fde44 | 279 | char *msg; |
ba3d7dee | 280 | void *args; |
752fde44 ACM |
281 | size_t printed = 0; |
282 | struct thread *thread = machine__findnew_thread(&trace->host, sample->tid); | |
ba3d7dee | 283 | struct syscall *sc = trace__syscall_info(trace, evsel, sample); |
752fde44 | 284 | struct thread_trace *ttrace = thread__trace(thread); |
ba3d7dee | 285 | |
752fde44 | 286 | if (ttrace == NULL || sc == NULL) |
ba3d7dee ACM |
287 | return -1; |
288 | ||
289 | args = perf_evsel__rawptr(evsel, sample, "args"); | |
290 | if (args == NULL) { | |
291 | printf("Problems reading syscall arguments\n"); | |
292 | return -1; | |
293 | } | |
294 | ||
752fde44 ACM |
295 | ttrace = thread->priv; |
296 | ||
297 | if (ttrace->entry_str == NULL) { | |
298 | ttrace->entry_str = malloc(1024); | |
299 | if (!ttrace->entry_str) | |
300 | return -1; | |
301 | } | |
302 | ||
303 | ttrace->entry_time = sample->time; | |
304 | msg = ttrace->entry_str; | |
305 | printed += scnprintf(msg + printed, 1024 - printed, "%s(", sc->name); | |
306 | ||
307 | printed += syscall__scnprintf_args(sc, msg + printed, 1024 - printed, args); | |
308 | ||
309 | if (!strcmp(sc->name, "exit_group") || !strcmp(sc->name, "exit")) { | |
60c907ab | 310 | trace__fprintf_entry_head(trace, thread, 1, sample->time, stdout); |
752fde44 ACM |
311 | printf("%-70s\n", ttrace->entry_str); |
312 | } else | |
313 | ttrace->entry_pending = true; | |
ba3d7dee ACM |
314 | |
315 | return 0; | |
316 | } | |
317 | ||
318 | static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, | |
319 | struct perf_sample *sample) | |
320 | { | |
321 | int ret; | |
60c907ab | 322 | u64 duration = 0; |
752fde44 ACM |
323 | struct thread *thread = machine__findnew_thread(&trace->host, sample->tid); |
324 | struct thread_trace *ttrace = thread__trace(thread); | |
ba3d7dee ACM |
325 | struct syscall *sc = trace__syscall_info(trace, evsel, sample); |
326 | ||
752fde44 | 327 | if (ttrace == NULL || sc == NULL) |
ba3d7dee ACM |
328 | return -1; |
329 | ||
330 | ret = perf_evsel__intval(evsel, sample, "ret"); | |
331 | ||
752fde44 ACM |
332 | ttrace = thread->priv; |
333 | ||
334 | ttrace->exit_time = sample->time; | |
335 | ||
60c907ab ACM |
336 | if (ttrace->entry_time) |
337 | duration = sample->time - ttrace->entry_time; | |
338 | ||
339 | trace__fprintf_entry_head(trace, thread, duration, sample->time, stdout); | |
752fde44 ACM |
340 | |
341 | if (ttrace->entry_pending) { | |
342 | printf("%-70s", ttrace->entry_str); | |
343 | } else { | |
344 | printf(" ... ["); | |
345 | color_fprintf(stdout, PERF_COLOR_YELLOW, "continued"); | |
346 | printf("]: %s()", sc->name); | |
347 | } | |
348 | ||
ba3d7dee ACM |
349 | if (ret < 0 && sc->fmt && sc->fmt->errmsg) { |
350 | char bf[256]; | |
351 | const char *emsg = strerror_r(-ret, bf, sizeof(bf)), | |
352 | *e = audit_errno_to_name(-ret); | |
353 | ||
354 | printf(") = -1 %s %s", e, emsg); | |
355 | } else if (ret == 0 && sc->fmt && sc->fmt->timeout) | |
356 | printf(") = 0 Timeout"); | |
357 | else | |
358 | printf(") = %d", ret); | |
359 | ||
360 | putchar('\n'); | |
752fde44 ACM |
361 | |
362 | ttrace->entry_pending = false; | |
363 | ||
ba3d7dee ACM |
364 | return 0; |
365 | } | |
366 | ||
f15eb531 | 367 | static int trace__run(struct trace *trace, int argc, const char **argv) |
514f1c67 ACM |
368 | { |
369 | struct perf_evlist *evlist = perf_evlist__new(NULL, NULL); | |
ba3d7dee | 370 | struct perf_evsel *evsel; |
514f1c67 | 371 | int err = -1, i, nr_events = 0, before; |
f15eb531 | 372 | const bool forks = argc > 0; |
514f1c67 ACM |
373 | |
374 | if (evlist == NULL) { | |
375 | printf("Not enough memory to run!\n"); | |
376 | goto out; | |
377 | } | |
378 | ||
39876e7d ACM |
379 | if (perf_evlist__add_newtp(evlist, "raw_syscalls", "sys_enter", trace__sys_enter) || |
380 | perf_evlist__add_newtp(evlist, "raw_syscalls", "sys_exit", trace__sys_exit)) { | |
381 | printf("Couldn't read the raw_syscalls tracepoints information!\n"); | |
514f1c67 ACM |
382 | goto out_delete_evlist; |
383 | } | |
384 | ||
514f1c67 ACM |
385 | err = perf_evlist__create_maps(evlist, &trace->opts.target); |
386 | if (err < 0) { | |
387 | printf("Problems parsing the target to trace, check your options!\n"); | |
388 | goto out_delete_evlist; | |
389 | } | |
390 | ||
752fde44 ACM |
391 | err = trace__symbols_init(trace, evlist); |
392 | if (err < 0) { | |
393 | printf("Problems initializing symbol libraries!\n"); | |
394 | goto out_delete_evlist; | |
395 | } | |
396 | ||
514f1c67 ACM |
397 | perf_evlist__config_attrs(evlist, &trace->opts); |
398 | ||
f15eb531 NK |
399 | signal(SIGCHLD, sig_handler); |
400 | signal(SIGINT, sig_handler); | |
401 | ||
402 | if (forks) { | |
403 | err = perf_evlist__prepare_workload(evlist, &trace->opts, argv); | |
404 | if (err < 0) { | |
405 | printf("Couldn't run the workload!\n"); | |
406 | goto out_delete_evlist; | |
407 | } | |
408 | } | |
409 | ||
514f1c67 ACM |
410 | err = perf_evlist__open(evlist); |
411 | if (err < 0) { | |
412 | printf("Couldn't create the events: %s\n", strerror(errno)); | |
413 | goto out_delete_evlist; | |
414 | } | |
415 | ||
416 | err = perf_evlist__mmap(evlist, UINT_MAX, false); | |
417 | if (err < 0) { | |
418 | printf("Couldn't mmap the events: %s\n", strerror(errno)); | |
419 | goto out_delete_evlist; | |
420 | } | |
421 | ||
422 | perf_evlist__enable(evlist); | |
f15eb531 NK |
423 | |
424 | if (forks) | |
425 | perf_evlist__start_workload(evlist); | |
426 | ||
752fde44 | 427 | trace->multiple_threads = evlist->threads->map[0] == -1 || evlist->threads->nr > 1; |
514f1c67 ACM |
428 | again: |
429 | before = nr_events; | |
430 | ||
431 | for (i = 0; i < evlist->nr_mmaps; i++) { | |
432 | union perf_event *event; | |
433 | ||
434 | while ((event = perf_evlist__mmap_read(evlist, i)) != NULL) { | |
435 | const u32 type = event->header.type; | |
ba3d7dee | 436 | tracepoint_handler handler; |
514f1c67 | 437 | struct perf_sample sample; |
514f1c67 ACM |
438 | |
439 | ++nr_events; | |
440 | ||
514f1c67 ACM |
441 | err = perf_evlist__parse_sample(evlist, event, &sample); |
442 | if (err) { | |
443 | printf("Can't parse sample, err = %d, skipping...\n", err); | |
444 | continue; | |
445 | } | |
446 | ||
752fde44 ACM |
447 | if (trace->base_time == 0) |
448 | trace->base_time = sample.time; | |
449 | ||
450 | if (type != PERF_RECORD_SAMPLE) { | |
451 | trace__process_event(&trace->host, event); | |
452 | continue; | |
453 | } | |
454 | ||
514f1c67 ACM |
455 | evsel = perf_evlist__id2evsel(evlist, sample.id); |
456 | if (evsel == NULL) { | |
457 | printf("Unknown tp ID %" PRIu64 ", skipping...\n", sample.id); | |
458 | continue; | |
459 | } | |
460 | ||
752fde44 ACM |
461 | if (sample.raw_data == NULL) { |
462 | printf("%s sample with no payload for tid: %d, cpu %d, raw_size=%d, skipping...\n", | |
463 | perf_evsel__name(evsel), sample.tid, | |
464 | sample.cpu, sample.raw_size); | |
465 | continue; | |
466 | } | |
514f1c67 | 467 | |
fc551f8d ACM |
468 | if (sample.raw_data == NULL) { |
469 | printf("%s sample with no payload for tid: %d, cpu %d, raw_size=%d, skipping...\n", | |
470 | perf_evsel__name(evsel), sample.tid, | |
471 | sample.cpu, sample.raw_size); | |
472 | continue; | |
473 | } | |
474 | ||
ba3d7dee ACM |
475 | handler = evsel->handler.func; |
476 | handler(trace, evsel, &sample); | |
514f1c67 ACM |
477 | } |
478 | } | |
479 | ||
f15eb531 NK |
480 | if (nr_events == before) { |
481 | if (done) | |
482 | goto out_delete_evlist; | |
483 | ||
514f1c67 | 484 | poll(evlist->pollfd, evlist->nr_fds, -1); |
f15eb531 NK |
485 | } |
486 | ||
487 | if (done) | |
488 | perf_evlist__disable(evlist); | |
514f1c67 ACM |
489 | |
490 | goto again; | |
491 | ||
492 | out_delete_evlist: | |
493 | perf_evlist__delete(evlist); | |
494 | out: | |
495 | return err; | |
496 | } | |
497 | ||
498 | int cmd_trace(int argc, const char **argv, const char *prefix __maybe_unused) | |
499 | { | |
500 | const char * const trace_usage[] = { | |
f15eb531 NK |
501 | "perf trace [<options>] [<command>]", |
502 | "perf trace [<options>] -- <command> [<options>]", | |
514f1c67 ACM |
503 | NULL |
504 | }; | |
505 | struct trace trace = { | |
506 | .audit_machine = audit_detect_machine(), | |
507 | .syscalls = { | |
508 | . max = -1, | |
509 | }, | |
510 | .opts = { | |
511 | .target = { | |
512 | .uid = UINT_MAX, | |
513 | .uses_mmap = true, | |
514 | }, | |
515 | .user_freq = UINT_MAX, | |
516 | .user_interval = ULLONG_MAX, | |
517 | .no_delay = true, | |
518 | .mmap_pages = 1024, | |
519 | }, | |
520 | }; | |
521 | const struct option trace_options[] = { | |
522 | OPT_STRING('p', "pid", &trace.opts.target.pid, "pid", | |
523 | "trace events on existing process id"), | |
524 | OPT_STRING(0, "tid", &trace.opts.target.tid, "tid", | |
525 | "trace events on existing thread id"), | |
526 | OPT_BOOLEAN(0, "all-cpus", &trace.opts.target.system_wide, | |
527 | "system-wide collection from all CPUs"), | |
528 | OPT_STRING(0, "cpu", &trace.opts.target.cpu_list, "cpu", | |
529 | "list of cpus to monitor"), | |
530 | OPT_BOOLEAN(0, "no-inherit", &trace.opts.no_inherit, | |
531 | "child tasks do not inherit counters"), | |
532 | OPT_UINTEGER(0, "mmap-pages", &trace.opts.mmap_pages, | |
533 | "number of mmap data pages"), | |
534 | OPT_STRING(0, "uid", &trace.opts.target.uid_str, "user", | |
535 | "user to profile"), | |
536 | OPT_END() | |
537 | }; | |
538 | int err; | |
32caf0d1 | 539 | char bf[BUFSIZ]; |
514f1c67 ACM |
540 | |
541 | argc = parse_options(argc, argv, trace_options, trace_usage, 0); | |
514f1c67 | 542 | |
32caf0d1 NK |
543 | err = perf_target__validate(&trace.opts.target); |
544 | if (err) { | |
545 | perf_target__strerror(&trace.opts.target, err, bf, sizeof(bf)); | |
546 | printf("%s", bf); | |
547 | return err; | |
548 | } | |
549 | ||
514f1c67 ACM |
550 | err = perf_target__parse_uid(&trace.opts.target); |
551 | if (err) { | |
514f1c67 ACM |
552 | perf_target__strerror(&trace.opts.target, err, bf, sizeof(bf)); |
553 | printf("%s", bf); | |
554 | return err; | |
555 | } | |
556 | ||
f15eb531 | 557 | if (!argc && perf_target__none(&trace.opts.target)) |
ee76120e NK |
558 | trace.opts.target.system_wide = true; |
559 | ||
f15eb531 | 560 | return trace__run(&trace, argc, argv); |
514f1c67 | 561 | } |