Skip to contentSkip to conversation

perf probe: print an enum type variable in "enum variable-name" format when showing accessible variables

PATCH In review Hyeoncheol Lee 2 participants 3 messages Sep 27, 2012 – Sep 28, 2012 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf probe: print an enum type variable in "enum variable-name" format when showing accessible variables

When showing accessible variables, an enum type variable was
printed in "variable-name" format. Change this format into
"enum variable-name".

Cc Masami Hiramatsu <[email protected]>
---
 tools/perf/util/dwarf-aux.c |    2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/dwarf-aux.c +2 -0
index ee51e9b..3e5f543 100644
@@ -804,6 +804,8 @@ int die_get_typename(Dwarf_Die *vr_die, char *buf, int len)
 			tmp = "union ";
 		else if (tag == DW_TAG_structure_type)
 			tmp = "struct ";
+		else if (tag == DW_TAG_enumeration_type)
+			tmp = "enum ";
 		/* Write a base name */
 		ret = snprintf(buf, len, "%s%s", tmp, dwarf_diename(&type));
 		return (ret >= len) ? -E2BIG : ret;
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Hyeoncheol Lee

When showing accessible variables, an enum type variable was
printed in "variable-name" format. Change this format into
"enum variable-name".

Right, and even if the enum has a type name, it shows only "type-name variable-name", this should show "enum type-name variable-name".

Thank you!

Quoted 21 lines
Cc Masami Hiramatsu <[email protected]>
---
 tools/perf/util/dwarf-aux.c |    2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/dwarf-aux.c +2 -0
index ee51e9b..3e5f543 100644
@@ -804,6 +804,8 @@ int die_get_typename(Dwarf_Die *vr_die, char *buf, int len)
 			tmp = "union ";
 		else if (tag == DW_TAG_structure_type)
 			tmp = "struct ";
+		else if (tag == DW_TAG_enumeration_type)
+			tmp = "enum ";
 		/* Write a base name */
 		ret = snprintf(buf, len, "%s%s", tmp, dwarf_diename(&type));
 		return (ret >= len) ? -E2BIG : ret;
Signature · 4 lines
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: [email protected]
#2 lore raw

[tip:perf/core] perf probe: Print an enum type variable in " enum variable-name" format when showing accessible variables

In reply to Hyeoncheol Lee
Commit-ID:  bb2d17a014914b628df42b0c76c85fa8a8c57e79
Gitweb:     http://git.kernel.org/tip/bb2d17a014914b628df42b0c76c85fa8a8c57e79
Author:     Hyeoncheol Lee <[email protected]>
AuthorDate: Thu, 27 Sep 2012 11:36:39 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 27 Sep 2012 10:58:57 -0300

perf probe: Print an enum type variable in "enum variable-name" format when showing accessible variables

When showing accessible variables, an enum type variable was printed in "variable-name" format. Change this format into "enum variable-name".

---
 tools/perf/util/dwarf-aux.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
tools/perf/util/dwarf-aux.c +2 -0
index ee51e9b..3e5f543 100644
@@ -804,6 +804,8 @@ int die_get_typename(Dwarf_Die *vr_die, char *buf, int len)
 			tmp = "union ";
 		else if (tag == DW_TAG_structure_type)
 			tmp = "struct ";
+		else if (tag == DW_TAG_enumeration_type)
+			tmp = "enum ";
 		/* Write a base name */
 		ret = snprintf(buf, len, "%s%s", tmp, dwarf_diename(&type));
 		return (ret >= len) ? -E2BIG : ret;