Post

hotsanic 0.5.0-pre5 diskio patch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff -ur hotsanic-2.4/modules/diskio/platform/common.pm hotsanic-2.6/modules/diskio/platform/common.pm
--- hotsanic-2.4/modules/diskio/platform/common.pm      2004-02-27 10:23:49.000000000 +0100
+++ hotsanic-2.6/modules/diskio/platform/common.pm      2007-11-19 04:28:22.000000000 +0100
@@ -16,6 +16,7 @@
     my ($sysname, $nodename, $release, $version, $machine ) = uname;
     $MODARGS{KERNEL}="2.2" if $release =~ /^2\.[12]\./;
     $MODARGS{KERNEL}="2.4" if $release =~ /^2\.[34]\./;
+    $MODARGS{KERNEL}="2.6" if $release =~ /^2\.[56]\./;
     }
   return %MODARGS
   }
diff -ur hotsanic-2.4/modules/diskio/platform/linux.pm hotsanic-2.6/modules/diskio/platform/linux.pm
--- hotsanic-2.4/modules/diskio/platform/linux.pm       2004-02-29 16:29:36.000000000 +0100
+++ hotsanic-2.6/modules/diskio/platform/linux.pm       2007-11-20 03:40:58.000000000 +0100
@@ -23,6 +23,18 @@
       store_values($args{MODNAME},$num,$racc,$wacc,$rblk,$wblk,512);
       }
     }
+elsif ($args{KERNEL} eq "2.6") {
+ open FILE,"/proc/diskstats";
+ while ($entry = <FILE>) {
+ $entry =~ s/^\s*//; # strip leading whitespaces
+ my ($major,$minor,$aaaa,$racc,undef,$rsect,undef,$wacc,undef,$wsect)=split(/\s+/,$entry);
+ $device=$major."_".$minor;
+ my $sectsize=512;
+ store_values($args{MODNAME},$device,$racc,$wacc,$rsect,$wsect,$sectsize);
+ }
+ close FILE;
+ }
   elsif ($args{KERNEL} eq "2.2") {
   # disk 1494755 377215 221577 144318
   # disk_rio 564538 286941 151189 77490

센토스5.7 , 젠투 ( kernel 3.1.x ) 에서 검증되었습니다

This post is licensed under CC BY 4.0 by the author.

Trending Tags