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]
Date:	Tue, 05 Nov 2013 16:41:41 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Stephane Eranian <eranian@...gle.com>,
	Rodrigo Campos <rodrigo@...g.com.ar>,
	Arun Sharma <asharma@...com>
Subject: Re: [PATCH 07/14] perf tools: Update cpumode for each cumulative entry

On Fri, 1 Nov 2013 13:55:51 +0100, Jiri Olsa wrote:
> On Thu, Oct 31, 2013 at 03:56:09PM +0900, Namhyung Kim wrote:
>> From: Namhyung Kim <namhyung.kim@....com>
>> 
>> The cpumode and level in struct addr_localtion was set for a sample
>> and but updated as cumulative callchains were added.  This led to have
>> non-matching symbol and cpumode in the output.
>> 
>> Update it accordingly based on the fact whether the map is a part of
>> the kernel or not.

[SNIP]

>> @@ -468,6 +470,27 @@ iter_next_cumulative_entry(struct add_entry_iter *iter __maybe_unused,
>>  	if (al->sym == NULL)
>>  		return 0;
>>  
>> +	if (al->map->groups == &iter->machine->kmaps) {
>> +		if (machine__is_host(iter->machine)) {
>> +			al->cpumode = PERF_RECORD_MISC_KERNEL;
>> +			al->level = 'k';
>> +		} else {
>> +			al->cpumode = PERF_RECORD_MISC_GUEST_KERNEL;
>> +			al->level = 'g';
>> +		}
>> +	} else {
>> +		if (machine__is_host(iter->machine)) {
>> +			al->cpumode = PERF_RECORD_MISC_USER;
>> +			al->level = '.';
>> +		} else if (perf_guest) {
>> +			al->cpumode = PERF_RECORD_MISC_GUEST_USER;
>> +			al->level = 'u';
>> +		} else {
>> +			al->cpumode = PERF_RECORD_MISC_HYPERVISOR;
>> +			al->level = 'H';
>> +		}
>> +	}
>> +
>
> Looks like this is what thread__find_addr_map does as well.
> Could above code go into a function used by both places?

In fact, it does the reverse - the thread__find_addr_map() tries to find
a map group (and map) using cpumode, but it wants to know cpumode using
map (and map group).

Thanks,
Namhyung
--
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