Hello community,
here is the log from the commit of package procinfo
checked in at Mon Apr 28 16:22:53 CEST 2008.
--------
--- procinfo/procinfo.changes 2008-04-25 19:20:26.000000000 +0200
+++ /mounts/work_src_done/STABLE/procinfo/procinfo.changes 2008-04-28 15:54:10.270092000 +0200
@@ -1,0 +2,5 @@
+Mon Apr 28 15:56:24 CEST 2008 - werner@suse.de
+
+- Use smaller buffer to parse long "intr" line from /proc/stat
+
+-------------------------------------------------------------------
Old:
----
procinfo-msi-edge.dif
New:
----
procinfo-gcc.dif
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ procinfo.spec ++++++
--- /var/tmp/diff_new_pack.m25034/_old 2008-04-28 16:22:34.000000000 +0200
+++ /var/tmp/diff_new_pack.m25034/_new 2008-04-28 16:22:34.000000000 +0200
@@ -18,7 +18,7 @@
Group: System/Monitoring
AutoReqProv: on
Version: 18
-Release: 161
+Release: 163
Summary: Display System Status Gathered from /proc
Provides: ps:/usr/bin/lsdev
Source: ftp://ftp.cistron.nl/pub/people/svm/%{name}-%{version}.tar.bz2
@@ -34,7 +34,7 @@
Patch9: procinfo-socklist.dif
Patch10: procinfo-float.dif
Patch11: procinfo-intr.dif
-Patch12: procinfo-msi-edge.dif
+Patch12: procinfo-gcc.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -86,6 +86,8 @@
%{_mandir}/man8/socklist.8*
%changelog
+* Mon Apr 28 2008 werner@suse.de
+- Use smaller buffer to parse long "intr" line from /proc/stat
* Fri Apr 25 2008 werner@suse.de
- Fix parsing strange gcc line within /proc/version (bnc#383721)
- Expand line buffer to fetch more the 4000 interrupts (bnc#383721)
++++++ procinfo-gcc.dif ++++++
--- routines.c
+++ routines.c 2008-04-25 19:18:18.282206402 +0200
@@ -269,6 +269,11 @@ make_version (FILE * versionfp)
fseek (versionfp, 0L, SEEK_SET);
fgets (line, sizeof (line), versionfp);
+ there = line;
+ while ((here = strchr(there, '[')))
+ if ((there = strchr(here, ']')))
+ memset(here, ' ', there-here+1);
+
ret = sscanf (line, "Linux version %s (%[^)]) (gcc %[^)]) #%s %[^\n]",
ver, host, gcc, compno, date);
@@ -277,6 +282,8 @@ make_version (FILE * versionfp)
ver, host, gcc, compno, date);
if (ret != 5) /* Maybe even one layer more */
ret = sscanf (line, "Linux version %s (%[^)]) (gcc %[^(] (%*[^)]) (%*[^)])) #%s %[^\n]", ver, host, gcc, compno, date);
+ if (ret != 5) /* Oogh */
+ ret = sscanf (line, "Linux version %s (%[^)]) (gcc %[^(] (%*[^)]) (%*[^)])%*[ ]) #%s %[^\n]", ver, host, gcc, compno, date);
if (ret == 3) { /* At least we've got ver & host right... */
strcpy (gcc, "[can't parse]");
++++++ procinfo-intr.dif ++++++
--- /var/tmp/diff_new_pack.m25034/_old 2008-04-28 16:22:34.000000000 +0200
+++ /var/tmp/diff_new_pack.m25034/_new 2008-04-28 16:22:34.000000000 +0200
@@ -1,5 +1,5 @@
--- procinfo.c
-+++ procinfo.c 2007-10-23 16:11:24.911583588 +0200
++++ procinfo.c 2008-04-28 15:40:20.000000000 +0200
@@ -19,6 +19,9 @@
static char *rcsid __attribute__ ((unused)) = "$Id: procinfo.c,v 1.56 2001/02/25 11:29:13 svm Exp svm $";
@@ -10,7 +10,72 @@
#include
#include
#include
-@@ -543,66 +546,72 @@ first_page (long sl)
+@@ -328,6 +331,8 @@ first_page (long sl)
+ new.cpu_iowait = VAL;
+ new.cpu_hirq = VAL;
+ new.cpu_sirq = VAL;
++ new.cpu_steal = VAL;
++ new.cpu_guest = VAL;
+ /*
+ * according to bug #1959, sometimes the cpu_idle
+ * seems to go backwards(!) on SMP boxes. This may
+@@ -412,11 +417,34 @@ first_page (long sl)
+ new.swout = VAL;
+ } else if (ISSTR ("intr")) {
+ if (nr_irqs) {
++ size_t len = strlen(&line[5]);
++ char *tok, *lp = &line[5+len-1];
++
+ VAL; /* First value is total of all interrupts,
+ for compatibility with rpc.rstatd. We
+ ignore it. */
++
++ tok = (char*)0;
+ for (i = 0; i < nr_irqs; i++) {
+- new.intr[i] = VAL;
++ char * cp = strtok(tok, " ");
++ if (!cp)
++ break;
++ new.intr[i] = strtoul(cp, NULL, 10);
++ tok = (char*)0;
++
++ if (*lp != '\n') {
++ off_t off = cp - line + strlen(cp) + 1;
++ if (off + sizeof(line)/4 > sizeof(line)) {
++ size_t rest = strlen(&line[off]);
++ memmove((tok = &line[0]), &line[off], rest+1);
++ if (!fgets(&line[rest], sizeof(line) - rest, statfp)) {
++ *lp = '\n';
++ continue;
++ }
++ len = strlen(&line[rest]);
++ lp = &line[rest+len-1];
++ }
++ }
+ }
+ } else
+ new.old_intr = VAL;
+@@ -535,6 +563,19 @@ first_page (long sl)
+ else
+ putchar ('\n');
+
++ if (havetwosix) {
++ if (new.cpu_steal) {
++ printf ("steal : %s %s",
++ hms (bDIFF (cpu_steal)), perc (bDIFF (cpu_steal), elapsed, nr_cpus));
++ putchar ('\n');
++ }
++ if (new.cpu_guest) {
++ printf ("guest : %s %s",
++ hms (bDIFF (cpu_guest)), perc (bDIFF (cpu_guest), elapsed, nr_cpus));
++ putchar ('\n');
++ }
++ }
++
+ printf ("uptime: %s context :%11lu", hms (new.uptime),
+ bDIFF (ctxt));
+ if (new.syscalls) /* If we have this, we can use the old interrupts spot. */
+@@ -543,66 +584,72 @@ first_page (long sl)
/****= /proc/interrupts =****/
if (nr_irqs) {
@@ -123,7 +188,7 @@
/**** /proc/dma ****/
if (dmafp) {
-@@ -612,18 +621,49 @@ first_page (long sl)
+@@ -612,18 +659,49 @@ first_page (long sl)
fseek (dmafp, 0L, SEEK_SET);
while (fgets (line, sizeof (line), dmafp)) {
@@ -181,7 +246,7 @@
}
}
}
-@@ -640,10 +680,11 @@ first_page (long sl)
+@@ -640,10 +718,11 @@ first_page (long sl)
} squirqs[nr_irqs];
for (i = 0; i < nr_irqs; i++) {
@@ -195,7 +260,7 @@
howmany++;
}
}
-@@ -665,13 +706,15 @@ first_page (long sl)
+@@ -665,13 +744,15 @@ first_page (long sl)
}
}
} else {
@@ -216,7 +281,7 @@
}
} else
-@@ -834,7 +877,7 @@ int
+@@ -834,7 +915,7 @@ int
main (int ac, char **av)
{
long sl = 5000000L;
@@ -225,7 +290,7 @@
struct timeval then, now;
#ifndef DEBUG
char outbuf[4096];
-@@ -993,19 +1036,23 @@ main (int ac, char **av)
+@@ -993,19 +1074,23 @@ main (int ac, char **av)
version = make_version (versionfp);
/* See what the intr line in /proc/stat says. */
@@ -257,7 +322,7 @@
continue;
}
/* While we're at it, fill in booted. */
-@@ -1017,6 +1064,12 @@ main (int ac, char **av)
+@@ -1017,6 +1102,12 @@ main (int ac, char **av)
continue;
}
}
@@ -270,3 +335,14 @@
if (fs)
printf ("%s%s", cl, vi);
+--- procinfo.h
++++ procinfo.h 2008-04-28 13:14:11.000000000 +0200
+@@ -83,7 +83,7 @@ struct info
+ unsigned long uptime;
+ long m_to, m_us, m_fr, m_sh, m_bu, m_ca;
+ long s_to, s_us, s_fr;
+- unsigned long cpu_user, cpu_nice, cpu_sys, cpu_idle, cpu_iowait, cpu_hirq, cpu_sirq;
++ unsigned long cpu_user, cpu_nice, cpu_sys, cpu_idle, cpu_iowait, cpu_hirq, cpu_sirq, cpu_steal, cpu_guest;
+ unsigned long disk[8];
+ unsigned long disk_r[8];
+ unsigned long disk_w[8];
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org