Hi Ingo,
Before introducing new patches, I'd like to push some bugfixes.
(I'll update previous series and post again.)
Thank you,
---
Masami Hiramatsu (4):
[BUGFIX][RESEND] perf probe: Fix to close dwarf when failing to analyze it
[BUGFIX] perf probe: Correct error message for non-structure type
[BUGFIX] perf probe: Fix not to return non-matched file
[BUGFIX] perf probe: Fix --line syntax help and document
tools/perf/Documentation/perf-probe.txt | 2 +-
tools/perf/builtin-probe.c | 2 +-
tools/perf/util/probe-finder.c | 20 ++++++++++++++------
3 files changed, 16 insertions(+), 8 deletions(-)
--
Masami Hiramatsu
e-mail: [email protected]
Fix cu_find_realpath() not to return the last file path
if that is not matched to input pattern.
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
---
tools/perf/util/probe-finder.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index db52ec2..b44132e 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -183,6 +183,8 @@ static const char *cu_find_realpath(Dwarf_Die *cu_die, const char *fname)
if (strtailcmp(src, fname) == 0)
break;
}
+ if (i == nfiles)
+ return NULL;
return src;
}
--
Masami Hiramatsu
e-mail: [email protected]
Just fix typos. --line option accepts ':START-END' syntax,
not ':START:END'.
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
---
tools/perf/Documentation/perf-probe.txt | 2 +-
tools/perf/builtin-probe.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index 0f944b3..bb671b3 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -85,7 +85,7 @@ LINE SYNTAX
-----------
Line range is descripted by following syntax.
- "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]"
+ "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]"
FUNC specifies the function name of showing lines. 'RLN' is the start line
number from function entry line, and 'RLN2' is the end line number. As same as
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index cf2ffa5..b3ba25a 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -167,7 +167,7 @@ static const struct option options[] = {
" with existing name"),
#ifdef DWARF_SUPPORT
OPT_CALLBACK('L', "line", NULL,
- "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]",
+ "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]",
"Show source code lines.", opt_show_lines),
OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
"file", "vmlinux pathname"),
--
Masami Hiramatsu
e-mail: [email protected]
perf probe outputs incorrect error message when it called with
non-exist field on a non-data structure local variable.
<Before>
# perf probe vfs_read 'count.hoge'
Fatal: Structure on a register is not supported yet.
# perf probe vfs_read 'count->hoge'
Fatal: Semantic error: hoge must be referred by '.'
This corrects the messsage.
<After>
# perf probe vfs_read 'count.hoge'
Fatal: count is not a data structure.
# perf probe vfs_read 'count->hoge'
Fatal: count is not a data structure.
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
---
tools/perf/util/probe-finder.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index b44132e..59b0115 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -429,12 +429,20 @@ static void convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
if (die_get_real_type(&type, &type) == NULL)
die("Failed to get a type information of %s.", varname);
+ /* Verify it is a data structure */
+ if (dwarf_tag(&type) != DW_TAG_structure_type)
+ die("%s is not a data structure.", varname);
+
ref = xzalloc(sizeof(struct kprobe_trace_arg_ref));
if (*ref_ptr)
(*ref_ptr)->next = ref;
else
*ref_ptr = ref;
} else {
+ /* Verify it is a data structure */
+ if (dwarf_tag(&type) != DW_TAG_structure_type)
+ die("%s is not a data structure.", varname);
+
if (field->ref)
die("Semantic error: %s must be referred by '.'",
field->name);
@@ -442,10 +450,6 @@ static void convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
die("Structure on a register is not supported yet.");
}
- /* Verify it is a data structure */
- if (dwarf_tag(&type) != DW_TAG_structure_type)
- die("%s is not a data structure.", varname);
-
if (die_find_member(&type, field->name, &member) == NULL)
die("%s(tyep:%s) has no member %s.", varname,
dwarf_diename(&type), field->name);
--
Masami Hiramatsu
e-mail: [email protected]
Fix to close libdw routine when failing to analyze it in
find_perf_probe_point().
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
---
tools/perf/util/probe-finder.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 59b0115..a851377 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -818,8 +818,10 @@ int find_perf_probe_point(int fd, unsigned long addr,
return -ENOENT;
/* Find cu die */
- if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr, &cudie))
- return -EINVAL;
+ if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr, &cudie)) {
+ ret = -EINVAL;
+ goto end;
+ }
/* Find a corresponding line */
line = dwarf_getsrc_die(&cudie, (Dwarf_Addr)addr);
--
Masami Hiramatsu
e-mail: [email protected]
Commit-ID: 085ea739adf107b5a5d131f3625e517ff4a5181e
Gitweb: http://git.kernel.org/tip/085ea739adf107b5a5d131f3625e517ff4a5181e
Author: Masami Hiramatsu <[email protected]>
AuthorDate: Fri, 2 Apr 2010 12:50:39 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Fri, 2 Apr 2010 19:35:42 +0200
perf probe: Fix --line syntax help and document
Just fix typos. --line option accepts ':START-END' syntax,
not ':START:END'.
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: systemtap <[email protected]>
Cc: DLE <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/Documentation/perf-probe.txt | 2 +-
tools/perf/builtin-probe.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index 0f944b3..bb671b3 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -85,7 +85,7 @@ LINE SYNTAX
-----------
Line range is descripted by following syntax.
- "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]"
+ "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]"
FUNC specifies the function name of showing lines. 'RLN' is the start line
number from function entry line, and 'RLN2' is the end line number. As same as
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index cf2ffa5..b3ba25a 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -167,7 +167,7 @@ static const struct option options[] = {
" with existing name"),
#ifdef DWARF_SUPPORT
OPT_CALLBACK('L', "line", NULL,
- "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]",
+ "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]",
"Show source code lines.", opt_show_lines),
OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
"file", "vmlinux pathname"),
Commit-ID: c9e385826d4f1ca5a72005ab8503598f791a8dc0
Gitweb: http://git.kernel.org/tip/c9e385826d4f1ca5a72005ab8503598f791a8dc0
Author: Masami Hiramatsu <[email protected]>
AuthorDate: Fri, 2 Apr 2010 12:50:45 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Fri, 2 Apr 2010 19:35:42 +0200
perf probe: Fix not to return non-matched file
Fix cu_find_realpath() not to return the last file path
if that is not matched to input pattern.
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: systemtap <[email protected]>
Cc: DLE <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/util/probe-finder.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index db52ec2..b44132e 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -183,6 +183,8 @@ static const char *cu_find_realpath(Dwarf_Die *cu_die, const char *fname)
if (strtailcmp(src, fname) == 0)
break;
}
+ if (i == nfiles)
+ return NULL;
return src;
}
Commit-ID: 12e5a7ae475ccb2733d740ffb95d9ca0a18392da
Gitweb: http://git.kernel.org/tip/12e5a7ae475ccb2733d740ffb95d9ca0a18392da
Author: Masami Hiramatsu <[email protected]>
AuthorDate: Fri, 2 Apr 2010 12:50:53 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Fri, 2 Apr 2010 19:35:43 +0200
perf probe: Correct error message for non-structure type
perf probe outputs incorrect error message when it is called with
non-existent field on a non-data structure local variable.
<Before>
# perf probe vfs_read 'count.hoge'
Fatal: Structure on a register is not supported yet.
# perf probe vfs_read 'count->hoge'
Fatal: Semantic error: hoge must be referred by '.'
This corrects the messsage.
<After>
# perf probe vfs_read 'count.hoge'
Fatal: count is not a data structure.
# perf probe vfs_read 'count->hoge'
Fatal: count is not a data structure.
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: systemtap <[email protected]>
Cc: DLE <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/util/probe-finder.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index b44132e..59b0115 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -429,12 +429,20 @@ static void convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
if (die_get_real_type(&type, &type) == NULL)
die("Failed to get a type information of %s.", varname);
+ /* Verify it is a data structure */
+ if (dwarf_tag(&type) != DW_TAG_structure_type)
+ die("%s is not a data structure.", varname);
+
ref = xzalloc(sizeof(struct kprobe_trace_arg_ref));
if (*ref_ptr)
(*ref_ptr)->next = ref;
else
*ref_ptr = ref;
} else {
+ /* Verify it is a data structure */
+ if (dwarf_tag(&type) != DW_TAG_structure_type)
+ die("%s is not a data structure.", varname);
+
if (field->ref)
die("Semantic error: %s must be referred by '.'",
field->name);
@@ -442,10 +450,6 @@ static void convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
die("Structure on a register is not supported yet.");
}
- /* Verify it is a data structure */
- if (dwarf_tag(&type) != DW_TAG_structure_type)
- die("%s is not a data structure.", varname);
-
if (die_find_member(&type, field->name, &member) == NULL)
die("%s(tyep:%s) has no member %s.", varname,
dwarf_diename(&type), field->name);
Commit-ID: 75ec5a245c7763c397f31ec8964d0a46c54a7386
Gitweb: http://git.kernel.org/tip/75ec5a245c7763c397f31ec8964d0a46c54a7386
Author: Masami Hiramatsu <[email protected]>
AuthorDate: Fri, 2 Apr 2010 12:50:59 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Fri, 2 Apr 2010 19:35:44 +0200
perf probe: Fix to close dwarf when failing to analyze it
Fix to close libdw routine when failing to analyze it in
find_perf_probe_point().
Signed-off-by: Masami Hiramatsu <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: systemtap <[email protected]>
Cc: DLE <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/util/probe-finder.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 59b0115..a851377 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -818,8 +818,10 @@ int find_perf_probe_point(int fd, unsigned long addr,
return -ENOENT;
/* Find cu die */
- if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr, &cudie))
- return -EINVAL;
+ if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr, &cudie)) {
+ ret = -EINVAL;
+ goto end;
+ }
/* Find a corresponding line */
line = dwarf_getsrc_die(&cudie, (Dwarf_Addr)addr);