diff options
author | Tony Lindgren <tony@atomide.com> | 2010-03-01 17:19:05 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-03-01 17:19:05 -0500 |
commit | d702d12167a2c05a346f49aac7a311d597762495 (patch) | |
tree | baae42c299cce34d6df24b5d01f8b1d0b481bd9a /tools/perf/util/build-id.c | |
parent | 9418c65f9bd861d0f7e39aab9cfb3aa6f2275d11 (diff) | |
parent | ac0f6f927db539e03e1f3f61bcd4ed57d5cde7a9 (diff) |
Merge with mainline to remove plat-omap/Kconfig conflict
Conflicts:
arch/arm/plat-omap/Kconfig
Diffstat (limited to 'tools/perf/util/build-id.c')
-rw-r--r-- | tools/perf/util/build-id.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c new file mode 100644 index 000000000000..04904b35ba81 --- /dev/null +++ b/tools/perf/util/build-id.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * build-id.c | ||
3 | * | ||
4 | * build-id support | ||
5 | * | ||
6 | * Copyright (C) 2009, 2010 Red Hat Inc. | ||
7 | * Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo <acme@redhat.com> | ||
8 | */ | ||
9 | #include "build-id.h" | ||
10 | #include "event.h" | ||
11 | #include "symbol.h" | ||
12 | #include <linux/kernel.h> | ||
13 | |||
14 | static int build_id__mark_dso_hit(event_t *event, struct perf_session *session) | ||
15 | { | ||
16 | struct addr_location al; | ||
17 | u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | ||
18 | struct thread *thread = perf_session__findnew(session, event->ip.pid); | ||
19 | |||
20 | if (thread == NULL) { | ||
21 | pr_err("problem processing %d event, skipping it.\n", | ||
22 | event->header.type); | ||
23 | return -1; | ||
24 | } | ||
25 | |||
26 | thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION, | ||
27 | event->ip.ip, &al); | ||
28 | |||
29 | if (al.map != NULL) | ||
30 | al.map->dso->hit = 1; | ||
31 | |||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | struct perf_event_ops build_id__mark_dso_hit_ops = { | ||
36 | .sample = build_id__mark_dso_hit, | ||
37 | .mmap = event__process_mmap, | ||
38 | .fork = event__process_task, | ||
39 | }; | ||