Skip to content
Snippets Groups Projects
Commit 81aa751d authored by lnx build's avatar lnx build Committed by Gerrit - the friendly Code Review server
Browse files

Merge "lrdp-v2: vmstat: Fix broken vm_stat for kernel 4.9" into opensource-tools.lnx.1.0-dev.1.0

parents 4852615c ab4934ec
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 # 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 # it under the terms of the GNU General Public License version 2 and
...@@ -62,7 +62,10 @@ class ZoneInfo(RamParser): ...@@ -62,7 +62,10 @@ class ZoneInfo(RamParser):
zone = zone + sizeofzone zone = zone + sizeofzone
print_out_str('\nGlobal Stats') 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): for i in xrange(0, max_zone_stats):
print_out_str('{0:30}: {1:8}'.format(vmstat_names[i], self.ramdump.read_word( 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)))) 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