linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -tip/perf/core ] perf probe: Allow of casting an array of char to string
       [not found] <CANFS6bbt841hyETtTorA6N6weBg+7viBVxwr8Xk0+RJbWXGjXw@mail.gmail.com>
@ 2012-09-11  8:00 ` Hyeoncheol Lee
  2012-09-11 10:18   ` Namhyung Kim
  2013-01-25 11:36   ` [tip:perf/core] " tip-bot for Hyeoncheol Lee
  0 siblings, 2 replies; 4+ messages in thread
From: Hyeoncheol Lee @ 2012-09-11  8:00 UTC (permalink / raw)
  To: linux-kernel

Before casting a type of a variable to string,
convert_variable_type() confirms that the type is a pointer or
an array. then if it is a pointer to char, it is casted to string.
but in case of an array of char, it isn't

Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: H.C. Lee <hyc.lee@gmail.com>
---
 tools/perf/util/probe-finder.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index d448984..94a00de 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -413,12 +413,12 @@ static int convert_variable_type(Dwarf_Die *vr_die,
                                   dwarf_diename(vr_die), dwarf_diename(&type));
                        return -EINVAL;
                }
+               if (die_get_real_type(&type, &type) == NULL) {
+                       pr_warning("Failed to get a type"
+                                  " information.\n");
+                       return -ENOENT;
+               }
                if (ret == DW_TAG_pointer_type) {
-                       if (die_get_real_type(&type, &type) == NULL) {
-                               pr_warning("Failed to get a type"
-                                          " information.\n");
-                               return -ENOENT;
-                       }
                        while (*ref_ptr)
                                ref_ptr = &(*ref_ptr)->next;
                        /* Add new reference with offset +0 */
--
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -tip/perf/core ] perf probe: Allow of casting an array of char to string
  2012-09-11  8:00 ` [PATCH -tip/perf/core ] perf probe: Allow of casting an array of char to string Hyeoncheol Lee
@ 2012-09-11 10:18   ` Namhyung Kim
  2013-01-11  5:03     ` Arnaldo Carvalho de Melo
  2013-01-25 11:36   ` [tip:perf/core] " tip-bot for Hyeoncheol Lee
  1 sibling, 1 reply; 4+ messages in thread
From: Namhyung Kim @ 2012-09-11 10:18 UTC (permalink / raw)
  To: Hyeoncheol Lee; +Cc: linux-kernel, Arnaldo Carvalho de Melo

Hi Hyeoncheol,

Please CC the perf maintainers - at least Arnaldo for perf tools - next time.

Thanks,
Namhyung


On Tue, 11 Sep 2012 17:00:54 +0900, Hyeoncheol Lee wrote:
> Before casting a type of a variable to string,
> convert_variable_type() confirms that the type is a pointer or
> an array. then if it is a pointer to char, it is casted to string.
> but in case of an array of char, it isn't
>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Signed-off-by: H.C. Lee <hyc.lee@gmail.com>
> ---
>  tools/perf/util/probe-finder.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index d448984..94a00de 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -413,12 +413,12 @@ static int convert_variable_type(Dwarf_Die *vr_die,
>                                    dwarf_diename(vr_die), dwarf_diename(&type));
>                         return -EINVAL;
>                 }
> +               if (die_get_real_type(&type, &type) == NULL) {
> +                       pr_warning("Failed to get a type"
> +                                  " information.\n");
> +                       return -ENOENT;
> +               }
>                 if (ret == DW_TAG_pointer_type) {
> -                       if (die_get_real_type(&type, &type) == NULL) {
> -                               pr_warning("Failed to get a type"
> -                                          " information.\n");
> -                               return -ENOENT;
> -                       }
>                         while (*ref_ptr)
>                                 ref_ptr = &(*ref_ptr)->next;
>                         /* Add new reference with offset +0 */
> --
> 1.7.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -tip/perf/core ] perf probe: Allow of casting an array of char to string
  2012-09-11 10:18   ` Namhyung Kim
@ 2013-01-11  5:03     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-01-11  5:03 UTC (permalink / raw)
  To: Namhyung Kim; +Cc: Hyeoncheol Lee, linux-kernel

Em Tue, Sep 11, 2012 at 07:18:38PM +0900, Namhyung Kim escreveu:
> Hi Hyeoncheol,
> 
> Please CC the perf maintainers - at least Arnaldo for perf tools - next time.
> 
> Thanks,
> Namhyung

Thanks everyone, applied, with Masami's ack too.

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/core] perf probe: Allow of casting an array of char to string
  2012-09-11  8:00 ` [PATCH -tip/perf/core ] perf probe: Allow of casting an array of char to string Hyeoncheol Lee
  2012-09-11 10:18   ` Namhyung Kim
@ 2013-01-25 11:36   ` tip-bot for Hyeoncheol Lee
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Hyeoncheol Lee @ 2013-01-25 11:36 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, mingo, hpa, mingo, hyc.lee,
	a.p.zijlstra, masami.hiramatsu.pt, srikar, tglx

Commit-ID:  7ce28b5b5b320e26ac6a0e352d5005bce3530e05
Gitweb:     http://git.kernel.org/tip/7ce28b5b5b320e26ac6a0e352d5005bce3530e05
Author:     Hyeoncheol Lee <hyc.lee@gmail.com>
AuthorDate: Tue, 11 Sep 2012 16:57:28 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 24 Jan 2013 16:40:20 -0300

perf probe: Allow of casting an array of char to string

Before casting a type of a variable to string, convert_variable_type()
confirms that the type is a pointer or an array. then if it is a pointer
to char, it is casted to string.  but in case of an array of char, it
isn't

Signed-off-by: H.C. Lee <hyc.lee@gmail.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/CANFS6bb75e8a_UtyAD9yF73hfXDy0N8tSjDz=a+Vna=Y8ORMHg@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-finder.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 1daf5c1..be03293 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -413,12 +413,12 @@ static int convert_variable_type(Dwarf_Die *vr_die,
 				   dwarf_diename(vr_die), dwarf_diename(&type));
 			return -EINVAL;
 		}
+		if (die_get_real_type(&type, &type) == NULL) {
+			pr_warning("Failed to get a type"
+				   " information.\n");
+			return -ENOENT;
+		}
 		if (ret == DW_TAG_pointer_type) {
-			if (die_get_real_type(&type, &type) == NULL) {
-				pr_warning("Failed to get a type"
-					   " information.\n");
-				return -ENOENT;
-			}
 			while (*ref_ptr)
 				ref_ptr = &(*ref_ptr)->next;
 			/* Add new reference with offset +0 */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-25 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CANFS6bbt841hyETtTorA6N6weBg+7viBVxwr8Xk0+RJbWXGjXw@mail.gmail.com>
2012-09-11  8:00 ` [PATCH -tip/perf/core ] perf probe: Allow of casting an array of char to string Hyeoncheol Lee
2012-09-11 10:18   ` Namhyung Kim
2013-01-11  5:03     ` Arnaldo Carvalho de Melo
2013-01-25 11:36   ` [tip:perf/core] " tip-bot for Hyeoncheol Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).