2011-04-29 08:33:10

by Lin Ming

[permalink] [raw]
Subject: [PATCH 0/2] perf misc cleanup

Hi, Arnaldo

Could you take below 2 one-line patches?

[RESEND PATCH 1/2] perf probe: Fix the missed parameter initialization
[PATCH 2/2] perf annotate: Remove duplicate header file

Thanks,
Lin Ming


2011-04-29 08:33:11

by Lin Ming

[permalink] [raw]
Subject: [RESEND PATCH 1/2] perf probe: Fix the missed parameter initialization

pubname_callback_param::found should be initialized to 0 in fastpath lookup.

Signed-off-by: Lin Ming <[email protected]>
---
tools/perf/util/probe-finder.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index a7c7145..3b9d0b8 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1538,6 +1538,7 @@ static int find_probes(int fd, struct probe_finder *pf)
.file = pp->file,
.cu_die = &pf->cu_die,
.sp_die = &pf->sp_die,
+ .found = 0,
};
struct dwarf_callback_param probe_param = {
.data = pf,
--
1.7.4.4

2011-04-29 08:33:49

by Lin Ming

[permalink] [raw]
Subject: [PATCH 2/2] perf annotate: Remove duplicate header file

annotate.h was included twice, remove one.

Signed-off-by: Lin Ming <[email protected]>
---
tools/perf/util/ui/browsers/annotate.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c
index 15633d6..4bb69e8 100644
--- a/tools/perf/util/ui/browsers/annotate.c
+++ b/tools/perf/util/ui/browsers/annotate.c
@@ -1,7 +1,6 @@
#include "../browser.h"
#include "../helpline.h"
#include "../libslang.h"
-#include "../../annotate.h"
#include "../../hist.h"
#include "../../sort.h"
#include "../../symbol.h"
--
1.7.4.4

2011-04-29 09:44:54

by Ingo Molnar

[permalink] [raw]
Subject: Re: [RESEND PATCH 1/2] perf probe: Fix the missed parameter initialization


* Lin Ming <[email protected]> wrote:

> pubname_callback_param::found should be initialized to 0 in fastpath lookup.
>
> Signed-off-by: Lin Ming <[email protected]>
> ---
> tools/perf/util/probe-finder.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index a7c7145..3b9d0b8 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -1538,6 +1538,7 @@ static int find_probes(int fd, struct probe_finder *pf)
> .file = pp->file,
> .cu_die = &pf->cu_die,
> .sp_die = &pf->sp_die,
> + .found = 0,

Hm, why is this a 'misc cleanup'? If this field is uninitialized (it does
appear so) and we rely on the field then right now this is a bug and the fix
should be pushed to perf/urgent.

Thanks,

Ingo

2011-04-29 13:18:17

by Lin Ming

[permalink] [raw]
Subject: Re: [RESEND PATCH 1/2] perf probe: Fix the missed parameter initialization

On Fri, 2011-04-29 at 17:44 +0800, Ingo Molnar wrote:
> * Lin Ming <[email protected]> wrote:
>
> > pubname_callback_param::found should be initialized to 0 in fastpath lookup.
> >
> > Signed-off-by: Lin Ming <[email protected]>
> > ---
> > tools/perf/util/probe-finder.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> > index a7c7145..3b9d0b8 100644
> > --- a/tools/perf/util/probe-finder.c
> > +++ b/tools/perf/util/probe-finder.c
> > @@ -1538,6 +1538,7 @@ static int find_probes(int fd, struct probe_finder *pf)
> > .file = pp->file,
> > .cu_die = &pf->cu_die,
> > .sp_die = &pf->sp_die,
> > + .found = 0,
>
> Hm, why is this a 'misc cleanup'? If this field is uninitialized (it does

I should call it 'misc cleanup and fix'.

> appear so) and we rely on the field then right now this is a bug and the fix
> should be pushed to perf/urgent.

Indeed.

>
> Thanks,
>
> Ingo

2011-04-29 17:33:38

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [RESEND PATCH 1/2] perf probe: Fix the missed parameter initialization

Em Fri, Apr 29, 2011 at 08:41:57AM +0000, Lin Ming escreveu:
> pubname_callback_param::found should be initialized to 0 in fastpath lookup.


Is this really needed? Or is this just to stress it, for documentational
purposes?

> Signed-off-by: Lin Ming <[email protected]>
> ---
> tools/perf/util/probe-finder.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index a7c7145..3b9d0b8 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -1538,6 +1538,7 @@ static int find_probes(int fd, struct probe_finder *pf)
> .file = pp->file,
> .cu_die = &pf->cu_die,
> .sp_die = &pf->sp_die,
> + .found = 0,
> };
> struct dwarf_callback_param probe_param = {
> .data = pf,
> --
> 1.7.4.4

2011-04-30 04:14:54

by Lin Ming

[permalink] [raw]
Subject: Re: [RESEND PATCH 1/2] perf probe: Fix the missed parameter initialization

On Sat, 2011-04-30 at 01:33 +0800, Arnaldo Carvalho de Melo wrote:
> Em Fri, Apr 29, 2011 at 08:41:57AM +0000, Lin Ming escreveu:
> > pubname_callback_param::found should be initialized to 0 in fastpath lookup.
>
>
> Is this really needed? Or is this just to stress it, for documentational
> purposes?

Yes, this is really needed.

It should be initialized to 0, and pubname_search_cb will set it to 1 if
the function is found.

>
> > Signed-off-by: Lin Ming <[email protected]>
> > ---
> > tools/perf/util/probe-finder.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> > index a7c7145..3b9d0b8 100644
> > --- a/tools/perf/util/probe-finder.c
> > +++ b/tools/perf/util/probe-finder.c
> > @@ -1538,6 +1538,7 @@ static int find_probes(int fd, struct probe_finder *pf)
> > .file = pp->file,
> > .cu_die = &pf->cu_die,
> > .sp_die = &pf->sp_die,
> > + .found = 0,
> > };
> > struct dwarf_callback_param probe_param = {
> > .data = pf,
> > --
> > 1.7.4.4

2011-05-10 13:43:24

by Ming Lin

[permalink] [raw]
Subject: Re: [RESEND PATCH 1/2] perf probe: Fix the missed parameter initialization

On Sat, Apr 30, 2011 at 12:14 PM, Lin Ming <[email protected]> wrote:
> On Sat, 2011-04-30 at 01:33 +0800, Arnaldo Carvalho de Melo wrote:
>> Em Fri, Apr 29, 2011 at 08:41:57AM +0000, Lin Ming escreveu:
>> > pubname_callback_param::found should be initialized to 0 in fastpath lookup.
>>
>>
>> Is this really needed? Or is this just to stress it, for documentational
>> purposes?
>
> Yes, this is really needed.
>
> It should be initialized to 0, and pubname_search_cb will set it to 1 if
> the function is found.

ping ...

--
Lin Ming -- Intel Open Source Technology Center

2011-05-10 20:13:45

by Lin Ming

[permalink] [raw]
Subject: [tip:perf/core] perf probe: Fix the missed parameter initialization

Commit-ID: 2b348a77981227c6b64fb9cf19f7c711a6806bc9
Gitweb: http://git.kernel.org/tip/2b348a77981227c6b64fb9cf19f7c711a6806bc9
Author: Lin Ming <[email protected]>
AuthorDate: Fri, 29 Apr 2011 08:41:57 +0000
Committer: Ingo Molnar <[email protected]>
CommitDate: Tue, 10 May 2011 17:06:23 +0200

perf probe: Fix the missed parameter initialization

pubname_callback_param::found should be initialized to 0 in
fastpath lookup, the structure is on the stack and
uninitialized otherwise.

Signed-off-by: Lin Ming <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/util/probe-finder.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index a7c7145..3b9d0b8 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1538,6 +1538,7 @@ static int find_probes(int fd, struct probe_finder *pf)
.file = pp->file,
.cu_die = &pf->cu_die,
.sp_die = &pf->sp_die,
+ .found = 0,
};
struct dwarf_callback_param probe_param = {
.data = pf,