mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Josef Bacik <jbacik@fb.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] trace-cmd: handle NULL comm name in .dat file
Date: Fri, 27 Jun 2014 16:21:23 -0400	[thread overview]
Message-ID: <20140627162123.3f9be953@gandalf.local.home> (raw)
In-Reply-To: <1403799732-30308-1-git-send-email-jbacik@fb.com>

On Thu, 26 Jun 2014 09:22:12 -0700
Josef Bacik <jbacik@fb.com> wrote:

> Sometimes the comm field in the trace.dat file can be empty which means that the
> event parsing stuff can pass a NULL into pevent_register_comm.  To fix this just
> check if we are NULL and generate a bogus comm name for that PID.  This keeps us
> from segfaulting.  Thanks,
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>

Applied, thanks!

-- Steve

> ---
>  event-parse.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/event-parse.c b/event-parse.c
> index 18b3587..00304fe 100644
> --- a/event-parse.c
> +++ b/event-parse.c
> @@ -303,7 +303,10 @@ int pevent_register_comm(struct pevent *pevent, const char *comm, int pid)
>  	if (!item)
>  		return -1;
>  
> -	item->comm = strdup(comm);
> +	if (comm)
> +		item->comm = strdup(comm);
> +	else
> +		item->comm = strdup("<...>");
>  	if (!item->comm) {
>  		free(item);
>  		return -1;


      reply	other threads:[~2014-06-27 20:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 16:22 Josef Bacik
2014-06-27 20:21 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140627162123.3f9be953@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=jbacik@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®