diff options
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 0b4646cd5245..e722107f932a 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -327,6 +327,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool) tool->lost = perf_event__process_lost; if (tool->aux == NULL) tool->aux = perf_event__process_aux; + if (tool->itrace_start == NULL) + tool->itrace_start = perf_event__process_itrace_start; if (tool->read == NULL) tool->read = process_event_sample_stub; if (tool->throttle == NULL) @@ -455,6 +457,16 @@ static void perf_event__aux_swap(union perf_event *event, bool sample_id_all) swap_sample_id_all(event, &event->aux + 1); } +static void perf_event__itrace_start_swap(union perf_event *event, + bool sample_id_all) +{ + event->itrace_start.pid = bswap_32(event->itrace_start.pid); + event->itrace_start.tid = bswap_32(event->itrace_start.tid); + + if (sample_id_all) + swap_sample_id_all(event, &event->itrace_start + 1); +} + static void perf_event__throttle_swap(union perf_event *event, bool sample_id_all) { @@ -593,6 +605,7 @@ static perf_event__swap_op perf_event__swap_ops[] = { [PERF_RECORD_UNTHROTTLE] = perf_event__throttle_swap, [PERF_RECORD_SAMPLE] = perf_event__all64_swap, [PERF_RECORD_AUX] = perf_event__aux_swap, + [PERF_RECORD_ITRACE_START] = perf_event__itrace_start_swap, [PERF_RECORD_HEADER_ATTR] = perf_event__hdr_attr_swap, [PERF_RECORD_HEADER_EVENT_TYPE] = perf_event__event_type_swap, [PERF_RECORD_HEADER_TRACING_DATA] = perf_event__tracing_data_swap, @@ -1044,6 +1057,8 @@ static int machines__deliver_event(struct machines *machines, return tool->unthrottle(tool, event, sample, machine); case PERF_RECORD_AUX: return tool->aux(tool, event, sample, machine); + case PERF_RECORD_ITRACE_START: + return tool->itrace_start(tool, event, sample, machine); default: ++evlist->stats.nr_unknown_events; return -1; |