Article View: comp.os.linux.announce
Article #1270.99pl4 kernel patch for xsysinfo-1.1
From: Gabor Herr
Date: Thu, 28 Jan 1993 18:51
Date: Thu, 28 Jan 1993 18:51
77 lines
2836 bytes
2836 bytes
Hi,
the kernel patch included in the xsysinfo-1.1 archive doesn't work with
the new 0.99pl4 release of the Linux kernel. So here is a modified
patch relative to pl4.
I hope Linus will add these changes to the next kernel release, so
this patch will not be necessary in the future.
Gabor
diff -cr old/linux/fs/proc/array.c linux/fs/proc/array.c
*** old/linux/fs/proc/array.c Tue Jan 26 23:07:32 1993
--- linux/fs/proc/array.c Tue Jan 26 22:28:23 1993
***************
*** 46,51 ****
--- 46,62 ----
return sprintf(buffer,"%d\n",(jiffies+jiffies_offset)/HZ);
}
+ /*
+ * the (absolute) idle time is the processing time of task 0, the unswappable
+ * idle task. The current ticks value is also returned, so the relative
+ * idle time can easily computed with two succesive reads of /proc/idle.
+ */
+ static int get_idle(char * buffer)
+ {
+ return sprintf(buffer,"%d %d\n",
+ task[0]->utime + task[0]->stime, jiffies + jiffies_offset);
+ }
+
static int get_meminfo(char * buffer)
{
struct sysinfo i;
***************
*** 306,311 ****
--- 317,325 ----
break;
case 6:
length = get_version(page);
+ break;
+ case 8:
+ length = get_idle(page);
break;
case 9:
length = get_env(pid, page);
diff -cr old/linux/fs/proc/root.c linux/fs/proc/root.c
*** old/linux/fs/proc/root.c Tue Jan 26 23:07:32 1993
--- linux/fs/proc/root.c Tue Jan 26 22:28:23 1993
***************
*** 57,63 ****
{ 4,7,"meminfo" },
{ 5,4,"kmsg" },
{ 6,7,"version" },
! { 7,4,"self" } /* will change inode # */
};
#define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
--- 57,64 ----
{ 4,7,"meminfo" },
{ 5,4,"kmsg" },
{ 6,7,"version" },
! { 7,4,"self" }, /* will change inode # */
! { 8,4,"idle" }
};
#define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
--
############################################################################
Gabor Herr Email: herr@iti.informatik.th-darmstadt.de
Computer Science Department
Technical University of Darmstadt, Germany
--
Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
Technical Details
Message-ID:
<1993Jan28.185138.15471@tc.cornell.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.eng.gtefsd.com!emory!gatech!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!uwm.edu!caen!batcomputer!theory.TC.Cornell.EDU!mdwShow Full Headers
Complete Article Headers
Newsgroups: comp.os.linux.announce Path: arc1-ca.pugleaf.net!sparky!uunet!europa.eng.gtefsd.com!emory!gatech!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!uwm.edu!caen!batcomputer!theory.TC.Cornell.EDU!mdw From: herr@iti.informatik.th-darmstadt.de (Gabor Herr) Subject: 0.99pl4 kernel patch for xsysinfo-1.1 Message-ID: <1993Jan28.185138.15471@tc.cornell.edu> Originator: mdw@theory.TC.Cornell.EDU Keywords: xsysinfo kernel Sender: news@tc.cornell.edu Nntp-Posting-Host: theory.tc.cornell.edu Organization: TU Darmstadt Date: Thu, 28 Jan 1993 18:51:38 GMT Approved: linux-announce@tc.cornell.edu (Matt Welsh) Lines: 77