perf record: Fix .tid and .pid fill-in when synthesizing events
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 11 Aug 2009 19:22:00 +0000 (16:22 -0300)
committerIngo Molnar <mingo@elte.hu>
Wed, 12 Aug 2009 12:10:48 +0000 (14:10 +0200)
commit2a8083f063472f27c253545dd64e1a7bbbb1ab61
tree78c20465589a102a4c28357c8207ea3366cfff69
parentf64ccccb8afa43abdd63fcbd230f818d6ea0883f
perf record: Fix .tid and .pid fill-in when synthesizing events

Noticed when trying to record events for a firefox thread. We
were synthesizing both .tid and .pid with the pid passed via
--pid.

Fix it by reading /proc/PID/status and getting the tgid
to use in .pid, .tid gets the specified "pid".

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <20090811192200.GF18061@ghostprotocols.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-record.c