From c78aa2c625df5ea36be5390aed99300bbaf0d0f3 Mon Sep 17 00:00:00 2001 From: fanyeren Date: Fri, 11 Dec 2015 13:56:24 +0800 Subject: [PATCH] lxc-top: limit BLKIO to 14 characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit limit BLKIO columns to 10 characters is too small,i think 14 is a better value Signed-off-by: feng xiahou xiahoufeng@yahoo.com --- src/lxc/lxc_top.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/lxc_top.c b/src/lxc/lxc_top.c index 3b2aa3e32..22093bb37 100644 --- a/src/lxc/lxc_top.c +++ b/src/lxc/lxc_top.c @@ -281,12 +281,12 @@ static void stats_get(struct lxc_container *c, struct ct *ct, struct stats *tota static void stats_print_header(struct stats *stats) { printf(TERMRVRS TERMBOLD); - printf("%-18s %12s %12s %12s %10s %10s", "Container", "CPU", "CPU", "CPU", "BlkIO", "Mem"); + printf("%-18s %12s %12s %12s %14s %10s", "Container", "CPU", "CPU", "CPU", "BlkIO", "Mem"); if (stats->kmem_used > 0) printf(" %10s", "KMem"); printf("\n"); - printf("%-18s %12s %12s %12s %10s %10s", "Name", "Used", "Sys", "User", "Total", "Used"); + printf("%-18s %12s %12s %12s %14s %10s", "Name", "Used", "Sys", "User", "Total", "Used"); if (stats->kmem_used > 0) printf(" %10s", "Used"); printf("\n"); @@ -303,7 +303,7 @@ static void stats_print(const char *name, const struct stats *stats, size_humanize(stats->blkio, blkio_str, sizeof(blkio_str)); size_humanize(stats->mem_used, mem_used_str, sizeof(mem_used_str)); - printf("%-18.18s %12.2f %12.2f %12.2f %10s %10s", + printf("%-18.18s %12.2f %12.2f %12.2f %14s %10s", name, (float)stats->cpu_use_nanos / 1000000000, (float)stats->cpu_use_sys / USER_HZ, -- 2.47.2