提交 e4f8eaad 编写于 作者: I Ingo Molnar

Merge tag 'perf-urgent-for-mingo' of...

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

" * 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: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NIngo Molnar <mingo@kernel.org>
...@@ -6767,6 +6767,10 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr, ...@@ -6767,6 +6767,10 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
if (ret) if (ret)
return -EFAULT; return -EFAULT;
/* disabled for now */
if (attr->mmap2)
return -EINVAL;
if (attr->__reserved_1) if (attr->__reserved_1)
return -EINVAL; return -EINVAL;
......
...@@ -187,7 +187,7 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, ...@@ -187,7 +187,7 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
return -1; 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 * 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, ...@@ -198,7 +198,6 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
char prot[5]; char prot[5];
char execname[PATH_MAX]; char execname[PATH_MAX];
char anonstr[] = "//anon"; char anonstr[] = "//anon";
unsigned int ino;
size_t size; size_t size;
ssize_t n; ssize_t n;
...@@ -209,13 +208,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, ...@@ -209,13 +208,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
strcpy(execname, ""); strcpy(execname, "");
/* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */
n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n", n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %*x:%*x %*u %s\n",
&event->mmap2.start, &event->mmap2.len, prot, &event->mmap.start, &event->mmap.len, prot,
&event->mmap2.pgoff, &event->mmap2.maj, &event->mmap.pgoff,
&event->mmap2.min, execname);
&ino, execname);
event->mmap2.ino = (u64)ino;
if (n != 8) if (n != 8)
continue; continue;
...@@ -227,15 +223,15 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, ...@@ -227,15 +223,15 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
strcpy(execname, anonstr); strcpy(execname, anonstr);
size = strlen(execname) + 1; size = strlen(execname) + 1;
memcpy(event->mmap2.filename, execname, size); memcpy(event->mmap.filename, execname, size);
size = PERF_ALIGN(size, sizeof(u64)); size = PERF_ALIGN(size, sizeof(u64));
event->mmap2.len -= event->mmap.start; event->mmap.len -= event->mmap.start;
event->mmap2.header.size = (sizeof(event->mmap2) - event->mmap.header.size = (sizeof(event->mmap) -
(sizeof(event->mmap2.filename) - size)); (sizeof(event->mmap.filename) - size));
memset(event->mmap2.filename + size, 0, machine->id_hdr_size); memset(event->mmap.filename + size, 0, machine->id_hdr_size);
event->mmap2.header.size += machine->id_hdr_size; event->mmap.header.size += machine->id_hdr_size;
event->mmap2.pid = tgid; event->mmap.pid = tgid;
event->mmap2.tid = pid; event->mmap.tid = pid;
if (process(tool, event, &synth_sample, machine) != 0) { if (process(tool, event, &synth_sample, machine) != 0) {
rc = -1; rc = -1;
......
...@@ -678,7 +678,6 @@ void perf_evsel__config(struct perf_evsel *evsel, ...@@ -678,7 +678,6 @@ void perf_evsel__config(struct perf_evsel *evsel,
attr->sample_type |= PERF_SAMPLE_WEIGHT; attr->sample_type |= PERF_SAMPLE_WEIGHT;
attr->mmap = track; attr->mmap = track;
attr->mmap2 = track && !perf_missing_features.mmap2;
attr->comm = track; attr->comm = track;
/* /*
......
...@@ -1357,10 +1357,10 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, ...@@ -1357,10 +1357,10 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr,
goto post; goto post;
} }
fname = dwarf_decl_file(&spdie);
if (addr == (unsigned long)baseaddr) { if (addr == (unsigned long)baseaddr) {
/* Function entry - Relative line number is 0 */ /* Function entry - Relative line number is 0 */
lineno = baseline; lineno = baseline;
fname = dwarf_decl_file(&spdie);
goto post; goto post;
} }
......
...@@ -282,7 +282,7 @@ static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused, ...@@ -282,7 +282,7 @@ static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused,
event = find_cache_event(evsel); event = find_cache_event(evsel);
if (!event) 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); pid = raw_field_value(event, "common_pid", data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册