Skip to contentSkip to conversation

ring_buffer question

tracing Jon Masters 3 participants 6 messages May 17, 2009 – May 18, 2009

lore
Share & tools
lore
#0 lore raw

Steven,

Is there any reason you can think of why we don't just generalize kernel/trace/ring_buffer into kernel/ring_buffer, remove the static per_cpu buffer allocation and have this available for non-tracing?

As it is, trace buffers only store generic data and the design (swap on read) is very nicely done for many other ring buffer uses.

Jon.

#1 lore raw
Quoted 3 lines · Jon Masters

Is there any reason you can think of why we don't just generalize kernel/trace/ring_buffer into kernel/ring_buffer, remove the static per_cpu buffer allocation and have this available for non-tracing?

Ignore the latter point - I realize that I can use ring_buffer_alloc, etc. quite happily. I am doing that now in my smi_detector rewrite. But I still think the RB is a little too tracing specific - so, perhaps we can move it out of kernel/trace. I'll write up something once I've figured out this stuff to go along with the excellent trace docs since the generic ring buffer implementation is really quite sexy stuff.

[thinking out loud] Does the global disable stuff also disable other non-tracing ring buffers?

Jon.

#2 lore raw
Quoted 2 lines · Jon Masters

[thinking out loud] Does the global disable stuff also disable other non-tracing ring buffers?

I believe it does. If I'm correct, I think it would be a good idea to make that an ftrace-disable feature, not a general ring buffer disable feature.

Signature · 6 lines
David Smith
[email protected]
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
#3 lore raw
Quoted 7 lines · David Smith
Quoted 2 lines · Jon Masters

[thinking out loud] Does the global disable stuff also disable other non-tracing ring buffers?

I believe it does. If I'm correct, I think it would be a good idea to make that an ftrace-disable feature, not a general ring buffer disable feature.

We can do that when we get more users of the ring buffer and we find it makes sense.

-- Steve

#4 lore raw
Quoted 11 lines · Steven Rostedt
Quoted 6 lines · David Smith
Quoted 2 lines · Jon Masters

[thinking out loud] Does the global disable stuff also disable other non-tracing ring buffers?

I believe it does. If I'm correct, I think it would be a good idea to make that an ftrace-disable feature, not a general ring buffer disable feature.

We can do that when we get more users of the ring buffer and we find it makes sense.

It appears that oprofile is already using the ring buffer. With Jon's stuff as a 2nd non-ftrace-user, doesn't it make sense now?

Signature · 6 lines
David Smith
[email protected]
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
#5 lore raw
Quoted 10 lines · David Smith
Quoted 9 lines · Steven Rostedt
Quoted 6 lines · David Smith
Quoted 2 lines · Jon Masters

[thinking out loud] Does the global disable stuff also disable other non-tracing ring buffers?

I believe it does. If I'm correct, I think it would be a good idea to make that an ftrace-disable feature, not a general ring buffer disable feature.

Quoted 5 lines
Quoted 2 lines

We can do that when we get more users of the ring buffer and we find it makes sense.

It appears that oprofile is already using the ring buffer. With Jon's stuff as a 2nd non-ftrace-user, doesn't it make sense now?

I guess it might also be something that we want to consider too. That is, the "tracing_off" is a nice feature for all users of the ring buffer. Once can stop and start the oprofiler buffer via the user interface "tracing_on" as well. Is this something that would also be useful? If we make it "ftrace only" then oprofile loses this feature.

Now we could make a file for every registered user of the ring buffer. Well, not every registered user, but have the user register their own "tracing_on" file.

-- Steve