[Crash-utility] [PATCH] Fix for "kmem -z" on Linux 5.0

Kazuhito Hagio k-hagio at ab.jp.nec.com
Thu Mar 7 17:56:03 UTC 2019


Fix for the "kmem -z" command on Linux 5.0 and later kernels that
contain commit a921444382b49cc7fdeca3fba3e278bc09484a27, titled
"mm: move zone watermark accesses behind an accessor". Without the
patch, the command fails with the following error message.

kmem: invalid (optional) structure member offsets: zone_pages_min or zone_struct_pages_min
      FILE: memory.c  LINE: 16457  FUNCTION: dump_zone_stats()

Signed-off-by: Kazuhito Hagio <k-hagio at ab.jp.nec.com>
---
 memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/memory.c b/memory.c
index 8cdab06..9c1019a 100644
--- a/memory.c
+++ b/memory.c
@@ -1095,6 +1095,9 @@ vm_init(void)
                                 "zone", "pages_high");
                         MEMBER_OFFSET_INIT(zone_watermark,
                                 "zone", "watermark");
+                        if (INVALID_MEMBER(zone_watermark))
+                                MEMBER_OFFSET_INIT(zone_watermark,
+                                        "zone", "_watermark");
                         MEMBER_OFFSET_INIT(zone_nr_active,
                                 "zone", "nr_active");
                         MEMBER_OFFSET_INIT(zone_nr_inactive,
-- 
1.8.3.1




More information about the Crash-utility mailing list