mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: event tracing, ringbuffer and RB_MAX_SMALL_DATA
Date: Tue, 14 Jul 2009 19:18:11 +0200	[thread overview]
Message-ID: <1247591891.7178.20.camel@johannes.local> (raw)

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]

Hi,

By code inspection, I think there's a bug if your event contains only

	__dynamic_array(u8, buf, buflen)

and your buflen is only, say, 3. Then the event size will be the common
event size (12 bytes) plus this, so 15, which is well below
RB_MAX_SMALL_DATA (4*28 = 112), so it'll be divided by four to be stored
into type_len. At this point, however, you've lost the information that
your dynamic array was only three bytes, and it'll be considered _four_
bytes long by parsers as far as I can tell?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

             reply	other threads:[~2009-07-14 17:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 17:18 Johannes Berg [this message]
2009-07-15  1:08 ` Li Zefan
2009-07-15  9:48   ` Johannes Berg
2009-07-16  0:48     ` Li Zefan
2009-07-21  1:25       ` Steven Rostedt
2009-07-21  1:30         ` Li Zefan
2009-07-21  1:42           ` Steven Rostedt

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=1247591891.7178.20.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

all inboxes | Powered by JetHome®