* [GIT PULL 0/3] perf/urgent fixes
@ 2013-10-20 8:27 Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 1/3] perf probe: Fix to initialize fname always before use it Arnaldo Carvalho de Melo
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-10-20 8:27 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter, Andi Kleen,
David Ahern, Frederic Weisbecker, Ingo Molnar, Jiri Olsa,
Masami Hiramatsu, Mike Galbraith, Namhyung Kim, Paul Mackerras,
Peter Zijlstra, Stephane Eranian, Tom Zanussi, Waiman Long, acme,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 1651d120baddf68846188bcdf0ef5350068436cf:
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2013-10-08 07:29:09 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo
for you to fetch changes up to 3090ffb5a2515990182f3f55b0688a7817325488:
perf: Disable PERF_RECORD_MMAP2 support (2013-10-17 16:27:14 -0300)
----------------------------------------------------------------
perf/urgent fixes:
. Fix build error on Fedora 12.
. Fix to initialize fname always before use it, bug introduced
during this merge window, from Masami Hiramatsu.
. Disable PERF_RECORD_MMAP2 support, from Stephane Eranian.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
perf scripting perl: Fix build error on Fedora 12
Masami Hiramatsu (1):
perf probe: Fix to initialize fname always before use it
Stephane Eranian (1):
perf: Disable PERF_RECORD_MMAP2 support
kernel/events/core.c | 4 +++
tools/perf/util/event.c | 30 ++++++++++------------
tools/perf/util/evsel.c | 1 -
tools/perf/util/probe-finder.c | 2 +-
.../perf/util/scripting-engines/trace-event-perl.c | 2 +-
5 files changed, 19 insertions(+), 20 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] perf probe: Fix to initialize fname always before use it
2013-10-20 8:27 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2013-10-20 8:27 ` Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 2/3] perf scripting perl: Fix build error on Fedora 12 Arnaldo Carvalho de Melo
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-10-20 8:27 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Masami Hiramatsu, Ingo Molnar, Namhyung Kim,
Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Fix perf probe --list to initialize fname local var always before
use it. This may cause a SEGV if there is a probe which is in
the function body but not in any inline function.
Problem introduced in:
commit e08cfd4bda76
Author: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Date: Mon Sep 30 18:21:44 2013 +0900
perf probe: Fix to find line information for probe list
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20131011122317.9662.29736.stgit@kbuild-fedora.novalocal
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/probe-finder.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index c09e0a9fdf4c..f0692737ebf1 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -1357,10 +1357,10 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr,
goto post;
}
+ fname = dwarf_decl_file(&spdie);
if (addr == (unsigned long)baseaddr) {
/* Function entry - Relative line number is 0 */
lineno = baseline;
- fname = dwarf_decl_file(&spdie);
goto post;
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] perf scripting perl: Fix build error on Fedora 12
2013-10-20 8:27 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 1/3] perf probe: Fix to initialize fname always before use it Arnaldo Carvalho de Melo
@ 2013-10-20 8:27 ` Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 3/3] perf: Disable PERF_RECORD_MMAP2 support Arnaldo Carvalho de Melo
2013-10-20 8:53 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar
3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-10-20 8:27 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
David Ahern, Frederic Weisbecker, Jiri Olsa, Mike Galbraith,
Paul Mackerras, Peter Zijlstra, Stephane Eranian, Tom Zanussi,
Waiman Long
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Cast __u64 to u64 to silence this warning on older distros, such as
Fedora 12:
CC /tmp/build/perf/util/scripting-engines/trace-event-perl.o
cc1: warnings being treated as errors
util/scripting-engines/trace-event-perl.c: In function ‘perl_process_tracepoint’:
util/scripting-engines/trace-event-perl.c:285: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘__u64’
make[1]: *** [/tmp/build/perf/util/scripting-engines/trace-event-perl.o] Error 1
make: *** [install] Error 2
make: Leaving directory `/home/acme/git/linux/tools/perf'
[acme@fedora12 linux]$
Reported-by: Waiman Long <Waiman.Long@hp.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
Cc: Waiman Long <Waiman.Long@hp.com>
Link: http://lkml.kernel.org/n/tip-nlxofdqcdjfm0w9o6bgq4kqv@git.kernel.org
Link: http://lkml.kernel.org/r/1381265120-58532-1-git-send-email-Waiman.Long@hp.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/scripting-engines/trace-event-perl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c
index a85e4ae5f3ac..c0c9795c4f02 100644
--- a/tools/perf/util/scripting-engines/trace-event-perl.c
+++ b/tools/perf/util/scripting-engines/trace-event-perl.c
@@ -282,7 +282,7 @@ static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused,
event = find_cache_event(evsel);
if (!event)
- die("ug! no event found for type %" PRIu64, evsel->attr.config);
+ die("ug! no event found for type %" PRIu64, (u64)evsel->attr.config);
pid = raw_field_value(event, "common_pid", data);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] perf: Disable PERF_RECORD_MMAP2 support
2013-10-20 8:27 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 1/3] perf probe: Fix to initialize fname always before use it Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 2/3] perf scripting perl: Fix build error on Fedora 12 Arnaldo Carvalho de Melo
@ 2013-10-20 8:27 ` Arnaldo Carvalho de Melo
2013-10-20 8:53 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar
3 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-10-20 8:27 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Stephane Eranian, Andi Kleen, David Ahern,
Ingo Molnar, Jiri Olsa, Peter Zijlstra, Arnaldo Carvalho de Melo
From: Stephane Eranian <eranian@google.com>
For now, we disable the extended MMAP record support (MMAP2).
We have identified cases where it would not report the correct mapping
information, clone(VM_CLONE) but with separate pids. We will revisit
the support once we find a solution for this case.
The patch changes the kernel to return EINVAL if attr->mmap2 is set. The
patch also modifies the perf tool to use regular PERF_RECORD_MMAP for
synthetic events and it also prevents the tool from requesting
attr->mmap2 mode because the kernel would reject it.
The support will be revisited once the kenrel interface is updated.
In V2, we reduce the patch to the strict minimum.
In V3, we avoid calling perf_event_open() with mmap2 set because we know
it will fail and require fallback retry.
Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131017173215.GA8820@quad
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
kernel/events/core.c | 4 ++++
tools/perf/util/event.c | 30 +++++++++++++-----------------
tools/perf/util/evsel.c | 1 -
3 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index d49a9d29334c..953c14348375 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6767,6 +6767,10 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
if (ret)
return -EFAULT;
+ /* disabled for now */
+ if (attr->mmap2)
+ return -EINVAL;
+
if (attr->__reserved_1)
return -EINVAL;
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 9b393e7dca6f..63df031fc9c7 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -187,7 +187,7 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
return -1;
}
- event->header.type = PERF_RECORD_MMAP2;
+ event->header.type = PERF_RECORD_MMAP;
/*
* Just like the kernel, see __perf_event_mmap in kernel/perf_event.c
*/
@@ -198,7 +198,6 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
char prot[5];
char execname[PATH_MAX];
char anonstr[] = "//anon";
- unsigned int ino;
size_t size;
ssize_t n;
@@ -209,13 +208,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
strcpy(execname, "");
/* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */
- n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n",
- &event->mmap2.start, &event->mmap2.len, prot,
- &event->mmap2.pgoff, &event->mmap2.maj,
- &event->mmap2.min,
- &ino, execname);
-
- event->mmap2.ino = (u64)ino;
+ n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %*x:%*x %*u %s\n",
+ &event->mmap.start, &event->mmap.len, prot,
+ &event->mmap.pgoff,
+ execname);
if (n != 8)
continue;
@@ -227,15 +223,15 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
strcpy(execname, anonstr);
size = strlen(execname) + 1;
- memcpy(event->mmap2.filename, execname, size);
+ memcpy(event->mmap.filename, execname, size);
size = PERF_ALIGN(size, sizeof(u64));
- event->mmap2.len -= event->mmap.start;
- event->mmap2.header.size = (sizeof(event->mmap2) -
- (sizeof(event->mmap2.filename) - size));
- memset(event->mmap2.filename + size, 0, machine->id_hdr_size);
- event->mmap2.header.size += machine->id_hdr_size;
- event->mmap2.pid = tgid;
- event->mmap2.tid = pid;
+ event->mmap.len -= event->mmap.start;
+ event->mmap.header.size = (sizeof(event->mmap) -
+ (sizeof(event->mmap.filename) - size));
+ memset(event->mmap.filename + size, 0, machine->id_hdr_size);
+ event->mmap.header.size += machine->id_hdr_size;
+ event->mmap.pid = tgid;
+ event->mmap.tid = pid;
if (process(tool, event, &synth_sample, machine) != 0) {
rc = -1;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 0ce9febf1ba0..9f1ef9bee2d0 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -678,7 +678,6 @@ void perf_evsel__config(struct perf_evsel *evsel,
attr->sample_type |= PERF_SAMPLE_WEIGHT;
attr->mmap = track;
- attr->mmap2 = track && !perf_missing_features.mmap2;
attr->comm = track;
/*
--
1.8.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [GIT PULL 0/3] perf/urgent fixes
2013-10-20 8:27 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
` (2 preceding siblings ...)
2013-10-20 8:27 ` [PATCH 3/3] perf: Disable PERF_RECORD_MMAP2 support Arnaldo Carvalho de Melo
@ 2013-10-20 8:53 ` Ingo Molnar
3 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2013-10-20 8:53 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Adrian Hunter, Andi Kleen, David Ahern,
Frederic Weisbecker, Ingo Molnar, Jiri Olsa, Masami Hiramatsu,
Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
Stephane Eranian, Tom Zanussi, Waiman Long, acme,
Arnaldo Carvalho de Melo
* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> Hi Ingo,
>
> Please consider pulling,
>
> - Arnaldo
>
> The following changes since commit 1651d120baddf68846188bcdf0ef5350068436cf:
>
> Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (2013-10-08 07:29:09 +0200)
>
> are available in the git repository at:
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo
>
> for you to fetch changes up to 3090ffb5a2515990182f3f55b0688a7817325488:
>
> perf: Disable PERF_RECORD_MMAP2 support (2013-10-17 16:27:14 -0300)
>
> ----------------------------------------------------------------
> perf/urgent fixes:
>
> . Fix build error on Fedora 12.
>
> . Fix to initialize fname always before use it, bug introduced
> during this merge window, from Masami Hiramatsu.
>
> . Disable PERF_RECORD_MMAP2 support, from Stephane Eranian.
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> ----------------------------------------------------------------
> Arnaldo Carvalho de Melo (1):
> perf scripting perl: Fix build error on Fedora 12
>
> Masami Hiramatsu (1):
> perf probe: Fix to initialize fname always before use it
>
> Stephane Eranian (1):
> perf: Disable PERF_RECORD_MMAP2 support
>
> kernel/events/core.c | 4 +++
> tools/perf/util/event.c | 30 ++++++++++------------
> tools/perf/util/evsel.c | 1 -
> tools/perf/util/probe-finder.c | 2 +-
> .../perf/util/scripting-engines/trace-event-perl.c | 2 +-
> 5 files changed, 19 insertions(+), 20 deletions(-)
Pulled, thanks Arnaldo!
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-20 8:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-20 8:27 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 1/3] perf probe: Fix to initialize fname always before use it Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 2/3] perf scripting perl: Fix build error on Fedora 12 Arnaldo Carvalho de Melo
2013-10-20 8:27 ` [PATCH 3/3] perf: Disable PERF_RECORD_MMAP2 support Arnaldo Carvalho de Melo
2013-10-20 8:53 ` [GIT PULL 0/3] perf/urgent fixes Ingo Molnar
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).