From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Michael Holzheu <holzheu@de.ibm.com>
Cc: pavel@ucw.cz, Ingo Oeser <ioe-lkml@rameria.de>,
linux-kernel@vger.kernel.org, mschwid2@de.ibm.com
Subject: Re: How to document dimension units for virtual files?
Date: Wed, 8 Nov 2006 18:09:16 +0100 [thread overview]
Message-ID: <20061108170916.GA570@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20061108175412.3c2be30c.holzheu@de.ibm.com>
On Wed, 8 November 2006 17:54:12 +0100, Michael Holzheu wrote:
>
> What about the following ...
Awesome. The next time someone flames me over this subject, I can
simly refer to this file.
One could nitpick that a) this applies to any interface, so it also
includes kernel command line and module parameters and b) there are
existing interfaces that interpret "kb" as 2^10 bytes, etc. Maybe
this could be noted somehow, but it's not too important imho.
Acked-by: Joern Engel <joern@wh.fh-wedel.de>
>
> Documentation/filesystems/00-INDEX | 2 +
> Documentation/filesystems/ExportData | 47 +++++++++++++++++++++++++++++++++++
> 2 files changed, 49 insertions(+)
>
> diff -Naur linux-2.6.18/Documentation/filesystems/00-INDEX linux-2.6.18-exp-data-doc/Documentation/filesystems/00-INDEX
> --- linux-2.6.18/Documentation/filesystems/00-INDEX 2006-09-20 10:50:34.000000000 +0200
> +++ linux-2.6.18-exp-data-doc/Documentation/filesystems/00-INDEX 2006-11-08 17:45:31.000000000 +0100
> @@ -1,5 +1,7 @@
> 00-INDEX
> - this file (info on some of the filesystems supported by linux).
> +ExportData
> + - recommendation of how to export data via virtual File Systems.
> Exporting
> - explanation of how to make filesystems exportable.
> Locking
> diff -Naur linux-2.6.18/Documentation/filesystems/ExportData linux-2.6.18-exp-data-doc/Documentation/filesystems/ExportData
> --- linux-2.6.18/Documentation/filesystems/ExportData 1970-01-01 01:00:00.000000000 +0100
> +++ linux-2.6.18-exp-data-doc/Documentation/filesystems/ExportData 2006-11-08 17:44:59.000000000 +0100
> @@ -0,0 +1,47 @@
> +
> +Export data via virtual File Systems
> +====================================
> +
> +If you want to export data to userspace via virtual filesystems
> +like procfs, sysfs, debugfs etc., the following rules are recommended:
> +
> +- Export only one value in one virtual file.
> +- Data format should be as simple as possible.
> +- Use ASCII formated strings, no binary data if possible.
> +- If data has dimension units, encode that in the filename.
> +
> +Please use the following prefixes, when dimension units are required (According
> +to IEC 60027-2 and SI/International System of Units):
> +
> +Storage size (SI prefixes)
> +--------------------------
> +* kB: kilobyte (10^3 Byte)
> +* MB: megabyte (10^6 Byte)
> +* GB: gigabyte (10^9 Byte)
> +* TB: terabyte (10^12 Byte)
> +* PB: petabyte (10^15 Byte)
> +
> +Storage size (Binary prefixes)
> +------------------------------
> +* KiB: kibibyte (2^10 Byte)
> +* MiB: mebibyte (2^20 Byte)
> +* GiB: gibibyte (2^30 Byte)
> +* TiB: tebibyte (2^40 Byte)
> +* PiB: pebibyte (2^50 Byte)
> +
> +Time (SI pefixes)
> +-----------------
> +* s: Second
> +* ms: Millisecond (10^-3 Seconds)
> +* us: Microsecond (10^-6 Seconds)
> +* ns: Nanosecond (10^-9 Seconds)
> +
> +Examples:
> +---------
> +> ls /sys/kernel/debug/sysinfo
> +free_mem_KiB
> +online_time_ms
> +cpu_time_us
> +
> +> cat /sys/kernel/debug/free_mem_KiB
> +147536
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
Jörn
--
Courage is not the absence of fear, but rather the judgement that
something else is more important than fear.
-- Ambrose Redmoon
next prev parent reply other threads:[~2006-11-08 17:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-08 16:54 Michael Holzheu
2006-11-08 17:04 ` Randy Dunlap
2006-11-08 18:27 ` Michael Holzheu
2006-11-10 6:53 ` Greg KH
2006-11-10 10:03 ` Michael Holzheu
2006-11-13 17:16 ` Greg KH
2006-11-13 12:18 ` Pavel Machek
2006-11-13 17:46 ` Henrique de Moraes Holschuh
2006-11-14 8:50 ` Michael Holzheu
2006-11-08 17:09 ` Jörn Engel [this message]
2006-11-08 18:32 ` Michael Holzheu
2006-11-08 18:01 ` Henrique de Moraes Holschuh
2006-11-08 18:37 ` Michael Holzheu
2006-11-08 19:59 ` Henrique de Moraes Holschuh
2006-11-09 23:15 ` Pavel Machek
2006-11-10 13:18 ` Kyle Moffett
2006-11-10 15:41 ` Sanjoy Mahajan
2006-11-13 4:33 ` Kyle Moffett
-- strict thread matches above, loose matches on Subject: below --
2006-10-23 12:32 Michael Holzheu
2006-10-23 19:03 ` Ingo Oeser
2006-10-24 14:15 ` Michael Holzheu
2006-10-24 20:13 ` Arnd Bergmann
2006-10-28 18:40 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061108170916.GA570@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=holzheu@de.ibm.com \
--cc=ioe-lkml@rameria.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mschwid2@de.ibm.com \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®