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:	Thu, 9 Jan 2014 19:06:28 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
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>,
	Arun Sharma <asharma@...com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Rodrigo Campos <rodrigo@...g.com.ar>
Subject: Re: [PATCH 10/28] perf report: Cache cumulative callchains

On Wed, Jan 08, 2014 at 05:46:15PM +0900, Namhyung Kim wrote:

SNIP

>  			goto out;
>  	}
>  
> -	if (al->map->groups == &iter->machine->kmaps) {
> -		if (machine__is_host(iter->machine)) {
> +	if (al->map->groups == &al->machine->kmaps) {
> +		if (machine__is_host(al->machine)) {
>  			al->cpumode = PERF_RECORD_MISC_KERNEL;
>  			al->level = 'k';
>  		} else {
> @@ -417,7 +440,7 @@ iter_next_cumulative_entry(struct hist_entry_iter *iter,
>  			al->level = 'g';
>  		}
>  	} else {
> -		if (machine__is_host(iter->machine)) {
> +		if (machine__is_host(al->machine)) {
>  			al->cpumode = PERF_RECORD_MISC_USER;
>  			al->level = '.';
>  		} else if (perf_guest) {
> @@ -440,7 +463,29 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
>  {
>  	struct perf_evsel *evsel = iter->evsel;
>  	struct perf_sample *sample = iter->sample;
> +	struct hist_entry **he_cache = iter->priv;
>  	struct hist_entry *he;
> +	struct hist_entry he_tmp = {
> +		.cpu = al->cpu,
> +		.thread = al->thread,
> +		.comm = thread__comm(al->thread),
> +		.ip = al->addr,
> +		.ms = {
> +			.map = al->map,
> +			.sym = al->sym,
> +		},
> +		.parent = iter->parent,
> +	};
> +	int i;
> +
> +	/*
> +	 * Check if there's duplicate entries in the callchain.
> +	 * It's possible that it has cycles or recursive calls.
> +	 */
> +	for (i = 0; i < iter->curr; i++) {
> +		if (hist_entry__cmp(he_cache[i], &he_tmp) == 0)

we need here:
			iter->he = he_cache[i];

> +			return 0;
> +	}

otherwise iter->he and al are not in sync and 
hist_entry__inc_addr_samples fails in hist_iter_cb

jirka
--
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