lkml.org 
[lkml]   [2017]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf stat: Support metrics with perf stat --per-thread
From
Date
> 
> I wonder if patch below would be enough for this
>
> jirka
>
>

Hi Jiri,

I think below patch and next patch (in your another mail) is OK, thanks!

Do I need to upgrade my patch to v2 according to your modifications?

Or you will post your patches? Both OK for me. :)

Thanks
Jin Yao

> ---
> diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
> index 35e9848734d6..56a0a36d0653 100644
> --- a/tools/perf/util/stat.c
> +++ b/tools/perf/util/stat.c
> @@ -259,6 +259,7 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel
> struct perf_counts_values *aggr = &evsel->counts->aggr;
> static struct perf_counts_values zero;
> bool skip = false;
> + u64 val;
>
> if (check_per_pkg(evsel, count, cpu, &skip)) {
> pr_err("failed to read per-pkg counter\n");
> @@ -270,6 +271,9 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel
>
> switch (config->aggr_mode) {
> case AGGR_THREAD:
> + val = count->val * evsel->scale;
> + perf_stat__update_shadow_stats(evsel, &val, 0);
> + break;
> case AGGR_CORE:
> case AGGR_SOCKET:
> case AGGR_NONE:
>

\
 
 \ /
  Last update: 2017-10-12 14:14    [W:0.043 / U:16.132 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site