From 0e86bc8406959d0d56194d4f404b780e6b70caa4 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 19 Mar 2019 13:47:11 +0100 Subject: lscpu: add --caches $ lscpu -C NAME ONE-SIZE ALL-SIZE WAYS TYPE LEVEL L3 8M 8M 16 Unified 3 L2 256K 1M 8 Unified 2 L1i 32K 128K 8 Instruction 1 L1d 32K 128K 8 Data 1 The patch also updates extra caches (s390) output in lsblk summary to be compatible with output about normal caches. Addresses: https://github.com/karelzak/util-linux/issues/663 Signed-off-by: Karel Zak --- sys-utils/lscpu.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys-utils/lscpu.h') diff --git a/sys-utils/lscpu.h b/sys-utils/lscpu.h index a8311b33d..36c7e41aa 100644 --- a/sys-utils/lscpu.h +++ b/sys-utils/lscpu.h @@ -48,7 +48,10 @@ enum { /* cache(s) description */ struct cpu_cache { char *name; - char *size; + char *type; + int level; + int ways; + uint64_t size; int nsharedmaps; cpu_set_t **sharedmaps; @@ -171,6 +174,7 @@ enum { OUTPUT_SUMMARY = 0, /* default */ OUTPUT_PARSABLE, /* -p */ OUTPUT_READABLE, /* -e */ + OUTPUT_CACHES /* -C */ }; enum { @@ -186,6 +190,7 @@ struct lscpu_modifier { online:1, /* print online CPUs */ offline:1, /* print offline CPUs */ json:1, /* JSON output format */ + bytes:1, /* output sizes in bytes */ physical:1; /* use physical numbers */ }; -- cgit v1.2.3-55-g7522