diff options
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-perl.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index e108207c5de0..c0c9795c4f02 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -194,7 +194,8 @@ static void define_event_symbols(struct event_format *event, zero_flag_atom = 0; break; case PRINT_FIELD: - free(cur_field_name); + if (cur_field_name) + free(cur_field_name); cur_field_name = strdup(args->field.name); break; case PRINT_FLAGS: @@ -256,9 +257,12 @@ static inline struct event_format *find_cache_event(struct perf_evsel *evsel) return event; } -static void perl_process_tracepoint(struct perf_sample *sample, +static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused, + struct perf_sample *sample, struct perf_evsel *evsel, - struct thread *thread) + struct machine *machine __maybe_unused, + struct thread *thread, + struct addr_location *al) { struct format_field *field; static char handler[256]; @@ -269,7 +273,7 @@ static void perl_process_tracepoint(struct perf_sample *sample, int cpu = sample->cpu; void *data = sample->raw_data; unsigned long long nsecs = sample->time; - const char *comm = thread__comm_str(thread); + char *comm = thread->comm; dSP; @@ -345,7 +349,10 @@ static void perl_process_tracepoint(struct perf_sample *sample, static void perl_process_event_generic(union perf_event *event, struct perf_sample *sample, - struct perf_evsel *evsel) + struct perf_evsel *evsel, + struct machine *machine __maybe_unused, + struct thread *thread __maybe_unused, + struct addr_location *al __maybe_unused) { dSP; @@ -370,11 +377,12 @@ static void perl_process_event_generic(union perf_event *event, static void perl_process_event(union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, + struct machine *machine, struct thread *thread, - struct addr_location *al __maybe_unused) + struct addr_location *al) { - perl_process_tracepoint(sample, evsel, thread); - perl_process_event_generic(event, sample, evsel); + perl_process_tracepoint(event, sample, evsel, machine, thread, al); + perl_process_event_generic(event, sample, evsel, machine, thread, al); } static void run_start_sub(void) |