* [PATCH -tip 0/6] perf-probe bugfixes
@ 2010-04-14 22:36 Masami Hiramatsu
2010-04-14 22:36 ` [PATCH -tip 1/6] perf probe: Fix to use correct debugfs path finder Masami Hiramatsu
2010-04-14 22:37 ` [PATCH -tip 2/6] perf probe: Fix mis-estimation for shortening filename Masami Hiramatsu
0 siblings, 2 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2010-04-14 22:36 UTC (permalink / raw)
To: Ingo Molnar, Arnaldo Carvalho de Melo, lkml; +Cc: systemtap, DLE
Hi Arnaldo,
Could you pull these patches into your tree too?
These fixes several bugs on perf probe.
Thank you,
---
Masami Hiramatsu (6):
perf probe: Show function entry line as probe-able
perf probe: Support DW_OP_plus_uconst in DW_AT_data_member_location
perf probe: Fix line range to show end line
perf probe: Fix a bug that --line range can be overflow
perf probe: Fix mis-estimation for shortening filename
perf probe: Fix to use correct debugfs path finder
tools/perf/builtin-probe.c | 4 -
tools/perf/util/probe-event.c | 51 ++++++++++------
tools/perf/util/probe-event.h | 6 +-
tools/perf/util/probe-finder.c | 128 ++++++++++++++++++++++++++++++++--------
4 files changed, 139 insertions(+), 50 deletions(-)
--
Masami Hiramatsu
e-mail: mhiramat@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH -tip 1/6] perf probe: Fix to use correct debugfs path finder
2010-04-14 22:36 [PATCH -tip 0/6] perf-probe bugfixes Masami Hiramatsu
@ 2010-04-14 22:36 ` Masami Hiramatsu
2010-04-14 22:37 ` [PATCH -tip 2/6] perf probe: Fix mis-estimation for shortening filename Masami Hiramatsu
1 sibling, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2010-04-14 22:36 UTC (permalink / raw)
To: Ingo Molnar, Arnaldo Carvalho de Melo, lkml
Cc: systemtap, DLE, Masami Hiramatsu, Paul Mackerras,
Arnaldo Carvalho de Melo, Paul Mackerras, Peter Zijlstra,
Mike Galbraith, Frederic Weisbecker
Instead of using debugfs_path, use debugfs_find_mountpoint()
to find actual debugfs path.
Signed-off-by: Masami Hiramatsu <mhiamat@redhat.com>
Reported-by: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
---
tools/perf/builtin-probe.c | 4 ----
tools/perf/util/probe-event.c | 12 ++++++++++--
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 5259c5a..4b6dd84 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -40,7 +40,6 @@
#include "util/debug.h"
#include "util/debugfs.h"
#include "util/parse-options.h"
-#include "util/parse-events.h" /* For debugfs_path */
#include "util/probe-finder.h"
#include "util/probe-event.h"
@@ -205,9 +204,6 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
!params.show_lines))
usage_with_options(probe_usage, options);
- if (debugfs_valid_mountpoint(debugfs_path) < 0)
- die("Failed to find debugfs path.");
-
if (params.list_events) {
if (params.nevents != 0 || params.dellist) {
pr_err(" Error: Don't use --list with --add/--del.\n");
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index ca108b2..1c4a20a 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -42,8 +42,8 @@
#include "color.h"
#include "symbol.h"
#include "thread.h"
+#include "debugfs.h"
#include "trace-event.h" /* For __unused */
-#include "parse-events.h" /* For debugfs_path */
#include "probe-event.h"
#include "probe-finder.h"
@@ -1075,10 +1075,18 @@ void clear_kprobe_trace_event(struct kprobe_trace_event *tev)
static int open_kprobe_events(bool readwrite)
{
char buf[PATH_MAX];
+ const char *__debugfs;
int ret;
- ret = e_snprintf(buf, PATH_MAX, "%s/../kprobe_events", debugfs_path);
+ __debugfs = debugfs_find_mountpoint();
+ if (__debugfs == NULL) {
+ pr_warning("Debugfs is not mounted.\n");
+ return -ENOENT;
+ }
+
+ ret = e_snprintf(buf, PATH_MAX, "%stracing/kprobe_events", __debugfs);
if (ret >= 0) {
+ pr_debug("Opening %s write=%d\n", buf, readwrite);
if (readwrite && !probe_event_dry_run)
ret = open(buf, O_RDWR, O_APPEND);
else
--
Masami Hiramatsu
e-mail: mhiramat@redhat.com
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH -tip 2/6] perf probe: Fix mis-estimation for shortening filename
2010-04-14 22:36 [PATCH -tip 0/6] perf-probe bugfixes Masami Hiramatsu
2010-04-14 22:36 ` [PATCH -tip 1/6] perf probe: Fix to use correct debugfs path finder Masami Hiramatsu
@ 2010-04-14 22:37 ` Masami Hiramatsu
1 sibling, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2010-04-14 22:37 UTC (permalink / raw)
To: Ingo Molnar, Arnaldo Carvalho de Melo, lkml
Cc: systemtap, DLE, Masami Hiramatsu, Arnaldo Carvalho de Melo,
Paul Mackerras, Paul Mackerras, Peter Zijlstra, Mike Galbraith,
Frederic Weisbecker, Ingo Molnar
Fix mis-estimation size for making a short filename.
Since the buffer size is 32 bytes and there are '@' prefix and
'\0' termination, maximum shorten filename length should be
30. This means, before searching '/', it should be 31 bytes.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
---
tools/perf/util/probe-event.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 1c4a20a..6d43839 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -806,12 +806,12 @@ static char *synthesize_perf_probe_point(struct perf_probe_point *pp)
goto error;
}
if (pp->file) {
- len = strlen(pp->file) - 32;
+ len = strlen(pp->file) - 31;
if (len < 0)
len = 0;
tmp = strchr(pp->file + len, '/');
if (!tmp)
- tmp = pp->file + len - 1;
+ tmp = pp->file + len;
ret = e_snprintf(file, 32, "@%s", tmp + 1);
if (ret <= 0)
goto error;
--
Masami Hiramatsu
e-mail: mhiramat@redhat.com
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH -tip 0/6] perf-probe bugfixes
@ 2010-04-14 22:39 Masami Hiramatsu
2010-04-14 23:28 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 5+ messages in thread
From: Masami Hiramatsu @ 2010-04-14 22:39 UTC (permalink / raw)
To: Ingo Molnar, Arnaldo Carvalho de Melo, lkml; +Cc: systemtap, DLE
Hi Arnaldo,
(Sorry, I've fixed to signed-off-by and send it again)
Could you pull these patches into your tree too?
These fixes several bugs on perf probe.
Thank you,
---
Masami Hiramatsu (6):
perf probe: Show function entry line as probe-able
perf probe: Support DW_OP_plus_uconst in DW_AT_data_member_location
perf probe: Fix line range to show end line
perf probe: Fix a bug that --line range can be overflow
perf probe: Fix mis-estimation for shortening filename
perf probe: Fix to use correct debugfs path finder
tools/perf/builtin-probe.c | 4 -
tools/perf/util/probe-event.c | 51 ++++++++++------
tools/perf/util/probe-event.h | 6 +-
tools/perf/util/probe-finder.c | 128 ++++++++++++++++++++++++++++++++--------
4 files changed, 139 insertions(+), 50 deletions(-)
--
Masami Hiramatsu
e-mail: mhiramat@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -tip 0/6] perf-probe bugfixes
2010-04-14 22:39 [PATCH -tip 0/6] perf-probe bugfixes Masami Hiramatsu
@ 2010-04-14 23:28 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-04-14 23:28 UTC (permalink / raw)
To: Masami Hiramatsu; +Cc: Ingo Molnar, lkml, systemtap, DLE
Em Wed, Apr 14, 2010 at 06:39:21PM -0400, Masami Hiramatsu escreveu:
> Hi Arnaldo,
>
> (Sorry, I've fixed to signed-off-by and send it again)
> Could you pull these patches into your tree too?
> These fixes several bugs on perf probe.
>
> Thank you,
Sure, I just applied your previous series and will now review this new
one and merge it after that.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-14 23:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-14 22:36 [PATCH -tip 0/6] perf-probe bugfixes Masami Hiramatsu
2010-04-14 22:36 ` [PATCH -tip 1/6] perf probe: Fix to use correct debugfs path finder Masami Hiramatsu
2010-04-14 22:37 ` [PATCH -tip 2/6] perf probe: Fix mis-estimation for shortening filename Masami Hiramatsu
-- strict thread matches above, loose matches on Subject: below --
2010-04-14 22:39 [PATCH -tip 0/6] perf-probe bugfixes Masami Hiramatsu
2010-04-14 23:28 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox