Bug #228
closedSubbuffer sizes and powers of 2
Added by Matthew Khouzam over 12 years ago. Updated over 11 years ago.
0%
Description
A subbuffer should be able to take any value, it is unreasonable to ask a user in userland to memorize the powers of 2 greater than 16.
A good compromise would be to cause lttng tool to create subbuffers that are rounded up to the nearest power of 2. I can personnaly garanty that a user asking for 1000000 bytes per subbuffer will not be outraged if the buffer is in reality 1024^2.
Another useful thing would be to have human friendly input like 4k 16k 1m 2g...
Files
0001-Make-subbufer-size-always-take-next-power-of-2-for-a.patch (1.44 KB) 0001-Make-subbufer-size-always-take-next-power-of-2-for-a.patch | patch | Matthew Khouzam, 09/21/2012 04:11 PM |
Updated by Mathieu Desnoyers over 12 years ago
- bugs@lttng.org (bugs@lttng.org) wrote:
Issue #228 has been reported by Matthew Khouzam.
----------------------------------------
Bug #228: Subbuffer sizes and powers of 2
https://bugs.lttng.org/issues/228Author: Matthew Khouzam
Status: New
Priority: Normal
Assignee:
Category:
Target version:A subbuffer should be able to take any value, it is unreasonable to ask a user in userland to memorize the powers of 2 greater than 16.
A good compromise would be to cause lttng tool to create subbuffers that are rounded up to the nearest power of 2. I can personnaly garanty that a user asking for 1000000 bytes per subbuffer will not be outraged if the buffer is in reality 1024^2.
Another useful thing would be to have human friendly input like 4k 16k 1m 2g...
Agreed, this should be done in lttng cmd line tool. Patch is welcome,
Thanks,
Mathieu
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.lttng.org/my/account
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
Updated by Yannick Brosseau about 12 years ago
- Target version deleted (
2.1 pre)
It might also be an helper function (in the lib) that do the round up
-- edited to add (in the lib)
Updated by Matthew Khouzam about 12 years ago
- File 0001-Make-subbufer-size-always-take-next-power-of-2-for-a.patch 0001-Make-subbufer-size-always-take-next-power-of-2-for-a.patch added
Would this work?
Updated by Mathieu Desnoyers about 12 years ago
Please implement by pulling lttng-ust libringbuffer/backend_internal.h get_count_order() into lttng-tools. This code is already tested, and FWIW more efficient than the patch you proposed. Moreover, it follows the project coding style.
Thanks,
Mathieu
Updated by Matthew Khouzam about 12 years ago
That's a pretty cool function. What is a FLS? I can tell the lttng_ust_fls() function is more desirable for this than get_count_order since if we give ti a subbuffer of 2^n, we don't need to allocate 2^n+1... or do we?
Also, the only comments are "arch-agnostic implementation" event though that is great to know, I think we really need to know what is a fls even more and what get_count_order does.
Updated by Mathieu Desnoyers about 12 years ago
- bugs@lttng.org (bugs@lttng.org) wrote:
Issue #228 has been updated by Matthew Khouzam.
That's a pretty cool function. What is a FLS? I can tell the lttng_ust_fls() function is more desirable for this than get_count_order since if we give ti a subbuffer of 2^n, we don't need to allocate 2^n+1... or do we?
Also, the only comments are "arch-agnostic implementation" event though that is great to know, I think we really need to know what is a fls even more and what get_count_order does.
fls = find last bit set. There is a similar implementation in the Linux
kernel, so you can find its documentation there.
fls has corner-cases with the exact power values: it's not the semantic
we need. We want get_count_order. get_count_order, if given 2^n, returns
2^n, not 2^(n+1) like you assume.
Thanks,
Mathieu
----------------------------------------
Bug #228: Subbuffer sizes and powers of 2
https://bugs.lttng.org/issues/228#change-775Author: Matthew Khouzam
Status: New
Priority: Normal
Assignee:
Category:
Target version:A subbuffer should be able to take any value, it is unreasonable to ask a user in userland to memorize the powers of 2 greater than 16.
A good compromise would be to cause lttng tool to create subbuffers that are rounded up to the nearest power of 2. I can personnaly garanty that a user asking for 1000000 bytes per subbuffer will not be outraged if the buffer is in reality 1024^2.
Another useful thing would be to have human friendly input like 4k 16k 1m 2g...
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.lttng.org/my/account
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
Updated by David Goulet almost 12 years ago
- Status changed from New to Confirmed
- Target version set to 2.2
I'm +1 to adding a helper call in liblttng-ctl rather than hacking the values behind the user back.
Flagging this for 2.2. Anyone want to contribute, feel free! :)
Updated by Mathieu Desnoyers over 11 years ago
- Status changed from Confirmed to Resolved
commit 16068db5dda7041571a5520dc69c96af43b799a2 Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Date: Thu May 2 11:53:08 2013 -0400 Fix: check errors in lttng command argument values Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> commit 8ce58badbfbff17e050194e01a9120ac6058bc1c Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Date: Thu May 2 11:33:46 2013 -0400 Implement get_count_order in lttng utils Imported from Userspace RCU rculfhash.c. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>