[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:04256] Re: BP6買いました!



From: cyber205 <cyber205@d3.dion.ne.jp>
Subject: [plamo:04254] Re: BP6買いました!
Date: Sun, 31 Oct 1999 21:56:43 +0900
Message-ID: <19991031182402A.cyber205@d3.dion.ne.jp>

> でも、SMPを有効にした後の、「make -j 3 hogehoge」は凄かったです。
> まだカーネル再構築でしか試してませんが、かなりのスピードが出てますね。

実は、カーネル再構築ぐらいでしかそれだけの違いは出ません ;-)

# Linux のカーネルソースの場合、Makefile を工夫して並列処理を高めるよ
# うにしているみたいなので劇的に速くなるけど、そういう工夫をしていない
# ソースだとそれほど改善されません。

今年の春ごろ、Linux Seminar の席で Celeron Dual の話題をしゃべったこと
があり、その際の OHP が 

http://www.linet.gr.jp/~kojima/Linux-Seminar/0326/

あたりにありますので、ご興味があればご覧くださいませ。

> そういや、xosviewをDualに対応させるカーネルパッチ(/procを書き換えるらしい)、
> www-isia.cma.frの奴なんですが、リンクが切れてて結局入手できませんでした。

使えるかどうか知らないけど、手元にあったパッチを付けておきます。これで
どうなるか試してみてください。

> #BeOSみたいにCPU1とCPU2の負荷状況が別々のバーで
> #刻々と表示されるような奴が欲しかったんですけどねぇ…。

一応、手もとではそういう表示になっているけど、これには 2.2 カーネルが
必要なのだったかな?
diff -urN xosview-1.7.0/linux/btrymeter.cc xosview-1.7.0-fixbuf/linux/btrymeter.cc
--- xosview-1.7.0/linux/btrymeter.cc	Sat Jan 23 18:34:26 1999
+++ xosview-1.7.0-fixbuf/linux/btrymeter.cc	Tue Feb 23 23:22:30 1999
@@ -46,7 +46,7 @@
     return;
   }
 
-  char buff[256];
+  char buff[TMP_SIZE];
   loadinfo >> buff >> buff >> buff >> buff >> buff >> buff >> fields_[0];
 
   total_ = 100;
diff -urN xosview-1.7.0/linux/cpumeter.cc xosview-1.7.0-fixbuf/linux/cpumeter.cc
--- xosview-1.7.0/linux/cpumeter.cc	Sun Jan 31 20:18:49 1999
+++ xosview-1.7.0-fixbuf/linux/cpumeter.cc	Tue Feb 23 23:23:12 1999
@@ -49,7 +49,7 @@
 
 void CPUMeter::getcputime( void ){
   total_ = 0;
-  char tmp[256];
+  char tmp[TMP_SIZE];
   ifstream stats( STATFILENAME );
 
   if ( !stats ){
@@ -59,7 +59,7 @@
 
   // read until we are at the right line.
   for (int i = 0 ; i < _lineNum ; i++)
-    stats.getline(tmp, 256);
+    stats.getline(tmp, TMP_SIZE);
 
   stats >>tmp >>cputime_[cpuindex_][0]  
 	      >>cputime_[cpuindex_][1]  
@@ -87,9 +87,9 @@
   }
 
   int line = -1;
-  char buf[256];
+  char buf[TMP_SIZE];
   while (!stats.eof()){
-    stats.getline(buf, 256);
+    stats.getline(buf, TMP_SIZE);
     if (!stats.eof()){
       line++;
       if (!strncmp(cpuID, buf, strlen(cpuID)) && buf[strlen(cpuID)] == ' ')
@@ -112,9 +112,9 @@
   }
 
   int cpuCount = 0;
-  char buf[256];
+  char buf[TMP_SIZE];
   while (!stats.eof()){
-    stats.getline(buf, 256);
+    stats.getline(buf, TMP_SIZE);
     if (!stats.eof()){
       if (!strncmp(buf, "cpu", 3) && buf[3] != ' ')
           cpuCount++;
@@ -137,8 +137,8 @@
 }
 
 const char *CPUMeter::toUpper(const char *str){
-  static char buffer[256];
-  strncpy(buffer, str, 256);
+  static char buffer[TMP_SIZE];
+  strncpy(buffer, str, TMP_SIZE);
   for (char *tmp = buffer ; *tmp != '\0' ; tmp++)
     *tmp = toupper(*tmp);
 
diff -urN xosview-1.7.0/linux/memmeter.cc xosview-1.7.0-fixbuf/linux/memmeter.cc
--- xosview-1.7.0/linux/memmeter.cc	Sun Jan 31 20:18:49 1999
+++ xosview-1.7.0-fixbuf/linux/memmeter.cc	Tue Feb 23 23:24:17 1999
@@ -80,14 +80,14 @@
 
   LineInfo *rval = new LineInfo[len];
 
-  char buf[256];
-  istrstream line(buf, 256);
+  char buf[TMP_SIZE];
+  istrstream line(buf, TMP_SIZE);
 
   // Get the info from the "standard" meminfo file.
   int lineNum = 0;
   int inum = 0;  // which info are we going to insert
   while (!meminfo.eof()){
-    meminfo.getline(buf, 256);
+    meminfo.getline(buf, TMP_SIZE);
     line.seekg(0, ios::beg);
     lineNum++;
 
@@ -129,8 +129,8 @@
     exit(1);
   }
 
-  char buf[256];
-  istrstream line(buf, 256);
+  char buf[TMP_SIZE];
+  istrstream line(buf, TMP_SIZE);
 
   char ignore[256];
 
@@ -138,7 +138,7 @@
   int lineNum = 0;
   int inum = 0;
   while (!meminfo.eof()){
-    meminfo.getline(buf, 256);
+    meminfo.getline(buf, TMP_SIZE);
     lineNum++;
 
     if (lineNum != infos[inum].line())
diff -urN xosview-1.7.0/linux/swapmeter.cc xosview-1.7.0-fixbuf/linux/swapmeter.cc
--- xosview-1.7.0/linux/swapmeter.cc	Sun Jan 31 20:18:49 1999
+++ xosview-1.7.0-fixbuf/linux/swapmeter.cc	Tue Feb 23 23:24:59 1999
@@ -84,13 +84,13 @@
 
   total_ = fields_[0] = fields_[1] = 0;
 
-  char buf[256];
+  char buf[TMP_SIZE];
   char ignore[256];
 
   // Get the info from the "standard" meminfo file.
   while (!meminfo.eof()){
-    meminfo.getline(buf, 256);
-    istrstream line(buf, 256);
+    meminfo.getline(buf, TMP_SIZE);
+    istrstream line(buf, TMP_SIZE);
 
     if(!strncmp("SwapTotal", buf, strlen("SwapTotal")))
         line >> ignore >> total_;
diff -urN xosview-1.7.0/xosview.h xosview-1.7.0-fixbuf/xosview.h
--- xosview-1.7.0/xosview.h	Sat Jan 23 18:34:26 1999
+++ xosview-1.7.0-fixbuf/xosview.h	Tue Feb 23 23:21:51 1999
@@ -14,6 +14,8 @@
 #include "xwin.h"
 #include "Xrm.h"  //  For Xrm resource manager class.
 
+// temporary area size
+#define TMP_SIZE 4096
 
 /*  Take at most n samples per second (default of 10)  */
 extern double MAX_SAMPLES_PER_SECOND;

References
[plamo:04213] Re: BP6買いました!, Shigeo Sagai
[plamo:04254] Re: BP6買いました!, cyber205

[検索ページ] [メール一覧]
Plamo ML 公開システム