From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] perf lock: fix segfault with info subcommand following move to libtraceevent
Date: Fri, 6 Jul 2012 14:14:32 -0300 [thread overview]
Message-ID: <20120706171431.GF7533@infradead.org> (raw)
In-Reply-To: <1341590538-19523-1-git-send-email-dsahern@gmail.com>
Em Fri, Jul 06, 2012 at 10:02:18AM -0600, David Ahern escreveu:
> +++ b/tools/perf/builtin-lock.c
> @@ -877,6 +877,9 @@ static int read_events(void)
> if (!session)
> die("Initializing perf session failed\n");
>
> + if (!perf_session__has_traces(session, "lock record"))
> + exit(1);
> +
> return perf_session__process_events(session, &eops);
> }
This is getting out of hand, first a die(), then an exit(1) and finally
this function returns a value, ouch.
I'd rather use return to signal that something went wrong and as well
print some helpful warning to the user.
Eventually we should fix all the other offenders, but lets try not to
add even more.
Can you please resend with a pr_warning + return failure?
- Arnaldo
next prev parent reply other threads:[~2012-07-06 18:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-06 16:02 [PATCH] perf lock: fix segfault with info subcommand following move to libtraceevent David Ahern
2012-07-06 17:14 ` Arnaldo Carvalho de Melo [this message]
2012-07-06 17:17 ` David Ahern
2012-07-06 17:46 ` Arnaldo Carvalho de Melo
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=20120706171431.GF7533@infradead.org \
--to=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.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