Skip to contentSkip to conversation

perf test: Reset shadow counts before loading

PATCH Applied Ian Rogers 3 participants 3 messages Nov 28, 2021 – Nov 30, 2021 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf test: Reset shadow counts before loading

Otherwise load counting is an average. Without this change duration_time in test_memory_bandwidth will alter its value if an earlier test contains duration_time.

This patch fixes an issue that's introduced in the proposed patch:
https://lore.kernel.org/lkml/[email protected]/
in perf test "Parse and process metrics".

---
 tools/perf/tests/parse-metric.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/tests/parse-metric.c +1 -0
index 574b7e4efd3a..07b6f4ec024f 100644
@@ -109,6 +109,7 @@ static void load_runtime_stat(struct runtime_stat *st, struct evlist *evlist,
 	struct evsel *evsel;
 	u64 count;
 
+	perf_stat__reset_shadow_stats();
 	evlist__for_each_entry(evlist, evsel) {
 		count = find_value(evsel->name, vals);
 		perf_stat__update_shadow_stats(evsel, count, 0, st);
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Ian Rogers

Otherwise load counting is an average. Without this change duration_time in test_memory_bandwidth will alter its value if an earlier test contains duration_time.

This patch fixes an issue that's introduced in the proposed patch:
https://lore.kernel.org/lkml/[email protected]/
in perf test "Parse and process metrics".

jirka

Quoted 19 lines
---
 tools/perf/tests/parse-metric.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/tests/parse-metric.c +1 -0
index 574b7e4efd3a..07b6f4ec024f 100644
@@ -109,6 +109,7 @@ static void load_runtime_stat(struct runtime_stat *st, struct evlist *evlist,
 	struct evsel *evsel;
 	u64 count;
 
+	perf_stat__reset_shadow_stats();
 	evlist__for_each_entry(evlist, evsel) {
 		count = find_value(evsel->name, vals);
 		perf_stat__update_shadow_stats(evsel, count, 0, st);
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
maintainer Applied
#2 lore raw

Em Sun, Nov 28, 2021 at 05:29:29PM +0100, Jiri Olsa escreveu:

Quoted 5 lines · Ian Rogers
Quoted 4 lines

Otherwise load counting is an average. Without this change duration_time in test_memory_bandwidth will alter its value if an earlier test contains duration_time.

Quoted 7 lines
Quoted 5 lines

This patch fixes an issue that's introduced in the proposed patch:
https://lore.kernel.org/lkml/[email protected]/
in perf test "Parse and process metrics".

Thanks, applied.

- Arnaldo

Quoted 21 lines

jirka

Quoted 19 lines
---
 tools/perf/tests/parse-metric.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/tests/parse-metric.c +1 -0
index 574b7e4efd3a..07b6f4ec024f 100644
@@ -109,6 +109,7 @@ static void load_runtime_stat(struct runtime_stat *st, struct evlist *evlist,
 	struct evsel *evsel;
 	u64 count;
 
+	perf_stat__reset_shadow_stats();
 	evlist__for_each_entry(evlist, evsel) {
 		count = find_value(evsel->name, vals);
 		perf_stat__update_shadow_stats(evsel, count, 0, st);
Signature · 1 line
2.34.0.rc2.393.gf8c9666880-goog
Signature · 1 line
- Arnaldo