Commit f5db57c4 authored by Dongsheng Yang's avatar Dongsheng Yang Committed by Arnaldo Carvalho de Melo

perf tools: Use machine->pid for tgid if machine is guest.

When we synthesize an comm event, if machine is guest, we should
use the pid of machine as the event->comm.pid, rather than tgid
of thread.
Signed-off-by: default avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Link: http://lkml.kernel.org/r/22455abe107c618a361e7b667ad0f098f7c9b4a3.1387572416.git.yangds.fnst@cn.fujitsu.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 73547aac
...@@ -106,8 +106,12 @@ static pid_t perf_event__synthesize_comm(struct perf_tool *tool, ...@@ -106,8 +106,12 @@ static pid_t perf_event__synthesize_comm(struct perf_tool *tool,
memset(&event->comm, 0, sizeof(event->comm)); memset(&event->comm, 0, sizeof(event->comm));
tgid = perf_event__get_comm_tgid(pid, event->comm.comm, if (machine__is_host(machine))
sizeof(event->comm.comm)); tgid = perf_event__get_comm_tgid(pid, event->comm.comm,
sizeof(event->comm.comm));
else
tgid = machine->pid;
if (tgid < 0) if (tgid < 0)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment