Skip to contentSkip to conversation

trace_function_graph: consumed event may be invalid

QUESTION Lai Jiangshan 2 participants 2 messages Jun 30, 2009

lore
Share & tools
lore
#0 lore raw
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.

#1 lore raw
Quoted 10 lines · Lai Jiangshan
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!

Quoted 3 lines

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.