From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org, Gerald Schaefer <gerald.schaefer@de.ibm.com>
Subject: Re: [PATCH 2/4] lsmem: new tool
Date: Fri, 4 Nov 2016 13:10:06 +0100 [thread overview]
Message-ID: <20161104121006.GA4088@osiris> (raw)
In-Reply-To: <20161104103931.dvhnyuyjhb4ykyw7@ws.net.home>
On Fri, Nov 04, 2016 at 11:39:31AM +0100, Karel Zak wrote:
> > However it's of course fine with me to make the summary lines optional.
>
> I have added --summary[=never,always,only]
>
> never - disable summary lines at all (forced for parsable outputs)
> always - default for standard output
> only - prints only summary, no table with blocks, default when
> --summary specified without argument
>
> > Also fine with me :) Thank you for taking care of this!
>
> https://github.com/karelzak/util-linux/tree/mem-tools
>
> This branch contains the new lsmem; the next week I'll cleanup chmem
> and merge it to the master branch (after v2.29 release, probably
> Monday).
Looks all good to me. Just two comments:
- you changed the alignment of nearly all columns from left to right,
except for STATE and RANGE. For RANGE it does make sense to keep it aligned
to the left, however for STATE it looks a bit inconsistent. Not sure if you
missed to make it also align to the right?
- the updated man page now says that the default output is subject to
change; but it should not change in order to be compatible with the old
lsmem tool within s390-tools.
Also you might consider applying the simple patch below ;)
>From 270714b84caae0977e12afd7f59f88e051463e66 Mon Sep 17 00:00:00 2001
From: Heiko Carstens <heiko.carstens@de.ibm.com>
Date: Fri, 4 Nov 2016 12:56:08 +0100
Subject: [PATCH] lsmem: improve node lookup
Break the loop as soon as we found the node a memory block belongs to,
it doesn't make sense to continue scanning.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
sys-utils/lsmem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c
index 1dcf8a8e405d..10afc3cb6c8c 100644
--- a/sys-utils/lsmem.c
+++ b/sys-utils/lsmem.c
@@ -265,6 +265,7 @@ static int memory_block_get_node(char *name)
if (!isdigit_string(de->d_name + 4))
continue;
node = strtol(de->d_name + 4, NULL, 10);
+ break;
}
closedir(dir);
return node;
--
2.8.4
next prev parent reply other threads:[~2016-11-04 12:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 12:00 [PATCH 0/4] New tools lsmem and chmem Heiko Carstens
2016-10-12 12:00 ` [PATCH 1/4] lib,strutils: add strtoux[16|32|64]_or_err functions Heiko Carstens
2016-10-12 12:00 ` [PATCH 2/4] lsmem: new tool Heiko Carstens
2016-11-03 12:00 ` Karel Zak
2016-11-03 16:19 ` Heiko Carstens
2016-11-04 10:39 ` Karel Zak
2016-11-04 12:10 ` Heiko Carstens [this message]
2016-11-09 9:16 ` Karel Zak
2016-10-12 12:00 ` [PATCH 3/4] chmem: " Heiko Carstens
2016-10-19 10:40 ` Heiko Carstens
2016-10-12 12:00 ` [PATCH 4/4] lsmem: add testcase Heiko Carstens
2016-10-19 9:38 ` [PATCH 0/4] New tools lsmem and chmem Karel Zak
2016-10-19 9:59 ` Heiko Carstens
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=20161104121006.GA4088@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=gerald.schaefer@de.ibm.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/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