diff options
author | Keith M Wesolowski <wesolows@foobazco.org> | 2013-04-11 22:37:31 +0000 |
---|---|---|
committer | Keith M Wesolowski <wesolows@foobazco.org> | 2013-04-11 22:37:33 +0000 |
commit | e0c12bce3343ccf3df12bc18a16d28410c9c13bf (patch) | |
tree | 83a135472ab54c44b355c1ce9a43ac66a0e8da95 | |
parent | 19aa17c54664f87374b494c7795457e9bd48e81a (diff) | |
parent | 13e9820caebe8c029f40f741656ee17dbb2deaa4 (diff) | |
download | illumos-joyent-e0c12bce3343ccf3df12bc18a16d28410c9c13bf.tar.gz |
[illumos-gate merge]
commit 13e9820caebe8c029f40f741656ee17dbb2deaa4
3668 add "%H" to mdb_printf() for human-readable sizes (fix kmdb)
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_io.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_io.c b/usr/src/cmd/mdb/common/mdb/mdb_io.c index 970de77540..8b4f1aaaef 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_io.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_io.c @@ -877,12 +877,17 @@ iob_addr2str(uintptr_t addr) * Produce human-readable size, similar in spirit (and identical in output) * to libzfs's zfs_nicenum() -- but made significantly more complicated by * the constraint that we cannot use snprintf() as an implementation detail. + * Recall, floating point is verboten in kmdb. */ static const char * iob_bytes2str(varglist_t *ap, intsize_t size) { +#ifndef _KMDB const int sigfig = 3; - uint64_t n, orig; + uint64_t orig; +#endif + uint64_t n; + static char buf[68], *c; int index = 0; char u; @@ -903,7 +908,9 @@ iob_bytes2str(varglist_t *ap, intsize_t size) n = (uint_t)VA_ARG(ap, uint_t); } +#ifndef _KMDB orig = n; +#endif while (n >= 1024) { n /= 1024; |