summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-19 11:17:30 -0700
committerDavid S. Miller <davem@davemloft.net>2012-07-19 11:17:30 -0700
commitabaa72d7fd9a20a67b62e6afa0e746e27851dc33 (patch)
treeebe4134fcc93a6e205e6004b3e652d7a62281651 /tools/perf/util/map.c
parent67da22d23fa6f3324e03bcd0580b914b2e4afbf3 (diff)
parent3e4b9459fb0e149c6b74c9e89399a8fc39a92b44 (diff)
downloadop-kernel-dev-abaa72d7fd9a20a67b62e6afa0e746e27851dc33.zip
op-kernel-dev-abaa72d7fd9a20a67b62e6afa0e746e27851dc33.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r--tools/perf/util/map.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 35ae568..a1f4e36 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -669,25 +669,26 @@ struct machine *machines__find(struct rb_root *self, pid_t pid)
struct machine *machines__findnew(struct rb_root *self, pid_t pid)
{
char path[PATH_MAX];
- const char *root_dir;
+ const char *root_dir = "";
struct machine *machine = machines__find(self, pid);
- if (!machine || machine->pid != pid) {
- if (pid == HOST_KERNEL_ID || pid == DEFAULT_GUEST_KERNEL_ID)
- root_dir = "";
- else {
- if (!symbol_conf.guestmount)
- goto out;
- sprintf(path, "%s/%d", symbol_conf.guestmount, pid);
- if (access(path, R_OK)) {
- pr_err("Can't access file %s\n", path);
- goto out;
- }
- root_dir = path;
+ if (machine && (machine->pid == pid))
+ goto out;
+
+ if ((pid != HOST_KERNEL_ID) &&
+ (pid != DEFAULT_GUEST_KERNEL_ID) &&
+ (symbol_conf.guestmount)) {
+ sprintf(path, "%s/%d", symbol_conf.guestmount, pid);
+ if (access(path, R_OK)) {
+ pr_err("Can't access file %s\n", path);
+ machine = NULL;
+ goto out;
}
- machine = machines__add(self, pid, root_dir);
+ root_dir = path;
}
+ machine = machines__add(self, pid, root_dir);
+
out:
return machine;
}
OpenPOWER on IntegriCloud