Remove extra S_MAXSTAT array allocation in some tools
authorBrenden Blanco <bblanco@gmail.com>
Wed, 16 Aug 2017 18:29:23 +0000 (11:29 -0700)
committerBrenden Blanco <bblanco@gmail.com>
Wed, 16 Aug 2017 18:29:23 +0000 (11:29 -0700)
Fixes: #1280
Signed-off-by: Brenden Blanco <bblanco@gmail.com>
tools/dcstat.py
tools/pidpersec.py
tools/vfsstat.py

index 202931e..c74c79b 100755 (executable)
@@ -49,7 +49,7 @@ enum stats {
     S_MAXSTAT
 };
 
-BPF_ARRAY(stats, u64, S_MAXSTAT + 1);
+BPF_ARRAY(stats, u64, S_MAXSTAT);
 
 /*
  * How this is instrumented, and how to interpret the statistics, is very much
index ddaaaa0..c449004 100755 (executable)
@@ -26,7 +26,7 @@ enum stat_types {
     S_MAXSTAT
 };
 
-BPF_ARRAY(stats, u64, S_MAXSTAT + 1);
+BPF_ARRAY(stats, u64, S_MAXSTAT);
 
 static void stats_increment(int key) {
     u64 *leaf = stats.lookup(&key);
index 208e61a..1764c60 100755 (executable)
@@ -49,7 +49,7 @@ enum stat_types {
     S_MAXSTAT
 };
 
-BPF_ARRAY(stats, u64, S_MAXSTAT + 1);
+BPF_ARRAY(stats, u64, S_MAXSTAT);
 
 static void stats_increment(int key) {
     u64 *leaf = stats.lookup(&key);