lkml.org 
[lkml]   [2014]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-05-26 21:01    [W:0.542 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site