lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F432E0B.5090608@hitachi.com>
Date:	Tue, 21 Feb 2012 14:39:23 +0900
From:	Akihiro Nagai <akihiro.nagai.hw@...achi.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	David Ahern <dsahern@...il.com>, linux-kernel@...r.kernel.org,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	yrl.pp-manager.tt@...achi.com, Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH -tip v5 2/5] perf: set correct value to perf_event_header.misc
 for BTS

(2012/01/30 18:35), Peter Zijlstra wrote:
> 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?

Of course, originally, perf does that. And, in those cases,
BTS records the both addresses of kernel and user in one
perf_sample on branches from kernel to user. Current perf
sets PERF_RECORD_MISC_KERNEL to all BTS events, and
perf-script doesn't resolve symbols and DSOs about the
user-space address, because it is a kernel event. So, to
solve both kernel and user symbols on an event, I had to
add this change.

Thank you,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ