All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	LKML <linux-kernel@vger.kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	David Ahern <dsahern@gmail.com>,
	Sonny Rao <sonnyrao@chromium.org>
Subject: Re: [PATCH] perf session: Fix infinite loop on invalid perf.data file
Date: Tue, 1 Oct 2013 09:16:46 +0200	[thread overview]
Message-ID: <20131001071646.GA20023@gmail.com> (raw)
In-Reply-To: <1380529188-27193-1-git-send-email-namhyung@kernel.org>


* Namhyung Kim <namhyung@kernel.org> wrote:

> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -2753,6 +2753,15 @@ int perf_session__read_header(struct perf_session *session)
>  	if (perf_file_header__read(&f_header, header, fd) < 0)
>  		return -EINVAL;
>  
> +	/*
> +	 * Sanity check that perf.data was written cleanly; data size is
> +	 * initialized to 0 and updated only if the on_exit function is run.
> +	 * If data size is still 0 then the file contains only partial
> +	 * information.  Just warn user and process it as much as it can.
> +	 */
> +	if (f_header.data.size == 0)
> +		pr_warning("Data size is 0. Was the record command properly terminated?\n");

Just a detail: it would be nice to make all the user facing messages in 
tools/perf/util/header.c more specific and more structured. For example 
prefixing it with 'perf header:' would be fine:

	WARNING: perf/header: Data size is 0. Was the 'perf record' command properly terminated?

or something like that.

etc.

	Ingo

  parent reply	other threads:[~2013-10-01  7:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30  8:19 [PATCH] perf session: Fix infinite loop on invalid perf.data file Namhyung Kim
2013-09-30 13:49 ` David Ahern
2013-10-01  0:28   ` Sonny Rao
2013-10-01  7:16 ` Ingo Molnar [this message]
2013-10-01 13:24   ` David Ahern
2013-10-01 14:21     ` Ingo Molnar
2013-10-01 14:43       ` David Ahern
2013-10-01 15:33         ` Ingo Molnar
2013-10-01 16:54           ` Arnaldo Carvalho de Melo
2013-10-01 16:59             ` David Ahern
2013-10-04 15:25               ` Arnaldo Carvalho de Melo
2013-10-04 15:33                 ` David Ahern
2013-10-01 18:06             ` Ingo Molnar
2013-10-08 10:41 ` [tip:perf/urgent] " tip-bot for Namhyung Kim

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=20131001071646.GA20023@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=sonnyrao@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.