Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1302986 > unrolled thread

[PATCH] perf pmu: fix alias->snapshot missing initialization bug

Started byStephane Eranian <eranian@google.com>
First post2016-01-06 20:00 +0100
Last post2016-01-09 17:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf pmu: fix alias->snapshot missing initialization bug Stephane Eranian <eranian@google.com> - 2016-01-06 20:00 +0100
    Re: [PATCH] perf pmu: fix alias->snapshot missing initialization bug Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-01-06 22:00 +0100
    [tip:perf/core] perf pmu: fix alias->  snapshot missing initialization bug tip-bot for Stephane Eranian <tipbot@zytor.com> - 2016-01-09 17:40 +0100

#1302986 — [PATCH] perf pmu: fix alias->snapshot missing initialization bug

FromStephane Eranian <eranian@google.com>
Date2016-01-06 20:00 +0100
Subject[PATCH] perf pmu: fix alias->snapshot missing initialization bug
Message-ID<qO1tn-4Yl-1@gated-at.bofh.it>
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.

Signed-off-by: Stephane Eranian <eranian@google.com>
---
 tools/perf/util/pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index e4b173d..b597bcc 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -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) {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1303067

FromArnaldo Carvalho de Melo <acme@redhat.com>
Date2016-01-06 22:00 +0100
Message-ID<qO3lv-6bl-1@gated-at.bofh.it>
In reply to#1302986
Em Wed, Jan 06, 2016 at 07:50:01PM +0100, Stephane Eranian escreveu:
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


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

Fromtip-bot for Stephane Eranian <tipbot@zytor.com>
Date2016-01-09 17:40 +0100
Subject[tip:perf/core] perf pmu: fix alias-> snapshot missing initialization bug
Message-ID<qP4IA-87R-57@gated-at.bofh.it>
In reply to#1302986
Commit-ID:  84530920de3c6ccb92c6661da784f6cdb66d3304
Gitweb:     http://git.kernel.org/tip/84530920de3c6ccb92c6661da784f6cdb66d3304
Author:     Stephane Eranian <eranian@google.com>
AuthorDate: Wed, 6 Jan 2016 19:50:01 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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.

Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1452106201-13073-1-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/pmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index e4b173d..b597bcc 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -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) {

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web