Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320442
b: refs/heads/master
c: 5cd95c2
h: refs/heads/master
v: v3
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed Jul 25, 2012
1 parent aac62f0 commit 50a7b5e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 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: f51304d3fe4fee475991ee424a4b7f85eec65a7b
refs/heads/master: 5cd95c2db479aa7a66f6fa572dfa410c6314c78e
17 changes: 16 additions & 1 deletion trunk/tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stdio.h>
#include <unistd.h>
#include "map.h"
#include "thread.h"

const char *map_type__name[MAP__NR_TYPES] = {
[MAP__FUNCTION] = "Functions",
Expand Down Expand Up @@ -585,7 +586,21 @@ int machine__init(struct machine *self, const char *root_dir, pid_t pid)
self->kmaps.machine = self;
self->pid = pid;
self->root_dir = strdup(root_dir);
return self->root_dir == NULL ? -ENOMEM : 0;
if (self->root_dir == NULL)
return -ENOMEM;

if (pid != HOST_KERNEL_ID) {
struct thread *thread = machine__findnew_thread(self, pid);
char comm[64];

if (thread == NULL)
return -ENOMEM;

snprintf(comm, sizeof(comm), "[guest/%d]", pid);
thread__set_comm(thread, comm);
}

return 0;
}

static void dsos__delete(struct list_head *self)
Expand Down

0 comments on commit 50a7b5e

Please sign in to comment.