]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Fix synthesizing mmaps for threads
authorDon Zickus <dzickus@redhat.com>
Wed, 26 Feb 2014 15:45:26 +0000 (10:45 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 14 Mar 2014 14:20:44 +0000 (11:20 -0300)
commit53955e0ded3fdfc745c76340643493c920438622
treef816efa6ebb791f3bac6bed9843a405c6729cff1
parent0cc5daa61882e7be449d5eaac5b034ae22d9076c
perf tools: Fix synthesizing mmaps for threads

Currently if a process creates a bunch of threads using pthread_create
and then perf is run in system_wide mode, the mmaps for those threads
are not captured with a synthesized mmap event.

The reason is those threads are not visible when walking the /proc/
directory looking for /proc/<pid>/maps files.  Instead they are
discovered using the /proc/<pid>/tasks file (which the synthesized comm
event uses).

This causes problems when a program is trying to map a data address to a
tid.  Because the tid has no maps, the event is dropped.  Changing the
program to look up using the pid instead of the tid, finds the correct
maps but creates ugly hacks in the program to carry the correct tid
around.

Fix this by moving the walking of the /proc/<pid>/tasks up a level (out
of the comm function) based on Arnaldo's suggestion.

Tweaked things a bit to special case the 'full' bit and 'guest' check.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1393429527-167840-2-git-send-email-dzickus@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/event.c