lkml.org 
[lkml]   [2008]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] ftrace: add thread comm to function graph tracer
On Wed, 26 Nov 2008 00:16:26 -0500 Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Steven Rostedt <rostedt@goodmis.org>
>
> Impact: enhancement to function graph tracer
>
> Export the trace_find_cmdline so the function graph tracer can
> use it to print the comms of the threads.
>
> -static char *trace_find_cmdline(int pid)
> +char *trace_find_cmdline(int pid)
>
> ...
>
> static int verif_pid(struct trace_seq *s, pid_t pid)
> {
> + char *comm;
> +
> if (last_pid != -1 && last_pid == pid)
> return 1;
>
> last_pid = pid;
> - return trace_seq_printf(s, "\n------------8<---------- thread %d"
> + comm = trace_find_cmdline(pid);
> +
> + return trace_seq_printf(s, "\n------------8<---------- thread %s-%d"
> " ------------8<----------\n\n",
> - pid);
> + comm, pid);
> }

This code gets its int's and pid_t's all mixed up. It's a bit cosmetic, but
nice to get it right for readability's sake.


\
 
 \ /
  Last update: 2008-11-26 06:41    [W:0.105 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site