Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
crash
crash-sles9-time.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File crash-sles9-time.patch of Package crash
From: Alan Tyson <atyson@hp.com> Subject: [PATCH] Fix "uptime" and "ps -t" for SLES9 References: 352836 This patch adds a quirk for SLES9 jiffies initialisation and corrects the time data in "uptime" and "ps -t" command. Acked-by: Bernhard Walle <bwalle@suse.de> --- defs.h | 8 ++++++++ kernel.c | 9 ++++++++- task.c | 11 +++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) Index: crash-6.0.7/defs.h =================================================================== --- crash-6.0.7.orig/defs.h +++ crash-6.0.7/defs.h @@ -657,6 +657,7 @@ struct kernel_table { ulong p2m_missing; } pvops_xen; int highest_irq; + int is_suse_kernel; #define IKCONFIG_AVAIL 0x1 /* kernel contains ikconfig data */ #define IKCONFIG_LOADED 0x2 /* ikconfig data is currently loaded */ int ikconfig_flags; @@ -5357,6 +5358,13 @@ extern struct lkcd_environment *lkcd; #endif /* LKCD_COMMON */ + +/* + * SUSE specific + */ +#define is_SLES9() \ + ((THIS_KERNEL_VERSION == LINUX(2,6,5)) && kt->is_suse_kernel) + /* * gdb_interface.c */ Index: crash-6.0.7/kernel.c =================================================================== --- crash-6.0.7.orig/kernel.c +++ crash-6.0.7/kernel.c @@ -216,6 +216,12 @@ kernel_init() verify_version(); + /* + * check if we have a suse kernel (this is the module supported + * patch of agruen@suse.de + */ + kt->is_suse_kernel = symbol_exists("unsupported"); + if (symbol_exists("__per_cpu_offset")) { if (LKCD_KERNTYPES()) i = get_cpus_possible(); @@ -4271,7 +4277,7 @@ get_uptime(char *buf, ulonglong *j64p) if (symbol_exists("jiffies_64")) { get_symbol_data("jiffies_64", sizeof(ulonglong), &jiffies_64); - if (THIS_KERNEL_VERSION >= LINUX(2,6,0)) { + if (THIS_KERNEL_VERSION >= LINUX(2,6,0) && !is_SLES9()) { wrapped = (jiffies_64 & 0xffffffff00000000ULL); if (wrapped) { wrapped -= 0x100000000ULL; @@ -4805,6 +4811,7 @@ no_cpu_flags: fprintf(fp, " p2m_top: %lx\n", kt->pvops_xen.p2m_top); fprintf(fp, " p2m_top_entries: %d\n", kt->pvops_xen.p2m_top_entries); fprintf(fp, " p2m_missing: %lx\n", kt->pvops_xen.p2m_missing); + fprintf(fp, " is_suse_kernel: %ld\n", kt->is_suse_kernel); } /* Index: crash-6.0.7/task.c =================================================================== --- crash-6.0.7.orig/task.c +++ crash-6.0.7/task.c @@ -3554,6 +3554,12 @@ start_time_timespec(void) default: break; } + /* SLES9 stores start_time in nanoseconds, so set TIMESPEC in order */ + /* to do the right calculations in convert_start_time */ + if (is_SLES9()) { + tt->flags |= TIMESPEC; + return TRUE; + } tt->flags |= NO_TIMESPEC; @@ -3585,6 +3591,11 @@ convert_start_time(ulonglong start_time, ulong tmp1, tmp2; ulonglong wrapped; + /* SLES9's start_time is neither jiffies nor a timespec. It's ns */ + if (is_SLES9()) { + start_time = start_time / 1000000000; + } + switch(tt->flags & (TIMESPEC | NO_TIMESPEC)) { case TIMESPEC:
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor