Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 218096 Details for
Bug 303120
sys-process/procps: fix "Unknown HZ value!" on some machines
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch from debian (30_sysinfo_7numbers.dpatch)
30_sysinfo_7numbers.dpatch (text/plain), 2.20 KB, created by
Alexander Holler
on 2010-02-01 17:18:56 UTC
(
hide
)
Description:
patch from debian (30_sysinfo_7numbers.dpatch)
Filename:
MIME Type:
Creator:
Alexander Holler
Created:
2010-02-01 17:18:56 UTC
Size:
2.20 KB
patch
obsolete
>#! /bin/sh /usr/share/dpatch/dpatch-run >## 30_sysctl_7numbers.dpatch by <csmall@debian.org> >## >## All lines beginning with `## DP:' are a description of the patch. >## DP: Adds up 7 cpu numbers not 4; #460331 > >@DPATCH@ >diff -urNad procps-3.2.7~/proc/sysinfo.c procps-3.2.7/proc/sysinfo.c >--- procps-3.2.7~/proc/sysinfo.c 2008-08-10 00:22:04.000000000 +1000 >+++ procps-3.2.7/proc/sysinfo.c 2008-08-10 00:22:17.000000000 +1000 >@@ -122,24 +122,25 @@ > unsigned long long Hertz; > > static void old_Hertz_hack(void){ >- unsigned long long user_j, nice_j, sys_j, other_j; /* jiffies (clock ticks) */ >+ unsigned long long user_j, nice_j, sys_j, other_j, wait_j, hirq_j, sirq_j, stol_j; /* jiffies (clock ticks) */ > double up_1, up_2, seconds; > unsigned long long jiffies; > unsigned h; > char *restrict savelocale; > >+ wait_j = hirq_j = sirq_j = stol_j = 0; > savelocale = setlocale(LC_NUMERIC, NULL); > setlocale(LC_NUMERIC, "C"); > do{ > FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_1); > /* uptime(&up_1, NULL); */ > FILE_TO_BUF(STAT_FILE,stat_fd); >- sscanf(buf, "cpu %Lu %Lu %Lu %Lu", &user_j, &nice_j, &sys_j, &other_j); >+ sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu", &user_j, &nice_j, &sys_j, &other_j, &wait_j, &hirq_j, &sirq_j, &stol_j); > FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_2); > /* uptime(&up_2, NULL); */ > } while((long long)( (up_2-up_1)*1000.0/up_1 )); /* want under 0.1% error */ > setlocale(LC_NUMERIC, savelocale); >- jiffies = user_j + nice_j + sys_j + other_j; >+ jiffies = user_j + nice_j + sys_j + other_j + wait_j + hirq_j + sirq_j + stol_j ; > seconds = (up_1 + up_2) / 2; > h = (unsigned)( (double)jiffies/seconds/smp_num_cpus ); > /* actual values used by 2.4 kernels: 32 64 100 128 1000 1024 1200 */ >@@ -218,12 +219,13 @@ > // _SC_NPROCESSORS_ONLN returns 1, which should work OK > smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN); > if(smp_num_cpus<1) smp_num_cpus=1; /* SPARC glibc is buggy */ >- >+#ifdef __linux__ > if(linux_version_code > LINUX_VERSION(2, 4, 0)){ > Hertz = find_elf_note(AT_CLKTCK); > if(Hertz!=NOTE_NOT_FOUND) return; > fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr); > } >+#endif > old_Hertz_hack(); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 303120
: 218096 |
218098
|
252457
|
254257
|
254687
|
254689
|
261747