From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Steven Rostedt <srostedt@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Borislav Petkov <bp@alien8.de>, Jiri Olsa <jolsa@redhat.com>,
Arun Sharma <asharma@fb.com>, Namhyung Kim <namhyung.kim@lge.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>
Subject: [PATCH 11/15] parse-events: Let pevent_free() take a NULL pointer
Date: Wed, 25 Apr 2012 14:26:55 +0200 [thread overview]
Message-ID: <1335356819-16710-12-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1335356819-16710-1-git-send-email-fweisbec@gmail.com>
From: Steven Rostedt <srostedt@redhat.com>
The pevent_free() should ack like other free()s and allow a
NULL pointer to be passed to it which makes error handling a bit
easier for the users of pevent_free().
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
tools/lib/traceevent/event-parse.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index cdb32c7..4d5092f 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -4960,13 +4960,20 @@ static void free_event(struct event_format *event)
*/
void pevent_free(struct pevent *pevent)
{
- struct cmdline_list *cmdlist = pevent->cmdlist, *cmdnext;
- struct func_list *funclist = pevent->funclist, *funcnext;
- struct printk_list *printklist = pevent->printklist, *printknext;
+ struct cmdline_list *cmdlist, *cmdnext;
+ struct func_list *funclist, *funcnext;
+ struct printk_list *printklist, *printknext;
struct pevent_function_handler *func_handler;
struct event_handler *handle;
int i;
+ if (!pevent)
+ return;
+
+ cmdlist = pevent->cmdlist;
+ funclist = pevent->funclist;
+ printklist = pevent->printklist;
+
pevent->ref_count--;
if (pevent->ref_count)
return;
--
1.7.5.4
next prev parent reply other threads:[~2012-04-25 12:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-25 12:26 [PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v3 Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 01/15] perf: Separate out trace-cmd parse-events from perf files Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 02/15] tools/events: Add files to create libtraceevent.a Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 03/15] perf: Build libtraceevent.a Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 04/15] events: Update tools/lib/traceevent to work with perf Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 05/15] perf: Have perf use the new libtraceevent.a library Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 06/15] perf/events: Add flag to produce nsec output Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 07/15] perf/events: Add flag/symbol format_flags Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 08/15] perf/events: Correct size given to memset Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 09/15] parse-events: Handle invalid opcode parsing gracefully Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 10/15] parse-events: Handle opcode parsing error Frederic Weisbecker
2012-04-25 12:26 ` Frederic Weisbecker [this message]
2012-04-25 12:26 ` [PATCH 12/15] parse-events: Support '+' opcode in print format Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 13/15] parse-events: Allow '*' and '/' operations in TP_printk Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 14/15] parse-event: Fix memset pointer size bug in handle Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 15/15] parse-events: Rename struct record to struct pevent_record Frederic Weisbecker
2012-05-07 8:14 ` [PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v3 Ingo Molnar
2012-05-07 8:36 ` Namhyung Kim
2012-05-07 12:57 ` Steven Rostedt
2012-05-07 13:01 ` Steven Rostedt
2012-05-07 13:37 ` Steven Rostedt
2012-05-07 14:13 ` Ingo Molnar
2012-05-21 6:40 ` Namhyung Kim
2012-05-21 8:44 ` Ingo Molnar
2012-05-21 11:36 ` Frederic Weisbecker
-- strict thread matches above, loose matches on Subject: below --
2012-04-05 22:47 [RFC][PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v2 Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 11/15] parse-events: Let pevent_free() take a NULL pointer Frederic Weisbecker
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=1335356819-16710-12-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=acme@infradead.org \
--cc=asharma@fb.com \
--cc=bp@alien8.de \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srostedt@redhat.com \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).