From 50a7b5e16372d46ac52cd7041019f1362672a5d3 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Fri, 20 Jul 2012 17:25:47 -0600 Subject: [PATCH] --- yaml --- r: 320442 b: refs/heads/master c: 5cd95c2db479aa7a66f6fa572dfa410c6314c78e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/util/map.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 7350c1631795..ba607e2ef5ef 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f51304d3fe4fee475991ee424a4b7f85eec65a7b +refs/heads/master: 5cd95c2db479aa7a66f6fa572dfa410c6314c78e diff --git a/trunk/tools/perf/util/map.c b/trunk/tools/perf/util/map.c index a1f4e3669142..8668569d4b2a 100644 --- a/trunk/tools/perf/util/map.c +++ b/trunk/tools/perf/util/map.c @@ -7,6 +7,7 @@ #include #include #include "map.h" +#include "thread.h" const char *map_type__name[MAP__NR_TYPES] = { [MAP__FUNCTION] = "Functions", @@ -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)