lkml.org 
[lkml]   [2015]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/9] tools lib traceevent: Add pevent_data_pid_from_comm()
Em Tue, Mar 24, 2015 at 09:57:52AM -0400, Steven Rostedt escreveu:
> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
>
> 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>
> ---
> tools/lib/traceevent/event-parse.c | 90 ++++++++++++++++++++++++++++++++++++++
> tools/lib/traceevent/event-parse.h | 5 +++
> 2 files changed, 95 insertions(+)
>
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index 5795d9451063..8cc3e894ff46 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -4951,6 +4951,96 @@ const char *pevent_data_comm_from_pid(struct pevent *pevent, int pid)
> return comm;
> }
>

I am fixing this up:


[acme@ssdandy linux]$ am /wb/1.patch && make -C tools/perf
LIBBABELTRACE_DIR=/opt/libbabeltrace/ O=/tmp/build/perf install-bin
Applying: tools lib traceevent: Add pevent_data_pid_from_comm()
/home/acme/git/linux/.git/rebase-apply/patch:96: trailing whitespace.
if (!pevent->cmdlines ||
warning: 1 line adds whitespace errors.
tools/lib/traceevent/event-parse.c:5039: trailing whitespace.
+ if (!pevent->cmdlines ||
[acme@ssdandy linux]$


\
 
 \ /
  Last update: 2015-03-24 16:21    [W:0.171 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site