Commit 14e72a21 authored by Jin Yao's avatar Jin Yao Committed by Arnaldo Carvalho de Melo

perf stat: Update or print per-thread stats

If the stats pointer in stat_config structure is not null, it will
update the per-thread stats or print the per-thread stats on this
buffer.
Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1512482591-4646-9-git-send-email-yao.jin@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 56739444
...@@ -1372,8 +1372,13 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix) ...@@ -1372,8 +1372,13 @@ static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
fprintf(output, "%s", prefix); fprintf(output, "%s", prefix);
uval = val * counter->scale; uval = val * counter->scale;
printout(thread, 0, counter, uval, prefix, run, ena, 1.0,
&rt_stat); if (stat_config.stats)
printout(thread, 0, counter, uval, prefix, run, ena,
1.0, &stat_config.stats[thread]);
else
printout(thread, 0, counter, uval, prefix, run, ena,
1.0, &rt_stat);
fputc('\n', output); fputc('\n', output);
} }
} }
......
...@@ -280,9 +280,14 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel ...@@ -280,9 +280,14 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel
if (config->aggr_mode == AGGR_NONE) if (config->aggr_mode == AGGR_NONE)
perf_stat__update_shadow_stats(evsel, count->val, cpu, perf_stat__update_shadow_stats(evsel, count->val, cpu,
&rt_stat); &rt_stat);
if (config->aggr_mode == AGGR_THREAD) if (config->aggr_mode == AGGR_THREAD) {
perf_stat__update_shadow_stats(evsel, count->val, 0, if (config->stats)
&rt_stat); perf_stat__update_shadow_stats(evsel,
count->val, 0, &config->stats[thread]);
else
perf_stat__update_shadow_stats(evsel,
count->val, 0, &rt_stat);
}
break; break;
case AGGR_GLOBAL: case AGGR_GLOBAL:
aggr->val += count->val; aggr->val += count->val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment