Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182371
b: refs/heads/master
c: 18c3daa
h: refs/heads/master
i:
  182369: ec11e92
  182367: ea8b6cb
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Jan 16, 2010
1 parent ae99a90 commit 0f126bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf4e5b0838e822dd404638ad00d35b63fffe8191
refs/heads/master: 18c3daa4961b9fa1f2db0711d93c0acf0c39fd12
8 changes: 6 additions & 2 deletions trunk/tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ static void write_event(event_t *buf, size_t size)
* Add it to the list of DSOs, so that when we finish this
* record session we can pick the available build-ids.
*/
if (buf->header.type == PERF_RECORD_MMAP)
dsos__findnew(buf->mmap.filename);
if (buf->header.type == PERF_RECORD_MMAP) {
struct list_head *head = &dsos__user;
if (buf->mmap.header.misc == 1)
head = &dsos__kernel;
__dsos__findnew(head, buf->mmap.filename);
}

write_output(buf, size);
}
Expand Down
11 changes: 9 additions & 2 deletions trunk/tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
while (1) {
char bf[BUFSIZ], *pbf = bf;
event_t ev = {
.header = { .type = PERF_RECORD_MMAP },
.header = {
.type = PERF_RECORD_MMAP,
.misc = 0, /* Just like the kernel, see kernel/perf_event.c __perf_event_mmap */
},
};
int n;
size_t size;
Expand Down Expand Up @@ -170,6 +173,7 @@ int event__synthesize_modules(event__handler_t process,

size = ALIGN(pos->dso->long_name_len + 1, sizeof(u64));
memset(&ev, 0, sizeof(ev));
ev.mmap.header.misc = 1; /* kernel uses 0 for user space maps, see kernel/perf_event.c __perf_event_mmap */
ev.mmap.header.type = PERF_RECORD_MMAP;
ev.mmap.header.size = (sizeof(ev.mmap) -
(sizeof(ev.mmap.filename) - size));
Expand Down Expand Up @@ -236,7 +240,10 @@ int event__synthesize_kernel_mmap(event__handler_t process,
{
size_t size;
event_t ev = {
.header = { .type = PERF_RECORD_MMAP },
.header = {
.type = PERF_RECORD_MMAP,
.misc = 1, /* kernel uses 0 for user space maps, see kernel/perf_event.c __perf_event_mmap */
},
};
/*
* We should get this from /sys/kernel/sections/.text, but till that is
Expand Down

0 comments on commit 0f126bb

Please sign in to comment.