aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/build-id.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/build-id.c')
-rw-r--r--tools/perf/util/build-id.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 5295625c0c00..7ded71d19d75 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -18,13 +18,14 @@
18 18
19int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused, 19int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused,
20 union perf_event *event, 20 union perf_event *event,
21 struct perf_sample *sample __maybe_unused, 21 struct perf_sample *sample,
22 struct perf_evsel *evsel __maybe_unused, 22 struct perf_evsel *evsel __maybe_unused,
23 struct machine *machine) 23 struct machine *machine)
24{ 24{
25 struct addr_location al; 25 struct addr_location al;
26 u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 26 u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
27 struct thread *thread = machine__findnew_thread(machine, event->ip.pid); 27 struct thread *thread = machine__findnew_thread(machine, sample->pid,
28 sample->pid);
28 29
29 if (thread == NULL) { 30 if (thread == NULL) {
30 pr_err("problem processing %d event, skipping it.\n", 31 pr_err("problem processing %d event, skipping it.\n",
@@ -33,7 +34,7 @@ int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused,
33 } 34 }
34 35
35 thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION, 36 thread__find_addr_map(thread, machine, cpumode, MAP__FUNCTION,
36 event->ip.ip, &al); 37 sample->ip, &al);
37 38
38 if (al.map != NULL) 39 if (al.map != NULL)
39 al.map->dso->hit = 1; 40 al.map->dso->hit = 1;
@@ -47,7 +48,9 @@ static int perf_event__exit_del_thread(struct perf_tool *tool __maybe_unused,
47 __maybe_unused, 48 __maybe_unused,
48 struct machine *machine) 49 struct machine *machine)
49{ 50{
50 struct thread *thread = machine__findnew_thread(machine, event->fork.tid); 51 struct thread *thread = machine__findnew_thread(machine,
52 event->fork.pid,
53 event->fork.tid);
51 54
52 dump_printf("(%d:%d):(%d:%d)\n", event->fork.pid, event->fork.tid, 55 dump_printf("(%d:%d):(%d:%d)\n", event->fork.pid, event->fork.tid,
53 event->fork.ppid, event->fork.ptid); 56 event->fork.ppid, event->fork.ptid);
@@ -64,6 +67,7 @@ static int perf_event__exit_del_thread(struct perf_tool *tool __maybe_unused,
64struct perf_tool build_id__mark_dso_hit_ops = { 67struct perf_tool build_id__mark_dso_hit_ops = {
65 .sample = build_id__mark_dso_hit, 68 .sample = build_id__mark_dso_hit,
66 .mmap = perf_event__process_mmap, 69 .mmap = perf_event__process_mmap,
70 .mmap2 = perf_event__process_mmap2,
67 .fork = perf_event__process_fork, 71 .fork = perf_event__process_fork,
68 .exit = perf_event__exit_del_thread, 72 .exit = perf_event__exit_del_thread,
69 .attr = perf_event__process_attr, 73 .attr = perf_event__process_attr,