Re: [PATCH -tip v5 2/5] perf: set correct value toperf_event_header.misc for BTS
From: Peter Zijlstra
Date: Mon Jan 30 2012 - 04:35:51 EST
On Mon, 2012-01-30 at 13:43 +0900, Akihiro Nagai wrote:
> @@ -330,6 +342,14 @@ int intel_pmu_drain_bts_buffer(void)
> return 1;
>
> for (; at < top; at++) {
> + /*
> + * To resolve user space symbols and DSOs correctly, set
> + * PERF_RECORD_MISC_USER if from_addr or to_addr is user space.
> + */
> + if (!kernel_ip(data.ip) || !kernel_ip(data.addr)) {
> + header.misc &= ~PERF_RECORD_MISC_CPUMODE_MASK;
> + header.misc |= PERF_RECORD_MISC_USER;
> + }
> data.ip = at->from;
> data.addr = at->to;
Why not key off of the from? If its a jump from userspace its a user
event, its a jump from kernel space its a kernel event?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/