I wonder if patch below would be enough for this
jirka
---
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: