FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 11-27-2008, 06:09 PM
Andy Whitcroft
 
Default UBUNTU: expose that this is an Ubuntu kernel in oops/panic messages

In order to make it simpler for kerneloops to know it is dealing with
an Ubuntu modified kernel we have been requested to modify our version
strings to contain an Ubuntu marker. This changing out version string
will move our modules about and trigger all sorts of pain for our
packaging.

This patch proposes an alternative method of marking these oopses as
Ubuntu related. All oopses which contain the kernel release string also
contain the first word of the UTS_VERSION string, which is typically
the build number:

#define UTS_VERSION "#0 SMP Thu Nov 27 15:54:55 GMT 2008"

Note the #1 on the second line here:

WARNING: at /tmp/oops.c:5 modinit() (Not tainted)
Pid: 8190, comm: insmod Not tainted 2.6.24-0.77.rc4.git4.fc9 #1
[<c040649a>] show_trace_log_lvl+0x1a/0x2f

It would be possible to augment this build number to include some kind
of suffix to indicate that this was an Ubuntu build and have that
included in these panic strings:

#define UTS_VERSION "#0-UB SMP Thu Nov 27 15:54:55 GMT 2008"

Something like this (hand crafted):

WARNING: at /tmp/oops.c:5 modinit() (Not tainted)
Pid: 8190, comm: insmod Not tainted 2.6.24-0.77.rc4.git4.fc9 #1-UB
[<c040649a>] show_trace_log_lvl+0x1a/0x2f

As far as I can tell this value is not used anywhere else in our build
system so changing it in this way should be relativly benign.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
scripts/mkcompile_h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index a8740df..f52f8c5 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -39,7 +39,7 @@ else
TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
fi

-UTS_VERSION="#$VERSION"
+UTS_VERSION="#$VERSION-UB"
CONFIG_FLAGS=""
if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
--
1.6.0.4.911.gc990


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 11-27-2008, 06:09 PM
Andy Whitcroft
 
Default UBUNTU: expose that this is an Ubuntu kernel in oops/panic messages

In order to make it simpler for kerneloops to know it is dealing with
an Ubuntu modified kernel we have been requested to modify our version
strings to contain an Ubuntu marker. Changing our version string will
move our modules about and trigger all sorts of pain for our packaging.

This patch proposes an alternative method of marking these oopses as
Ubuntu related. All oopses which contain the kernel release string also
contain the tainted flags:
first word of the UTS_VERSION string, which is typically
the build number:

WARNING: at /tmp/oops.c:5 modinit() (Not tainted)
Pid: 8190, comm: insmod Not tainted 2.6.24-0.77.rc4.git4.fc9 #1
[<c040649a>] show_trace_log_lvl+0x1a/0x2f

The tainted bits are generated in one place in kernel/panic.c so it
is possible to augment those to include an Ubuntu marker, with a high
probability of it being emitted with the version number. Something like
this (hand crafted):

WARNING: at /tmp/oops.c:5 modinit() (Not tainted)
Pid: 8190, comm: insmod Not tainted Ubuntu 2.6.24-0.77.rc4.git4.fc9 #1
[<c040649a>] show_trace_log_lvl+0x1a/0x2f

This is only exposed in these human readable strings hopefully this would
not affect any other part of our tooling.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
kernel/panic.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 12c5a0a..6aed9b5 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -161,9 +161,10 @@ EXPORT_SYMBOL(panic);

const char *print_tainted(void)
{
- static char buf[20];
+ static char buf[28];
if (tainted) {
- snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c%c%c",
+ snprintf(buf, sizeof(buf),
+ "Tainted: %c%c%c%c%c%c%c%c%c%c Ubuntu",
tainted & TAINT_PROPRIETARY_MODULE ? 'P' : 'G',
tainted & TAINT_FORCED_MODULE ? 'F' : ' ',
tainted & TAINT_UNSAFE_SMP ? 'S' : ' ',
@@ -176,7 +177,7 @@ const char *print_tainted(void)
tainted & TAINT_WARN ? 'W' : ' ');
}
else
- snprintf(buf, sizeof(buf), "Not tainted");
+ snprintf(buf, sizeof(buf), "Not tainted Ubuntu");
return(buf);
}

--
1.6.0.4.911.gc990


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 07:54 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org