summaryrefslogtreecommitdiff
path: root/zoneinfodict
diff options
context:
space:
mode:
Diffstat (limited to 'zoneinfodict')
-rwxr-xr-xzoneinfodict19
1 files changed, 19 insertions, 0 deletions
diff --git a/zoneinfodict b/zoneinfodict
new file mode 100755
index 0000000..60ebe41
--- /dev/null
+++ b/zoneinfodict
@@ -0,0 +1,19 @@
+#!/usr/bin/python2
+
+def dump():
+ node = None
+ zone = None
+ for line in open('/proc/zoneinfo'):
+ if line.startswith('Node '):
+ # Node N, zone Z
+ parts = line.split()
+ node = int(parts[1][0:-1])
+ zone = parts[3]
+ elif line.startswith(' nr_'):
+ # nr_something N
+ parts = line.split()
+ key = parts[0]
+ val = int(parts[1])
+ print('%d_%s_%s %d' % (node, zone, key, val))
+
+dump()