perf tools: Make fork event processing more resilient

When processing a fork event, the tools lookup the parent thread by its
tid.  In a couple of cases, it is possible for that thread to have the
wrong pid.

That can happen if the data is being processed out of order, or if the
(fork) event that would have removed the erroneous thread was lost.

Assume the latter case, print a dump message, remove the erroneous
thread, create a new one with the correct pid, and keep going.

Reported-by: Arnaldo Carvalho de Melo <>
Signed-off-by: Adrian Hunter <>
Tested-by: Jiri Olsa <>
Cc: Linus Torvalds <>
Signed-off-by: Arnaldo Carvalho de Melo <>
1 file changed