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: <20140526182743.GB9699@krava.brq.redhat.com>
Date:	Mon, 26 May 2014 20:27:43 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Andi Kleen <andi@...stfloor.org>, Arun Sharma <asharma@...com>,
	Rodrigo Campos <rodrigo@...g.com.ar>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 01/26] perf tools: Introduce struct hist_entry_iter

On Fri, May 23, 2014 at 07:03:58PM +0900, Namhyung Kim wrote:

SNIP

>  static int process_sample_event(struct perf_tool *tool,
>  				union perf_event *event,
>  				struct perf_sample *sample,
> @@ -243,6 +84,9 @@ static int process_sample_event(struct perf_tool *tool,
>  {
>  	struct report *rep = container_of(tool, struct report, tool);
>  	struct addr_location al;
> +	struct hist_entry_iter iter = {
> +		.hide_unresolved = rep->hide_unresolved,
> +	};
>  	int ret;
>  
>  	if (perf_event__preprocess_sample(event, machine, &al, sample) < 0) {
> @@ -257,22 +101,22 @@ static int process_sample_event(struct perf_tool *tool,
>  	if (rep->cpu_list && !test_bit(sample->cpu, rep->cpu_bitmap))
>  		return 0;
>  
> -	if (sort__mode == SORT_MODE__BRANCH) {
> -		ret = report__add_branch_hist_entry(rep, &al, sample, evsel);
> -		if (ret < 0)
> -			pr_debug("problem adding lbr entry, skipping event\n");
> -	} else if (rep->mem_mode == 1) {
> -		ret = report__add_mem_hist_entry(rep, &al, sample, evsel);
> -		if (ret < 0)
> -			pr_debug("problem adding mem entry, skipping event\n");
> -	} else {
> -		if (al.map != NULL)
> -			al.map->dso->hit = 1;
> -
> -		ret = report__add_hist_entry(rep, evsel, &al, sample);
> -		if (ret < 0)
> -			pr_debug("problem incrementing symbol period, skipping event\n");
> -	}
> +	if (sort__mode == SORT_MODE__BRANCH)
> +		iter.ops = &hist_iter_branch;
> +	else if (rep->mem_mode)
> +		iter.ops = &hist_iter_mem;
> +	else
> +		iter.ops = &hist_iter_normal;
> +
> +	if (al.map != NULL)
> +		al.map->dso->hit = 1;
> +
> +	rep->nr_entries++;

hum, should we call report__inc_stats instead? aaand...

> +
> +	ret = hist_entry_iter__add(&iter, &al, evsel, sample, rep->max_stack);
> +	if (ret < 0)
> +		pr_debug("problem adding hist entry, skipping event\n");
> +

... in here? 

>  	return ret;
>  }


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