Re: [Patch v1 08/10] perf report: add support for mem access profiling

From: Namhyung Kim
Date: Wed Oct 31 2012 - 02:01:36 EST


On Mon, 29 Oct 2012 16:15:50 +0100, Stephane Eranian wrote:
> This patch adds the --mem-mode option to perf report.
>
> This mode requires a perf.data file created with memory
> access samples.
>
> Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx>
> ---
[snip]
> + cost = mi->cost;
> + if (!cost)
> + cost = 1;
> +
> + /*
> + * The report shows the percentage of total branches captured
> + * and not events sampled. Thus we use a pseudo period of 1.

But cost won't be 1 anymore if PERF_SAMPLE_COST set, right?


> + * Only in the newt browser we are doing integrated annotation,
> + * so we don't allocated the extra space needed because the stdio
> + * code will not use it.

Yes, and gtk too.


> + */
> + he = __hists__add_mem_entry(&evsel->hists, al, parent, mi,
> + cost);
> + if (!he)
> + return -ENOMEM;
> +
> + if (sort__has_sym && he->ms.sym && use_browser > 0) {

So I'd rather write 'use_browser == 1' instead of '> 0'.


> + struct annotation *notes = symbol__annotation(he->ms.sym);
> +
> + assert(evsel != NULL);
> +
> + if (notes->src == NULL && symbol__alloc_hist(he->ms.sym) < 0)
> + goto out;
> +
> + err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr);
> + if (err)
> + goto out;
> + }
> +
> + if (sort__has_sym && he->mem_info->daddr.sym && use_browser > 0) {

Ditto.

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/