builtin-trace.c (ac9be8ee4ecdeae73c78d84ebfe37009e11cf99d) builtin-trace.c (b059efdf52a27819b78aa30f171f1e8e439152b6)
1#include <traceevent/event-parse.h>
2#include "builtin.h"
3#include "util/color.h"
4#include "util/evlist.h"
5#include "util/machine.h"
6#include "util/thread.h"
7#include "util/parse-options.h"
8#include "util/strlist.h"

--- 100 unchanged lines hidden (view full) ---

109 struct {
110 int max;
111 struct syscall *table;
112 } syscalls;
113 struct perf_record_opts opts;
114 struct machine host;
115 u64 base_time;
116 FILE *output;
1#include <traceevent/event-parse.h>
2#include "builtin.h"
3#include "util/color.h"
4#include "util/evlist.h"
5#include "util/machine.h"
6#include "util/thread.h"
7#include "util/parse-options.h"
8#include "util/strlist.h"

--- 100 unchanged lines hidden (view full) ---

109 struct {
110 int max;
111 struct syscall *table;
112 } syscalls;
113 struct perf_record_opts opts;
114 struct machine host;
115 u64 base_time;
116 FILE *output;
117 struct strlist *ev_qualifier;
118 unsigned long nr_events;
117 unsigned long nr_events;
118 struct strlist *ev_qualifier;
119 bool not_ev_qualifier;
119 bool sched;
120 bool multiple_threads;
121 double duration_filter;
122 double runtime_ms;
123};
124
125static bool trace__filter_duration(struct trace *trace, double t)
126{

--- 102 unchanged lines hidden (view full) ---

229
230 trace->syscalls.table = nsyscalls;
231 trace->syscalls.max = id;
232 }
233
234 sc = trace->syscalls.table + id;
235 sc->name = name;
236
120 bool sched;
121 bool multiple_threads;
122 double duration_filter;
123 double runtime_ms;
124};
125
126static bool trace__filter_duration(struct trace *trace, double t)
127{

--- 102 unchanged lines hidden (view full) ---

230
231 trace->syscalls.table = nsyscalls;
232 trace->syscalls.max = id;
233 }
234
235 sc = trace->syscalls.table + id;
236 sc->name = name;
237
237 if (trace->ev_qualifier && !strlist__find(trace->ev_qualifier, name)) {
238 sc->filtered = true;
239 /*
240 * No need to do read tracepoint information since this will be
241 * filtered out.
242 */
243 return 0;
238 if (trace->ev_qualifier) {
239 bool in = strlist__find(trace->ev_qualifier, name) != NULL;
240
241 if (!(in ^ trace->not_ev_qualifier)) {
242 sc->filtered = true;
243 /*
244 * No need to do read tracepoint information since this will be
245 * filtered out.
246 */
247 return 0;
248 }
244 }
245
246 sc->fmt = syscall_fmt__find(sc->name);
247
248 snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name);
249 sc->tp_format = event_format__new("syscalls", tp_name);
250
251 if (sc->tp_format == NULL && sc->fmt && sc->fmt->alias) {

--- 468 unchanged lines hidden (view full) ---

720 err = trace__open_output(&trace, output_name);
721 if (err < 0) {
722 perror("failed to create output file");
723 goto out;
724 }
725 }
726
727 if (ev_qualifier_str != NULL) {
249 }
250
251 sc->fmt = syscall_fmt__find(sc->name);
252
253 snprintf(tp_name, sizeof(tp_name), "sys_enter_%s", sc->name);
254 sc->tp_format = event_format__new("syscalls", tp_name);
255
256 if (sc->tp_format == NULL && sc->fmt && sc->fmt->alias) {

--- 468 unchanged lines hidden (view full) ---

725 err = trace__open_output(&trace, output_name);
726 if (err < 0) {
727 perror("failed to create output file");
728 goto out;
729 }
730 }
731
732 if (ev_qualifier_str != NULL) {
728 trace.ev_qualifier = strlist__new(true, ev_qualifier_str);
733 const char *s = ev_qualifier_str;
734
735 trace.not_ev_qualifier = *s == '!';
736 if (trace.not_ev_qualifier)
737 ++s;
738 trace.ev_qualifier = strlist__new(true, s);
729 if (trace.ev_qualifier == NULL) {
730 fputs("Not enough memory to parse event qualifier",
731 trace.output);
732 err = -ENOMEM;
733 goto out_close;
734 }
735 }
736

--- 28 unchanged lines hidden ---
739 if (trace.ev_qualifier == NULL) {
740 fputs("Not enough memory to parse event qualifier",
741 trace.output);
742 err = -ENOMEM;
743 goto out_close;
744 }
745 }
746

--- 28 unchanged lines hidden ---