mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ming Lei <tom.leiming@gmail.com>
Cc: rjw@sisk.pl, stern@rowland.harvard.edu,
	linux-pm@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	fweisbec@gmail.com
Subject: Re: [RFC PATCH 1/2] PM/runtime: introduce trace points for tracing rpm_* functions
Date: Mon, 26 Sep 2011 22:37:53 -0400	[thread overview]
Message-ID: <1317091075.26514.29.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <CACVXFVN33diJAa3yZ4ASuRD+5edDnBcAA-oBntW9k8RpdQOo2w@mail.gmail.com>

On Tue, 2011-09-27 at 09:45 +0800, Ming Lei wrote:

> > Not to mention, this will never work with tools such as perf or
> > trace-cmd, that will just get a pointer address and will try to read a
> > string that points inside the kernel.
> 
> Ok, sounds like dev_name does not work for the case, I will update
> the patch, but I am wondering why no such problem for dev_dbg?
> printk still may buffer these for sometime in some cases.
> 


printk will push out to the console immediately. Whatever is in the
buffer has already been processed into a string. With tracing, we save
the data as defined by TP_fast_assign() and is printed later when the
user asks in TP_printk().

> >
> > This will only work with reading the trace data
> > from /debug/tracing/trace, but not from any tools. The pS *will* work
> > with the tools as the tools load the kallsyms data, and is smart enough
> > to figure this pointer out.
> 
> __func__ points to a const string, which will be stored in kernel global
> read-only section, I think perf can read correct string from the pointer
> anytime, don't I?

That would be very dangerous to let a userspace app have any access to
reading the kernel memory. Not to mention, this data may be sent out
over the network to another machine, which must be able to read this
data too.

-- Steve



      reply	other threads:[~2011-09-27  2:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22  4:11 tom.leiming
2011-09-22  4:11 ` [RFC PATCH 2/2] PM/runtime: replace dev_dbg with trace_rpm_* tom.leiming
2011-09-25 14:43 ` [RFC PATCH 1/2] PM/runtime: introduce trace points for tracing rpm_* functions Rafael J. Wysocki
2011-09-26 13:40 ` Steven Rostedt
2011-09-27  0:53   ` Ming Lei
2011-09-27  1:11     ` Steven Rostedt
2011-09-27  1:45       ` Ming Lei
2011-09-27  2:37         ` Steven Rostedt [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=1317091075.26514.29.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    --cc=tom.leiming@gmail.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

all inboxes | Powered by JetHome®