public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Christoph Hellwig <hch@lst.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	cbe-oss-dev@ozlabs.org, srostedt@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH, RFC] sputrace: use the generic event tracer
Date: Wed, 6 May 2009 19:13:26 +0200	[thread overview]
Message-ID: <20090506171326.GA11199@lst.de> (raw)
In-Reply-To: <20090506165336.GC5997@nowhere>

On Wed, May 06, 2009 at 06:53:37PM +0200, Frederic Weisbecker wrote:
> I don't know much the code you are tracing. But it is rare that
> a const char * is safe on tracing. Still it could be, you just have to
> ensure the string cannot be freed in any way because this pointer
> will be stored in the ring buffer and it can be read and dereferenced later
> in a random time, could be several years :-)
> 
> So if this pointer references built-in data, no problem with that.
> But if it can freed (comes from a module, __initdata, ...), then
> you should use the __string() field which does an strcpy on the
> ring buffer.
> 
> If you think this is safe, then it's the best choice because
> storing a pointer is of course less costly than an strcpy.
> If so I will add the support for char * in the filters (trivial).

The pointer here only ever references string constants, it's always
a string literal in the callers.


  reply	other threads:[~2009-05-06 17:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090506102918.GA23278@lst.de>
2009-05-06 10:57 ` [PATCH, RFC] sputrace: use the generic event tracer Ingo Molnar
2009-05-06 11:02   ` Christoph Hellwig
2009-05-06 11:23     ` Ingo Molnar
2009-05-06 13:54       ` Steven Rostedt
2009-05-06 14:47         ` Ingo Molnar
2009-05-06 14:59           ` Steven Rostedt
2009-05-06 16:53   ` Frederic Weisbecker
2009-05-06 17:13     ` Christoph Hellwig [this message]
2009-05-06 19:05       ` Steven Rostedt
2009-05-10 19:07         ` [Cbe-oss-dev] " Christoph Hellwig
2009-05-06 10:58 ` Ingo Molnar

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=20090506171326.GA11199@lst.de \
    --to=hch@lst.de \
    --cc=benh@kernel.crashing.org \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=srostedt@redhat.com \
    /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