lkml.org 
[lkml]   [2014]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/21] perf tools: Introduce struct hist_entry_iter
On Thu, Jan 23, 2014 at 09:13:45AM +0900, Namhyung Kim wrote:
> There're some duplicate code when adding hist entries. They are
> different in that some have branch info or mem info but generally do
> same thing. So introduce new struct hist_entry_iter and add callbacks
> to customize each case in general way.
>

SNIP

>
> - 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.ops = &hist_iter_branch;
> + else if (rep->mem_mode == 1)

nit.. mem_mode is bool

jirka
> +


\
 
 \ /
  Last update: 2014-01-23 16:41    [W:0.526 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site