Skip to content
Snippets Groups Projects
Commit ab4934ec authored by Sudarshan Rajagopalan's avatar Sudarshan Rajagopalan Committed by Gerrit - the friendly Code Review server
Browse files

lrdp-v2: vmstat: Fix broken vm_stat for kernel 4.9

Global variable name 'vm_stat' is changed in newer kernel
versions. Use the appropriate variable name depending on
the kernel version being used.

Change-Id: Ia36735bc22c1165ee2736ac39bf93fb2e4a86d0f
parent 561974c9
No related branches found
No related tags found
No related merge requests found
# Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
# Copyright (c) 2013-2015, 2017 The Linux Foundation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 and
......@@ -62,7 +62,10 @@ class ZoneInfo(RamParser):
zone = zone + sizeofzone
print_out_str('\nGlobal Stats')
vmstats_addr = self.ramdump.address_of('vm_stat')
if self.ramdump.kernel_version < (4,9,0):
vmstats_addr = self.ramdump.address_of('vm_stat')
else:
vmstats_addr = self.ramdump.address_of('vm_zone_stat')
for i in xrange(0, max_zone_stats):
print_out_str('{0:30}: {1:8}'.format(vmstat_names[i], self.ramdump.read_word(
self.ramdump.array_index(vmstats_addr, 'atomic_long_t', i))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment