lkml.org 
[lkml]   [2014]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/21] perf tools: Introduce struct add_entry_iter
On Tue, Dec 24, 2013 at 05:22:07PM +0900, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>

SNIP

> @@ -239,6 +426,7 @@ static int process_sample_event(struct perf_tool *tool,
> {
> struct report *rep = container_of(tool, struct report, tool);
> struct addr_location al;
> + struct add_entry_iter *iter;
> int ret;
>
> if (perf_event__preprocess_sample(event, machine, &al, sample) < 0) {
> @@ -253,22 +441,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(tool, &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(tool, &al, sample, evsel, event);
> - 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(tool, evsel, &al, sample);
> - if (ret < 0)
> - pr_debug("problem incrementing symbol period, skipping event\n");
> - }
> + if (sort__mode == SORT_MODE__BRANCH)
> + iter = &branch_iter;
> + else if (rep->mem_mode == 1) {
> + iter = &mem_iter;
> + iter->priv = event;
> + } else
> + iter = &normal_iter;
> +
> + if (al.map != NULL)
> + al.map->dso->hit = 1;
> +
> + iter->rep = rep;
> + ret = perf_evsel__add_entry(evsel, &al, sample, machine, iter);

you dont need to pass machine pointer, it's already in 'al'

jirka


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