Em Tue, Mar 24, 2015 at 09:57:52AM -0400, Steven Rostedt escreveu:
> From: "Steven Rostedt (Red Hat)" <rost...@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 <rost...@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]$ 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to