[lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size

Raphaël Beamonte raphael.beamonte at polymtl.ca
Wed Apr 3 19:13:51 EDT 2013

2013/4/3 Simon Marchi <simon.marchi at polymtl.ca>

> >    Normally I'd be the first to advocate k, M, G as powers of 10 and Ki,
> Mi, Gi as powers of two (ISO/IEC 80000-13:2008) but the kernel parameters
> use exclusively K, M, and G in the powers of two sense, and I believe just
> about every other part of Linux does also.  We should thus, somewhat
> unfortunately, stick to powers of two.  Just be sure to explicitly give the
> multipliers' values in the help.  Oh, and accept just the upper-case
> letters, like the kernel parameters do.
> Yeah.. we need to accept capital K for kilo (kibi) because everyone
> else does. Actually I was thinking of mimicking the behaviour of dd.
> For kilo (kibi), you can use upper and lower case (probably reeks of
> when there was no such things as lower case letters in computing. I
> look at you FORTRAN). But for mega (mibi) and giga (gibi), it's upper
> case only.
> The more I think about it, the more I think it doesn't matter if we
> accept upper and lower case for all... I don't know anybody who will
> request a buffer of 32 millibytes.

I guess we could follow the "dd" way of work :
BLOCKS and BYTES may be followed by the following multiplicative suffixes:
c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M
GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20130403/a2a94b88/attachment.html>

More information about the lttng-dev mailing list