Commit 66b76e30 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf stat: Convert perf_stat_evsel.res_stats array

It uses only one member, no need to have it as an array.
Reviewed-by: default avatarJames Clark <james.clark@arm.com>
Signed-off-by: default avatarNamhyung 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1337b9dc
...@@ -67,7 +67,7 @@ static void print_noise(struct perf_stat_config *config, ...@@ -67,7 +67,7 @@ static void print_noise(struct perf_stat_config *config,
return; return;
ps = evsel->stats; ps = evsel->stats;
print_noise_pct(config, stddev_stats(&ps->res_stats[0]), avg); print_noise_pct(config, stddev_stats(&ps->res_stats), avg);
} }
static void print_cgroup(struct perf_stat_config *config, struct evsel *evsel) static void print_cgroup(struct perf_stat_config *config, struct evsel *evsel)
......
...@@ -132,12 +132,9 @@ static void perf_stat_evsel_id_init(struct evsel *evsel) ...@@ -132,12 +132,9 @@ static void perf_stat_evsel_id_init(struct evsel *evsel)
static void evsel__reset_stat_priv(struct evsel *evsel) static void evsel__reset_stat_priv(struct evsel *evsel)
{ {
int i;
struct perf_stat_evsel *ps = evsel->stats; struct perf_stat_evsel *ps = evsel->stats;
for (i = 0; i < 3; i++) init_stats(&ps->res_stats);
init_stats(&ps->res_stats[i]);
perf_stat_evsel_id_init(evsel); perf_stat_evsel_id_init(evsel);
} }
...@@ -437,7 +434,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, ...@@ -437,7 +434,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
struct perf_counts_values *aggr = &counter->counts->aggr; struct perf_counts_values *aggr = &counter->counts->aggr;
struct perf_stat_evsel *ps = counter->stats; struct perf_stat_evsel *ps = counter->stats;
u64 *count = counter->counts->aggr.values; u64 *count = counter->counts->aggr.values;
int i, ret; int ret;
aggr->val = aggr->ena = aggr->run = 0; aggr->val = aggr->ena = aggr->run = 0;
...@@ -455,8 +452,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, ...@@ -455,8 +452,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
evsel__compute_deltas(counter, -1, -1, aggr); evsel__compute_deltas(counter, -1, -1, aggr);
perf_counts_values__scale(aggr, config->scale, &counter->counts->scaled); perf_counts_values__scale(aggr, config->scale, &counter->counts->scaled);
for (i = 0; i < 3; i++) update_stats(&ps->res_stats, *count);
update_stats(&ps->res_stats[i], count[i]);
if (verbose > 0) { if (verbose > 0) {
fprintf(config->output, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", fprintf(config->output, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n",
......
...@@ -43,7 +43,7 @@ enum perf_stat_evsel_id { ...@@ -43,7 +43,7 @@ enum perf_stat_evsel_id {
}; };
struct perf_stat_evsel { struct perf_stat_evsel {
struct stats res_stats[3]; struct stats res_stats;
enum perf_stat_evsel_id id; enum perf_stat_evsel_id id;
u64 *group_data; u64 *group_data;
}; };
......
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