perf tools: Fix synthesizing fork_event.ppid for non-main thread
perf tools: Fix synthesizing fork_event.ppid for non-main thread

Commit ca6c41c59b9 sets the ppid based on what is read from the
/proc/pid/status file when synthesizing fork events.

This is correct thing to do for new processes but not threads of a
process.

Fix ppid for threads to be the main thread when synthesizing fork events
(ie., assume main thread spawned all sub-threads in a process).

Reported-by: Arnaldo Carvalho de Melo <666bd1607580ad61cc6fcd48fb567e9c8684b616@gmail.com>
Signed-off-by: David Ahern <a1d8233fd86825f7850db1646a4fb5e4cbf37b9e@oracle.com>
Tested-by: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com>
Acked-by: Don Zickus <3c9a8cec2f33672bf03519b05ce2324e6cf5717a@redhat.com>
Link: http://lkml.kernel.org/r/1428598107-178999-1-git-send-email-a1d8233fd86825f7850db1646a4fb5e4cbf37b9e@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs