public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [QUESTION] trace_function_graph: consumed event may be invalid
@ 2009-06-30  8:14 Lai Jiangshan
  2009-06-30 10:54 ` Frederic Weisbecker
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2009-06-30  8:14 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: Steven Rostedt, LKML


In get_return_for_leaf() {
	......
	ring_buffer_consume()
	......
	access to @curr->ent.pid
}

@curr is saved at consumed event, if this event is the last event
in the page, the ring_buffer may reuse the page. It will become invalid.

Is there any other code to ensure it valid when we `cat trace_pipe`?

Lai.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [QUESTION] trace_function_graph: consumed event may be invalid
  2009-06-30  8:14 [QUESTION] trace_function_graph: consumed event may be invalid Lai Jiangshan
@ 2009-06-30 10:54 ` Frederic Weisbecker
  0 siblings, 0 replies; 2+ messages in thread
From: Frederic Weisbecker @ 2009-06-30 10:54 UTC (permalink / raw)
  To: Lai Jiangshan; +Cc: Steven Rostedt, LKML

On Tue, Jun 30, 2009 at 04:14:36PM +0800, Lai Jiangshan wrote:
> 
> In get_return_for_leaf() {
> 	......
> 	ring_buffer_consume()
> 	......
> 	access to @curr->ent.pid
> }
> 
> @curr is saved at consumed event, if this event is the last event
> in the page, the ring_buffer may reuse the page. It will become invalid.


Indeed!

 
> Is there any other code to ensure it valid when we `cat trace_pipe`?
> 
> Lai.


The only solution I see is to do a copy of the entry before consuming it.
I'll try that, thanks for your report!

Frederic.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-30 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-30  8:14 [QUESTION] trace_function_graph: consumed event may be invalid Lai Jiangshan
2009-06-30 10:54 ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox