aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/stat.c
diff options
context:
space:
mode:
authorJin Yao <yao.jin@linux.intel.com>2017-12-05 09:03:04 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-12-27 10:15:43 -0500
commit1fcd03946b52b8a57a6692fedd4406b45baedfe6 (patch)
tree6055638961dc9cd5adef9b65e301bd5c18555b8a /tools/perf/util/stat.c
parent8efb2df1288bc1bcc3711a97028620717319f138 (diff)
perf stat: Update per-thread shadow stats
The functions perf_stat__update_shadow_stats() is called to update the shadow stats on a set of static variables. But the static variables are the limitations to be extended to support per-thread shadow stats. This patch lets the perf_stat__update_shadow_stats() support to update the shadow stats on a input parameter 'st' and uses update_runtime_stat() to update the stats. It will not directly update the static variables as before. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Acked-by: Jiri 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-5-git-send-email-yao.jin@linux.intel.com [ Rename 'stat' variables to 'st' to build on centos:{5,6} and others where it shadows a global declaration ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat.c')
-rw-r--r--tools/perf/util/stat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 151e9efd7286..78abfd40b135 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -278,9 +278,11 @@ process_counter_values(struct perf_stat_config *config, struct perf_evsel *evsel
278 perf_evsel__compute_deltas(evsel, cpu, thread, count); 278 perf_evsel__compute_deltas(evsel, cpu, thread, count);
279 perf_counts_values__scale(count, config->scale, NULL); 279 perf_counts_values__scale(count, config->scale, NULL);
280 if (config->aggr_mode == AGGR_NONE) 280 if (config->aggr_mode == AGGR_NONE)
281 perf_stat__update_shadow_stats(evsel, count->val, cpu); 281 perf_stat__update_shadow_stats(evsel, count->val, cpu,
282 &rt_stat);
282 if (config->aggr_mode == AGGR_THREAD) 283 if (config->aggr_mode == AGGR_THREAD)
283 perf_stat__update_shadow_stats(evsel, count->val, 0); 284 perf_stat__update_shadow_stats(evsel, count->val, 0,
285 &rt_stat);
284 break; 286 break;
285 case AGGR_GLOBAL: 287 case AGGR_GLOBAL:
286 aggr->val += count->val; 288 aggr->val += count->val;
@@ -362,7 +364,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
362 /* 364 /*
363 * Save the full runtime - to allow normalization during printout: 365 * Save the full runtime - to allow normalization during printout:
364 */ 366 */
365 perf_stat__update_shadow_stats(counter, *count, 0); 367 perf_stat__update_shadow_stats(counter, *count, 0, &rt_stat);
366 368
367 return 0; 369 return 0;
368} 370}