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 202931e170eb079f45cbd97d19bfb7eca8e9464f..c74c79b5c7c931de5daf4f3b927e62e95e761a24 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 ddaaaa0a2de75c7d7e009a6c2ed2fd194431bad6..c4490043a59dfe395b663616d9bc5423018a545e 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 208e61a6616a618cc9986412be0641b88952ee67..1764c6012f383073eb87eafc882ce70bbd23ffe0 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);