summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/stat.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2022-09-30 13:21:04 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-10-06 08:03:53 -0300
commit66b76e30ee36c0c58836bf91b8602f5f2c94093a (patch)
treecd096899afa99514b62f7b0fefecfad3cf024c36 /tools/perf/util/stat.c
parent1337b9dcb03b1c81448eed1b70296148f62730b8 (diff)
downloadlinux-66b76e30ee36c0c58836bf91b8602f5f2c94093a.tar.gz
linux-66b76e30ee36c0c58836bf91b8602f5f2c94093a.tar.bz2
linux-66b76e30ee36c0c58836bf91b8602f5f2c94093a.zip
perf stat: Convert perf_stat_evsel.res_stats array
It uses only one member, no need to have it as an array. Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com> Link: https://lore.kernel.org/r/20220930202110.845199-2-namhyung@kernel.org 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.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index cef943377ad7..8d27ba77f8ab 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -132,12 +132,9 @@ static void perf_stat_evsel_id_init(struct evsel *evsel)
static void evsel__reset_stat_priv(struct evsel *evsel)
{
- int i;
struct perf_stat_evsel *ps = evsel->stats;
- for (i = 0; i < 3; i++)
- init_stats(&ps->res_stats[i]);
-
+ init_stats(&ps->res_stats);
perf_stat_evsel_id_init(evsel);
}
@@ -437,7 +434,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
struct perf_counts_values *aggr = &counter->counts->aggr;
struct perf_stat_evsel *ps = counter->stats;
u64 *count = counter->counts->aggr.values;
- int i, ret;
+ int ret;
aggr->val = aggr->ena = aggr->run = 0;
@@ -455,8 +452,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
evsel__compute_deltas(counter, -1, -1, aggr);
perf_counts_values__scale(aggr, config->scale, &counter->counts->scaled);
- for (i = 0; i < 3; i++)
- update_stats(&ps->res_stats[i], count[i]);
+ update_stats(&ps->res_stats, *count);
if (verbose > 0) {
fprintf(config->output, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n",