Re: [PATCH V8 04/15] perf tools: change machine__findnew_thread()to set thread pid

From: David Ahern
Date: Mon Jul 29 2013 - 18:19:20 EST


On 7/28/13 4:43 AM, Adrian Hunter wrote:

- thread = machine__findnew_thread(machine, event->ip.pid);
+ thread = machine__findnew_thread(machine, event->ip.pid,
event->ip.pid);

event->ip.tid? at a minimum current functionality is retained with
machine__findnew_thread(machine, 0, event->ip.pid)

perf tools records mmap information against the process's main thread
for which pid == tid. So the correct values are being passed here.

Yes. It's a case by case -- if you want syms use pid, otherwise use tid. It would be less confusing if the API was improved - always take pid and tid along with an arg that says 'want syms' or a separate function name. But I digress.

Looking at your patch does maintain the tid element so it should be fine. I ran a few tests with perf-script and the output is the same after the patch, so..

Acked-by: David Ahern <dsahern@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/