@@ -348,6 +355,24 @@ static void print_sample_start(struct perf_sample *sample,
}
}
+static void print_sample_finish(struct perf_evsel *evsel,
+ struct addr_location *al)
+{
+ struct perf_event_attr *attr = &evsel->attr;
+
+ if (PRINT_FIELD(SRCLINE) && al->map && al->map->dso) {
+ char *srcline;
+
+ srcline = get_srcline(al->map->dso,
+ map__rip_2objdump(al->map, al->addr));
+ if (srcline != SRCLINE_UNKNOWN)
+ printf("\n %s", srcline);
+ free_srcline(srcline);
+ }
+
+ printf("\n");
+}
+
static bool is_bts_event(struct perf_event_attr *attr)
{
return ((attr->type == PERF_TYPE_HARDWARE) &&
@@ -438,7 +463,7 @@ static void print_sample_bts(union perf_event *event,
!output[attr->type].user_set))
print_sample_addr(event, sample, machine, thread, attr);
- printf("\n");
+ print_sample_finish(evsel, al);
}
static void process_event(union perf_event *event, struct perf_sample *sample,
@@ -480,7 +505,7 @@ static void process_event(union perf_event *event, struct perf_sample *sample,
PERF_MAX_STACK_DEPTH);
}
- printf("\n");
+ print_sample_finish(evsel, al);
}
static int default_start_script(const char *script __maybe_unused,