mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andi Kleen <andi@firstfloor.org>, Arun Sharma <asharma@fb.com>,
	Rodrigo Campos <rodrigo@sdfg.com.ar>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 01/26] perf tools: Introduce struct hist_entry_iter
Date: Mon, 26 May 2014 20:27:43 +0200	[thread overview]
Message-ID: <20140526182743.GB9699@krava.brq.redhat.com> (raw)
In-Reply-To: <1400839463-21933-2-git-send-email-namhyung@kernel.org>

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

  reply	other threads:[~2014-05-26 18:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 10:03 [PATCHSET 00/26] perf tools: Add support to accumulate hist periods (v10) Namhyung Kim
2014-05-23 10:03 ` [PATCH 01/26] perf tools: Introduce struct hist_entry_iter Namhyung Kim
2014-05-26 18:27   ` Jiri Olsa [this message]
2014-05-26 18:44   ` Jiri Olsa
2014-05-28 23:46     ` Namhyung Kim
2014-05-23 10:03 ` [PATCH 02/26] perf hists: Add support for accumulated stat of hist entry Namhyung Kim
2014-05-23 10:04 ` [PATCH 03/26] perf hists: Check if accumulated when adding a " Namhyung Kim
2014-05-23 10:04 ` [PATCH 04/26] perf hists: Accumulate hist entry stat based on the callchain Namhyung Kim
2014-05-23 10:04 ` [PATCH 05/26] perf tools: Update cpumode for each cumulative entry Namhyung Kim
2014-05-23 10:04 ` [PATCH 06/26] perf report: Cache cumulative callchains Namhyung Kim
2014-05-23 10:04 ` [PATCH 07/26] perf callchain: Add callchain_cursor_snapshot() Namhyung Kim
2014-05-23 10:04 ` [PATCH 08/26] perf tools: Save callchain info for each cumulative entry Namhyung Kim
2014-05-23 10:04 ` [PATCH 09/26] perf ui/hist: Add support to accumulated hist stat Namhyung Kim
2014-05-23 10:04 ` [PATCH 10/26] perf ui/browser: " Namhyung Kim
2014-05-26 17:52   ` Jiri Olsa
2014-05-28 23:52     ` Namhyung Kim
2014-05-23 10:04 ` [PATCH 11/26] perf ui/gtk: " Namhyung Kim
2014-05-23 10:04 ` [PATCH 12/26] perf tools: Apply percent-limit to cumulative percentage Namhyung Kim
2014-05-26 17:57   ` Jiri Olsa
2014-05-23 10:04 ` [PATCH 13/26] perf tools: Add more hpp helper functions Namhyung Kim
2014-05-23 10:04 ` [PATCH 14/26] perf report: Add --children option Namhyung Kim
2014-05-23 10:04 ` [PATCH 15/26] perf report: Add report.children config option Namhyung Kim
2014-05-23 10:04 ` [PATCH 16/26] perf tools: Do not auto-remove Children column if --fields given Namhyung Kim
2014-05-23 10:04 ` [PATCH 17/26] perf tools: Add callback function to hist_entry_iter Namhyung Kim
2014-05-23 10:04 ` [PATCH 18/26] perf top: Convert " Namhyung Kim
2014-05-23 10:04 ` [PATCH 19/26] perf top: Add --children option Namhyung Kim
2014-05-23 10:04 ` [PATCH 20/26] perf top: Add top.children config option Namhyung Kim
2014-05-23 10:04 ` [PATCH 21/26] perf tools: Enable --children option by default Namhyung Kim
2014-05-23 10:04 ` [PATCH 22/26] perf ui/stdio: Fix invalid percentage value of cumulated hist entries Namhyung Kim
2014-05-23 10:04 ` [PATCH 23/26] perf ui/gtk: Fix callchain display Namhyung Kim
2014-05-23 10:04 ` [PATCH 24/26] perf tools: Reset output/sort order to default Namhyung Kim
2014-05-23 10:04 ` [PATCH 25/26] perf tests: Define and use symbolic names for fake symbols Namhyung Kim
2014-05-23 10:04 ` [PATCH 26/26] perf tests: Add a test case for cumulating callchains Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140526182743.GB9699@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=asharma@fb.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=rodrigo@sdfg.com.ar \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®