2012-05-24 01:08:47

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [GIT PULL 0/1] perf/core fix

Hi Ingo,

Please pull,

- Arnaldo

The following changes since commit ab0cce560ef177bdc7a8f73e9962be9d829a7b2c:

Revert "sched, perf: Use a single callback into the scheduler" (2012-05-23 17:40:51 +0200)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core

for you to fetch changes up to a1d44b9acdf7b2820ef762846150b4d13b84e075:

perf evlist: Explicititely initialize input_name (2012-05-23 21:47:51 -0300)

----------------------------------------------------------------
Fix perf evlist uninitialized local variable

Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
perf evlist: Explicititely initialize input_name

tools/perf/builtin-evlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


2012-05-24 01:08:42

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: [PATCH 1/1] perf evlist: Explicititely initialize input_name

From: Arnaldo Carvalho de Melo <[email protected]>

It was a global variable, so it was initialized, implicitely, to zero by
being placed in the bss.

Now it is just a local variable that is then passed to the __cmd_evlist
routine, so it must be explicitely set to NULL.

The problem manifested on a Fedora 17 system, using:

gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC)

But not on several other systems, by luck.

Reported-by: Ingo Molnar <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/builtin-evlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c
index e52d77e..acd78dc 100644
--- a/tools/perf/builtin-evlist.c
+++ b/tools/perf/builtin-evlist.c
@@ -116,7 +116,7 @@ static const char * const evlist_usage[] = {
int cmd_evlist(int argc, const char **argv, const char *prefix __used)
{
struct perf_attr_details details = { .verbose = false, };
- const char *input_name;
+ const char *input_name = NULL;
const struct option options[] = {
OPT_STRING('i', "input", &input_name, "file",
"Input file name"),
--
1.7.9.2.358.g22243

2012-05-24 10:29:39

by Ingo Molnar

[permalink] [raw]
Subject: Re: [GIT PULL 0/1] perf/core fix


* Arnaldo Carvalho de Melo <[email protected]> wrote:

> Hi Ingo,
>
> Please pull,
>
> - Arnaldo
>
> The following changes since commit ab0cce560ef177bdc7a8f73e9962be9d829a7b2c:
>
> Revert "sched, perf: Use a single callback into the scheduler" (2012-05-23 17:40:51 +0200)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/core
>
> for you to fetch changes up to a1d44b9acdf7b2820ef762846150b4d13b84e075:
>
> perf evlist: Explicititely initialize input_name (2012-05-23 21:47:51 -0300)
>
> ----------------------------------------------------------------
> Fix perf evlist uninitialized local variable
>
> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
> perf evlist: Explicititely initialize input_name
>
> tools/perf/builtin-evlist.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Pulled, thanks Arnaldo!

Ingo