From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, tglx@linutronix.de, namhyung@kernel.org,
rostedt@goodmis.org, jolsa@kernel.org,
linux-kernel@vger.kernel.org, peterz@infradead.org,
hpa@zytor.com, mingo@kernel.org
Subject: [tip:perf/urgent] tools lib traceevent: Fix kbuffer_read_at_offset()
Date: Thu, 6 Oct 2016 15:41:22 -0700 [thread overview]
Message-ID: <tip-a130347973c408c0e0017a52c74cbc3226c1f0ef@git.kernel.org> (raw)
In-Reply-To: <20161001101700.29146-1-namhyung@kernel.org>
Commit-ID: a130347973c408c0e0017a52c74cbc3226c1f0ef
Gitweb: http://git.kernel.org/tip/a130347973c408c0e0017a52c74cbc3226c1f0ef
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Sat, 1 Oct 2016 19:17:00 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 5 Oct 2016 11:36:22 -0300
tools lib traceevent: Fix kbuffer_read_at_offset()
When it's called with an offset less than or equal to the first event,
it'll return a garbage value since the data is not initialized.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20161001101700.29146-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/kbuffer-parse.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lib/traceevent/kbuffer-parse.c b/tools/lib/traceevent/kbuffer-parse.c
index 3bcada3..65984f1 100644
--- a/tools/lib/traceevent/kbuffer-parse.c
+++ b/tools/lib/traceevent/kbuffer-parse.c
@@ -622,6 +622,7 @@ void *kbuffer_read_at_offset(struct kbuffer *kbuf, int offset,
/* Reset the buffer */
kbuffer_load_subbuffer(kbuf, kbuf->subbuffer);
+ data = kbuffer_read_event(kbuf, ts);
while (kbuf->curr < offset) {
data = kbuffer_next_event(kbuf, ts);
prev parent reply other threads:[~2016-10-06 22:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-01 10:17 [PATCH] " Namhyung Kim
2016-10-05 11:37 ` Arnaldo Carvalho de Melo
2016-10-05 13:28 ` Steven Rostedt
2016-10-07 4:19 ` Namhyung Kim
2016-10-07 14:06 ` Steven Rostedt
2016-10-06 22:41 ` tip-bot for Namhyung Kim [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=tip-a130347973c408c0e0017a52c74cbc3226c1f0ef@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--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
Powered by JetHome