]> git.baikalelectronics.ru Git - kernel.git/commit
tools lib traceevent: Add pevent_data_pid_from_comm()
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Tue, 24 Mar 2015 13:57:52 +0000 (09:57 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 24 Mar 2015 15:19:06 +0000 (12:19 -0300)
commit2f463fc7a310c65bb167bc9bb0566ec4c704f11d
treed64fc4817823894a6a069707812f16bd197c72fa
parentdc83ca2c7693373513c2a3e90f96c6e9e44846ff
tools lib traceevent: Add pevent_data_pid_from_comm()

There is a pevent_data_comm_from_pid() that returns the cmdline stored for
a given pid in order for users to map pids to comms, but there's no method
to convert a comm back to a pid. This is useful for filters that specify
a comm instead of a PID (it's faster than searching each individual event).

Add a way to retrieve a comm from a pid. Since there can be more than one
pid associated to a comm, it returns a data structure that lets the user
iterate over all the saved comms for a given pid.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20150324135923.001103479@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/traceevent/event-parse.c
tools/lib/traceevent/event-parse.h