Skip to contentSkip to conversation

perf pmu: fix alias->snapshot missing initialization bug

PATCH Applied Stephane Eranian 3 participants 3 messages Jan 6, 2016 – Jan 9, 2016 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf pmu: fix alias->snapshot missing initialization bug

This patch fixes a bug in __perf_pmu__new_alias() whereby the alias->snapshot field was not initialized to false. This led to random alias->snapshot value for an alias and was breaking some measurements such as:

$ perf stat -a -e uncore_imc/data_reads/ -I 1000 sleep 100

Because the event ended up being treated as snapshot mode, when it is not.

---
 tools/perf/util/pmu.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/pmu.c +1 -0
index e4b173d..b597bcc 100644
@@ -220,6 +220,7 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
 	alias->scale = 1.0;
 	alias->unit[0] = '\0';
 	alias->per_pkg = false;
+	alias->snapshot = false;
 
 	ret = parse_events_terms(&alias->terms, val);
 	if (ret) {
Signature · 1 line
2.5.0
#1 lore raw

Em Wed, Jan 06, 2016 at 07:50:01PM +0100, Stephane Eranian escreveu:

Quoted 9 lines

This patch fixes a bug in __perf_pmu__new_alias() whereby the alias->snapshot field was not initialized to false. This led to random alias->snapshot value for an alias and was breaking some measurements such as:

$ perf stat -a -e uncore_imc/data_reads/ -I 1000 sleep 100

Because the event ended up being treated as snapshot mode, when it is not.

Thanks, applied.

- Arnaldo

#2 lore raw

[tip:perf/core] perf pmu: fix alias-> snapshot missing initialization bug

In reply to Stephane Eranian
perf pmu: fix alias->snapshot missing initialization bug
Commit-ID:  84530920de3c6ccb92c6661da784f6cdb66d3304
Gitweb:     http://git.kernel.org/tip/84530920de3c6ccb92c6661da784f6cdb66d3304
Author:     Stephane Eranian <[email protected]>
AuthorDate: Wed, 6 Jan 2016 19:50:01 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 6 Jan 2016 20:11:16 -0300

perf pmu: fix alias->snapshot missing initialization bug

This patch fixes a bug in __perf_pmu__new_alias() whereby the alias->snapshot field was not initialized to false. This led to random alias->snapshot value for an alias and was breaking some measurements such as:

  $ perf stat -a -e uncore_imc/data_reads/ -I 1000 sleep 100

Because the event ended up being treated as snapshot mode, when it is not.

---
 tools/perf/util/pmu.c | 1 +
 1 file changed, 1 insertion(+)
tools/perf/util/pmu.c +1 -0
index e4b173d..b597bcc 100644
@@ -220,6 +220,7 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
 	alias->scale = 1.0;
 	alias->unit[0] = '\0';
 	alias->per_pkg = false;
+	alias->snapshot = false;
 
 	ret = parse_events_terms(&alias->terms, val);
 	if (ret) {