I agree about the confusing way that Linux uses pid and tid. I guess
this comes from the (old) time where processes only had one thread.
Anyway, threads are just processes sharing some part of their memory,
and processes are just threads that don't share anything.
Your man page (the online version, I have to check why I don't have it
on my Linux workstation) was really helpful for me to build what I
needed upon the perf_event_open system call without having to start from
scratch with my own kernel module or the msr module and the Intel
documentation. I listed from my side some complementary information that
maybe useful for others, if you plan to update the man page I can
provide you these notes.
Thanks again to all here on the list for your help !
Manu
On 11/01/2013 06:02 PM, Vince Weaver wrote:
On Fri, 1 Nov 2013, Namhyung Kim wrote:
On Tue, 29 Oct 2013 14:20:09 +0100, Manuel Selva wrote:
One more thing I forgot to ask is clarification about the pid
parameter. According to Vince Weaver page: "If pid is 0, measurements
happen on the current thread, if pid is greater than 0, the process
indicated by pid is measured, and if pid is -1, all processes are
counted." and according to perf userland tool wiki page, it's possible
to attache to a specific thread with a -i option. As a consequence I
wonder how I can use the perf perf_event_sys_call to only count events
for a specific thread ?
In the syscall's point of view, pid is actually tid AFAIK - so I works
on the thread-basis not the process.
It is true the manpage is a bit confusing here, though that's mostly due
to the confusing way that Linux interchangably uses pid/tid for process
and thread ids. I'll see if I can get the documentation made more clear.
Vince
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html