Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191141
b: refs/heads/master
c: b177f63
h: refs/heads/master
i:
  191139: 09e48a5
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Mar 26, 2010
1 parent 8c348fb commit 64935b3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 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: d5679ae4d2d4369477dc3b60027cca222aef33e9
refs/heads/master: b177f63f5226e75280855bbcd106e677250778bd
3 changes: 2 additions & 1 deletion trunk/tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ int event__process_mmap(event_t *self, struct perf_session *session)
}

thread = perf_session__findnew(session, self->mmap.pid);
map = map__new(&self->mmap, MAP__FUNCTION,
map = map__new(self->mmap.start, self->mmap.len, self->mmap.pgoff,
self->mmap.pid, self->mmap.filename, MAP__FUNCTION,
session->cwd, session->cwdlen);

if (thread == NULL || map == NULL)
Expand Down
11 changes: 4 additions & 7 deletions trunk/tools/perf/util/map.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "event.h"
#include "symbol.h"
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -38,13 +37,12 @@ void map__init(struct map *self, enum map_type type,
RB_CLEAR_NODE(&self->rb_node);
}

struct map *map__new(struct mmap_event *event, enum map_type type,
char *cwd, int cwdlen)
struct map *map__new(u64 start, u64 len, u64 pgoff, u32 pid, char *filename,
enum map_type type, char *cwd, int cwdlen)
{
struct map *self = malloc(sizeof(*self));

if (self != NULL) {
const char *filename = event->filename;
char newfilename[PATH_MAX];
struct dso *dso;
int anon;
Expand All @@ -62,16 +60,15 @@ struct map *map__new(struct mmap_event *event, enum map_type type,
anon = is_anon_memory(filename);

if (anon) {
snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", event->pid);
snprintf(newfilename, sizeof(newfilename), "/tmp/perf-%d.map", pid);
filename = newfilename;
}

dso = dsos__findnew(filename);
if (dso == NULL)
goto out_delete;

map__init(self, type, event->start, event->start + event->len,
event->pgoff, dso);
map__init(self, type, start, start + len, pgoff, dso);

if (anon) {
set_identity:
Expand Down
5 changes: 2 additions & 3 deletions trunk/tools/perf/util/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,13 @@ u64 map__rip_2objdump(struct map *map, u64 rip);
u64 map__objdump_2ip(struct map *map, u64 addr);

struct symbol;
struct mmap_event;

typedef int (*symbol_filter_t)(struct map *map, struct symbol *sym);

void map__init(struct map *self, enum map_type type,
u64 start, u64 end, u64 pgoff, struct dso *dso);
struct map *map__new(struct mmap_event *event, enum map_type,
char *cwd, int cwdlen);
struct map *map__new(u64 start, u64 len, u64 pgoff, u32 pid, char *filename,
enum map_type type, char *cwd, int cwdlen);
void map__delete(struct map *self);
struct map *map__clone(struct map *self);
int map__overlap(struct map *l, struct map *r);
Expand Down

0 comments on commit 64935b3

Please sign in to comment.