diff options
Diffstat (limited to 'tools/perf/util/thread.c')
-rw-r--r-- | tools/perf/util/thread.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 0358882c8910..3ce0498bdae6 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -142,3 +142,24 @@ int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp) | |||
142 | 142 | ||
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | |||
146 | void thread__find_cpumode_addr_location(struct thread *thread, | ||
147 | struct machine *machine, | ||
148 | enum map_type type, u64 addr, | ||
149 | struct addr_location *al) | ||
150 | { | ||
151 | size_t i; | ||
152 | const u8 const cpumodes[] = { | ||
153 | PERF_RECORD_MISC_USER, | ||
154 | PERF_RECORD_MISC_KERNEL, | ||
155 | PERF_RECORD_MISC_GUEST_USER, | ||
156 | PERF_RECORD_MISC_GUEST_KERNEL | ||
157 | }; | ||
158 | |||
159 | for (i = 0; i < ARRAY_SIZE(cpumodes); i++) { | ||
160 | thread__find_addr_location(thread, machine, cpumodes[i], type, | ||
161 | addr, al); | ||
162 | if (al->map) | ||
163 | break; | ||
164 | } | ||
165 | } | ||