[meego-commits] 6063: Changes to Trunk:Testing/procps
Ameya Palande
ameya.palande at nokia.com
Wed Jul 28 16:31:09 UTC 2010
Hi,
I have made the following changes to procps in project Trunk:Testing. Please review and accept ASAP.
Thank You,
Ameya Palande
[This message was auto-generated]
---
Request #6063:
submit: home:apalande/procps(r2) -> Trunk:Testing/procps
Message:
Fix for "Unknown HZ value! (??) Assume 100." problem seen on Nokia N900
State: new 2010-07-28T04:24:16 apalande
Comment: None
changes files:
--------------
--- procps.changes
+++ procps.changes
@@ -0,0 +1,3 @@
+* Wed Jul 28 2010 Ameya Palande <ameya.palande at nokia.com> 3.2.8
+- Fix for "Unknown HZ value! (??) Assume 100." problem
+
new:
----
unknown-hz-value-fix.patch
spec files:
-----------
--- procps.spec
+++ procps.spec
@@ -85,6 +85,8 @@
Patch38: procps-3.2.7-free-hlmem.patch
# enable core dump generation
Patch39: procps-enable-core.patch
+# fix "Unknown HZ value! (??) Assume 100." issue
+Patch40: unknown-hz-value-fix.patch
BuildRequires: ncurses-devel
@@ -150,6 +152,7 @@
%patch37 -p1
%patch38 -p1
%patch39 -p1
+%patch40 -p1
cp %SOURCE1 .
other changes:
--------------
++++++ unknown-hz-value-fix.patch (new)
--- unknown-hz-value-fix.patch
+++ unknown-hz-value-fix.patch
+From 8e8a824533643de4a4a221358a8c5ae7d4e9e474 Mon Sep 17 00:00:00 2001
+From: Ameya Palande <ameya.palande at nokia.com>
+Date: Wed, 28 Jul 2010 14:41:24 +0300
+Subject: [PATCH] unknown hz value fix
+
+Fixes linux version detection. This relied on a side-effect of the elf loader
+and previously hoped that constructors would be called in a certain order.
+That behavior was undefined and hence unreliable. For newer kernels, an elf
+note is now checked to extract HZ tick count.
+
+Original author: <david.sugar at canonical.com>
+Backported to meego by: Ameya Palande <ameya.palande at nokia.com>
+---
+ proc/sysinfo.c | 1 +
+ proc/version.c | 5 ++---
+ proc/version.h | 1 +
+ 3 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/proc/sysinfo.c b/proc/sysinfo.c
+index 0ad7fba..793829f 100644
+--- a/proc/sysinfo.c
++++ b/proc/sysinfo.c
+@@ -212,6 +212,7 @@ static int check_for_privs(void){
+ static void init_libproc(void) __attribute__((constructor));
+ static void init_libproc(void){
+ have_privs = check_for_privs();
++ init_Linux_version(); // make sure we have version before continuing...
+ // ought to count CPUs in /proc/stat instead of relying
+ // on glibc, which foolishly tries to parse /proc/cpuinfo
+ //
+diff --git a/proc/version.c b/proc/version.c
+index 391b9bb..2049e15 100644
+--- a/proc/version.c
++++ b/proc/version.c
+@@ -35,11 +35,10 @@ void display_version(void) {
+
+ int linux_version_code;
+
+-static void init_Linux_version(void) __attribute__((constructor));
+-static void init_Linux_version(void) {
++void init_Linux_version(void) {
+ static struct utsname uts;
+ int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */
+-
++
+ if (uname(&uts) == -1) /* failure implies impending death */
+ exit(1);
+ if (sscanf(uts.release, "%d.%d.%d", &x, &y, &z) < 3)
+diff --git a/proc/version.h b/proc/version.h
+index 492d251..28c9b49 100644
+--- a/proc/version.h
++++ b/proc/version.h
+@@ -14,6 +14,7 @@
+
+ EXTERN_C_BEGIN
+
++extern void init_Linux_version(void); /* initialize linux version */
+ extern void display_version(void); /* display suite version */
+ extern const char procps_version[]; /* global buf for suite version */
+ extern const char procps_number_version[]; /* global buf for suite number version */
+--
+1.7.0.4
+
More information about the MeeGo-commits
mailing list