From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,8d19b0ca61712c07,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 1993-01-28 15:47:19 PST Newsgroups: comp.os.linux.announce Path: 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 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