aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/events/core.c4
-rw-r--r--tools/perf/util/event.c30
-rw-r--r--tools/perf/util/evsel.c1
-rw-r--r--tools/perf/util/probe-finder.c2
-rw-r--r--tools/perf/util/scripting-engines/trace-event-perl.c2
5 files changed, 19 insertions, 20 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,
6767 if (ret) 6767 if (ret)
6768 return -EFAULT; 6768 return -EFAULT;
6769 6769
6770 /* disabled for now */
6771 if (attr->mmap2)
6772 return -EINVAL;
6773
6770 if (attr->__reserved_1) 6774 if (attr->__reserved_1)
6771 return -EINVAL; 6775 return -EINVAL;
6772 6776
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,
187 return -1; 187 return -1;
188 } 188 }
189 189
190 event->header.type = PERF_RECORD_MMAP2; 190 event->header.type = PERF_RECORD_MMAP;
191 /* 191 /*
192 * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c 192 * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c
193 */ 193 */
@@ -198,7 +198,6 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
198 char prot[5]; 198 char prot[5];
199 char execname[PATH_MAX]; 199 char execname[PATH_MAX];
200 char anonstr[] = "//anon"; 200 char anonstr[] = "//anon";
201 unsigned int ino;
202 size_t size; 201 size_t size;
203 ssize_t n; 202 ssize_t n;
204 203
@@ -209,13 +208,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
209 strcpy(execname, ""); 208 strcpy(execname, "");
210 209
211 /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ 210 /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */
212 n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n", 211 n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %*x:%*x %*u %s\n",
213 &event->mmap2.start, &event->mmap2.len, prot, 212 &event->mmap.start, &event->mmap.len, prot,
214 &event->mmap2.pgoff, &event->mmap2.maj, 213 &event->mmap.pgoff,
215 &event->mmap2.min, 214 execname);
216 &ino, execname);
217
218 event->mmap2.ino = (u64)ino;
219 215
220 if (n != 8) 216 if (n != 8)
221 continue; 217 continue;
@@ -227,15 +223,15 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
227 strcpy(execname, anonstr); 223 strcpy(execname, anonstr);
228 224
229 size = strlen(execname) + 1; 225 size = strlen(execname) + 1;
230 memcpy(event->mmap2.filename, execname, size); 226 memcpy(event->mmap.filename, execname, size);
231 size = PERF_ALIGN(size, sizeof(u64)); 227 size = PERF_ALIGN(size, sizeof(u64));
232 event->mmap2.len -= event->mmap.start; 228 event->mmap.len -= event->mmap.start;
233 event->mmap2.header.size = (sizeof(event->mmap2) - 229 event->mmap.header.size = (sizeof(event->mmap) -
234 (sizeof(event->mmap2.filename) - size)); 230 (sizeof(event->mmap.filename) - size));
235 memset(event->mmap2.filename + size, 0, machine->id_hdr_size); 231 memset(event->mmap.filename + size, 0, machine->id_hdr_size);
236 event->mmap2.header.size += machine->id_hdr_size; 232 event->mmap.header.size += machine->id_hdr_size;
237 event->mmap2.pid = tgid; 233 event->mmap.pid = tgid;
238 event->mmap2.tid = pid; 234 event->mmap.tid = pid;
239 235
240 if (process(tool, event, &synth_sample, machine) != 0) { 236 if (process(tool, event, &synth_sample, machine) != 0) {
241 rc = -1; 237 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,
678 attr->sample_type |= PERF_SAMPLE_WEIGHT; 678 attr->sample_type |= PERF_SAMPLE_WEIGHT;
679 679
680 attr->mmap = track; 680 attr->mmap = track;
681 attr->mmap2 = track && !perf_missing_features.mmap2;
682 attr->comm = track; 681 attr->comm = track;
683 682
684 /* 683 /*
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,
1357 goto post; 1357 goto post;
1358 } 1358 }
1359 1359
1360 fname = dwarf_decl_file(&spdie);
1360 if (addr == (unsigned long)baseaddr) { 1361 if (addr == (unsigned long)baseaddr) {
1361 /* Function entry - Relative line number is 0 */ 1362 /* Function entry - Relative line number is 0 */
1362 lineno = baseline; 1363 lineno = baseline;
1363 fname = dwarf_decl_file(&spdie);
1364 goto post; 1364 goto post;
1365 } 1365 }
1366 1366
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,
282 282
283 event = find_cache_event(evsel); 283 event = find_cache_event(evsel);
284 if (!event) 284 if (!event)
285 die("ug! no event found for type %" PRIu64, evsel->attr.config); 285 die("ug! no event found for type %" PRIu64, (u64)evsel->attr.config);
286 286
287 pid = raw_field_value(event, "common_pid", data); 287 pid = raw_field_value(event, "common_pid", data);
288 288