2003-03-26 15:07:04

by Martin Schwidefsky

[permalink] [raw]
Subject: [PATCH] s390 update (3/9): listing & kerntypes.

Remove rule to generate kernel listing. Add code to generate kerntypes for
use with the lkcd utils.

diffstat:
s390/Makefile | 6 ++---
s390/boot/Makefile | 18 +++++++---------
s390/boot/kerntypes.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
s390x/Makefile | 6 ++---
s390x/boot/Makefile | 17 ++++++---------
s390x/boot/kerntypes.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 127 insertions(+), 26 deletions(-)

diff -urN linux-2.5.66/arch/s390/Makefile linux-2.5.66-s390/arch/s390/Makefile
--- linux-2.5.66/arch/s390/Makefile Mon Mar 24 23:00:08 2003
+++ linux-2.5.66-s390/arch/s390/Makefile Wed Mar 26 15:45:11 2003
@@ -18,7 +18,7 @@
LDFLAGS_vmlinux := -e start
LDFLAGS_BLOB := --format binary --oformat elf32-s390

-CFLAGS += -pipe -fno-strength-reduce -finline-limit=10000 -Wno-sign-compare
+CFLAGS += -pipe -fno-strength-reduce -finline-limit-10000 -Wno-sign-compare

head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o

@@ -30,9 +30,9 @@

makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1)

-all: image listing
+all: image kerntypes.o

-listing image: vmlinux
+image kerntypes.o: vmlinux
$(call makeboot,arch/$(ARCH)/boot/$@)

install: vmlinux
diff -urN linux-2.5.66/arch/s390/boot/Makefile linux-2.5.66-s390/arch/s390/boot/Makefile
--- linux-2.5.66/arch/s390/boot/Makefile Mon Mar 24 23:01:53 2003
+++ linux-2.5.66-s390/arch/s390/boot/Makefile Wed Mar 26 15:45:11 2003
@@ -2,19 +2,17 @@
# Makefile for the linux s390-specific parts of the memory manager.
#

-targets := image listing
-EXTRA_AFLAGS := -traditional
-quiet_cmd_listing = OBJDUMP $@
- cmd_listing = $(OBJDUMP) --disassemble --disassemble-all \
- --disassemble-zeroes --reloc vmlinux > $@
+COMPILE_VERSION := __linux_compile_version_id__`hostname`__`date | \
+ tr -c '[0-9A-Za-z]' '_'`_t

-$(obj)/image: vmlinux FORCE
- $(call if_changed,objcopy)
+EXTRA_CFLAGS := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I .
+EXTRA_AFLAGS := -traditional

-$(obj)/listing: vmlinux FORCE
- $(call if_changed,listing)
+targets := image kerntypes.o

+$(obj)/image: vmlinux FORCE
+ $(call if_changed,objcopy)

install: $(CONFIGURE) $(obj)/image
sh -x $(obj)/install.sh $(KERNELRELEASE) $(obj)/image \
- System.map Kerntypes "$(INSTALL_PATH)"
+ System.map "$(INSTALL_PATH)"
diff -urN linux-2.5.66/arch/s390/boot/kerntypes.c linux-2.5.66-s390/arch/s390/boot/kerntypes.c
--- linux-2.5.66/arch/s390/boot/kerntypes.c Thu Jan 1 01:00:00 1970
+++ linux-2.5.66-s390/arch/s390/boot/kerntypes.c Wed Mar 26 15:45:11 2003
@@ -0,0 +1,53 @@
+/*
+ * kerntypes.c
+ *
+ * Dummy module that includes headers for all kernel types of interest.
+ * The kernel type information is used by the lcrash utility when
+ * analyzing system crash dumps or the live system. Using the type
+ * information for the running system, rather than kernel header files,
+ * makes for a more flexible and robust analysis tool.
+ *
+ * This source code is released under the GNU GPL.
+ */
+
+/* generate version for this file */
+typedef char *COMPILE_VERSION;
+
+/* General linux types */
+
+#include <linux/autoconf.h>
+#include <linux/compile.h>
+#include <linux/config.h>
+#include <linux/utsname.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+
+#include <asm/lowcore.h>
+#include <asm/debug.h>
+#include <asm/ccwdev.h>
+#include <asm/qdio.h>
+
+/* channel subsystem driver */
+#include "drivers/s390/cio/cio.h"
+#include "drivers/s390/cio/chsc.h"
+#include "drivers/s390/cio/css.h"
+#include "drivers/s390/cio/device.h"
+#include "drivers/s390/cio/qdio.h"
+
+/* dasd device driver */
+#include "drivers/s390/block/dasd_int.h"
+#include "drivers/s390/block/dasd_diag.h"
+#include "drivers/s390/block/dasd_eckd.h"
+#include "drivers/s390/block/dasd_fba.h"
+
+/* networking drivers */
+#include "drivers/s390/net/fsm.h"
+#include "drivers/s390/net/iucv.h"
+#include "drivers/s390/net/lcs.h"
+
+/* include sched.c for types:
+ * - struct prio_array
+ * - struct runqueue
+ */
+#include "kernel/sched.c"
diff -urN linux-2.5.66/arch/s390x/Makefile linux-2.5.66-s390/arch/s390x/Makefile
--- linux-2.5.66/arch/s390x/Makefile Mon Mar 24 23:00:39 2003
+++ linux-2.5.66-s390/arch/s390x/Makefile Wed Mar 26 15:45:11 2003
@@ -19,7 +19,7 @@
MODFLAGS += -fpic -D__PIC__
LDFLAGS_BLOB := --format binary --oformat elf64-s390

-CFLAGS += -pipe -fno-strength-reduce -finline-limit=10000 -Wno-sign-compare
+CFLAGS += -pipe -fno-strength-reduce -finline-limit-10000 -Wno-sign-compare

head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o

@@ -30,9 +30,9 @@

makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1)

-all: image listing
+all: image kerntypes.o

-listing image: vmlinux
+image kerntypes.o: vmlinux
$(call makeboot,arch/$(ARCH)/boot/$@)

install: vmlinux
diff -urN linux-2.5.66/arch/s390x/boot/Makefile linux-2.5.66-s390/arch/s390x/boot/Makefile
--- linux-2.5.66/arch/s390x/boot/Makefile Mon Mar 24 23:00:39 2003
+++ linux-2.5.66-s390/arch/s390x/boot/Makefile Wed Mar 26 15:45:11 2003
@@ -2,20 +2,17 @@
# Makefile for the linux s390-specific parts of the memory manager.
#

-targets := image listing
-EXTRA_AFLAGS := -traditional
+COMPILE_VERSION := __linux_compile_version_id__`hostname`__`date | \
+ tr -c '[0-9A-Za-z]' '_'`_t

-quiet_cmd_listing = OBJDUMP $@
- cmd_listing = $(OBJDUMP) --disassemble --disassemble-all \
- --disassemble-zeroes --reloc vmlinux > $@
+EXTRA_CFLAGS := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I .
+EXTRA_AFLAGS := -traditional
+
+targets := image kerntypes.o

$(obj)/image: vmlinux FORCE
$(call if_changed,objcopy)

-$(obj)/listing: vmlinux FORCE
- $(call if_changed,listing)
-
-
install: $(CONFIGURE) $(obj)/image
sh -x $(obj)/install.sh $(KERNELRELEASE) $(obj)/image \
- System.map Kerntypes "$(INSTALL_PATH)"
+ System.map "$(INSTALL_PATH)"
diff -urN linux-2.5.66/arch/s390x/boot/kerntypes.c linux-2.5.66-s390/arch/s390x/boot/kerntypes.c
--- linux-2.5.66/arch/s390x/boot/kerntypes.c Thu Jan 1 01:00:00 1970
+++ linux-2.5.66-s390/arch/s390x/boot/kerntypes.c Wed Mar 26 15:45:11 2003
@@ -0,0 +1,53 @@
+/*
+ * kerntypes.c
+ *
+ * Dummy module that includes headers for all kernel types of interest.
+ * The kernel type information is used by the lcrash utility when
+ * analyzing system crash dumps or the live system. Using the type
+ * information for the running system, rather than kernel header files,
+ * makes for a more flexible and robust analysis tool.
+ *
+ * This source code is released under the GNU GPL.
+ */
+
+/* generate version for this file */
+typedef char *COMPILE_VERSION;
+
+/* General linux types */
+
+#include <linux/autoconf.h>
+#include <linux/compile.h>
+#include <linux/config.h>
+#include <linux/utsname.h>
+#include <linux/module.h>
+#include <linux/sched.h>
+#include <linux/mm.h>
+
+#include <asm/lowcore.h>
+#include <asm/debug.h>
+#include <asm/ccwdev.h>
+#include <asm/qdio.h>
+
+/* channel subsystem driver */
+#include "drivers/s390/cio/cio.h"
+#include "drivers/s390/cio/chsc.h"
+#include "drivers/s390/cio/css.h"
+#include "drivers/s390/cio/device.h"
+#include "drivers/s390/cio/qdio.h"
+
+/* dasd device driver */
+#include "drivers/s390/block/dasd_int.h"
+#include "drivers/s390/block/dasd_diag.h"
+#include "drivers/s390/block/dasd_eckd.h"
+#include "drivers/s390/block/dasd_fba.h"
+
+/* networking drivers */
+#include "drivers/s390/net/fsm.h"
+#include "drivers/s390/net/iucv.h"
+#include "drivers/s390/net/lcs.h"
+
+/* include sched.c for types:
+ * - struct prio_array
+ * - struct runqueue
+ */
+#include "kernel/sched.c"


2003-03-26 15:31:39

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] s390 update (3/9): listing & kerntypes.

On Wed, Mar 26, 2003 at 04:07:31PM +0100, Martin Schwidefsky wrote:
> Remove rule to generate kernel listing. Add code to generate kerntypes for
> use with the lkcd utils.

No. Either we add Kerntypes to the architecture-independent code (I'm all
for it!) or not at all. Cludging this into s390-specific code is a very,
very bad idea.

2003-03-26 16:24:51

by Martin Schwidefsky

[permalink] [raw]
Subject: Re: [PATCH] s390 update (3/9): listing & kerntypes.


> No. Either we add Kerntypes to the architecture-independent code (I'm
all
> for it!) or not at all. Cludging this into s390-specific code is a very,
> very bad idea.
Well, even if the Kerntypes gets added to the architecture-independent code
we still would need some special s390 includes to get all the types we need.
In particular the common i/o layer includes would have to be added in a
architecture specific way, either by #ifdef or by special files that get
include by the common kerntypes file.

blue skies,
Martin


2003-03-26 19:56:15

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] s390 update (3/9): listing & kerntypes.

On Wed, Mar 26, 2003 at 05:32:12PM +0100, Martin Schwidefsky wrote:
>
> > No. Either we add Kerntypes to the architecture-independent code (I'm
> all
> > for it!) or not at all. Cludging this into s390-specific code is a very,
> > very bad idea.
> Well, even if the Kerntypes gets added to the architecture-independent code
> we still would need some special s390 includes to get all the types we need.

The patches from the lkcd folks don't seem to need additional includes.
Please argue with them instead of trying to push such changes through the
backdoor.

2003-03-26 23:39:48

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] s390 update (3/9): listing & kerntypes.

Christoph Hellwig wrote:

> On Wed, Mar 26, 2003 at 05:32:12PM +0100, Martin Schwidefsky wrote:
>>
>> > No. Either we add Kerntypes to the architecture-independent code (I'm
>> all
>> > for it!) or not at all. Cludging this into s390-specific code is a very,
>> > very bad idea.
AFAIK, s390 is the only architecture that has hardware support for taking
system dumps without the lkcd patch. Since the lkcd patch does not
appear to be going into mainline linux and most s390 users want the
kerntypes anyway (every distributor includes them), arch/s390/boot
seems to be the right place to put them.

>> Well, even if the Kerntypes gets added to the architecture-independent code
>> we still would need some special s390 includes to get all the types we need.
>
> The patches from the lkcd folks don't seem to need additional includes.
> Please argue with them instead of trying to push such changes through the
> backdoor.
You need to include the struct definition for every data type that you
want lcrash to know about. E.g. if you want to analyse scsi structures
in a crash dump, you have to include drivers/scsi/scsi.h.
Most internal information about s390 devices is in structs defined
in drivers/s390/cio/, so we need them as well.

This is not an attempt to sneak the (mostly unrelated) lkcd patch in. If they
ever get included, we can still do a merge of the kerntypes file, but until
then it is just a tiny architecture special file that everybody else can
ignore.

Arnd <><

2003-03-27 08:33:44

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] s390 update (3/9): listing & kerntypes.

On Thu, Mar 27, 2003 at 12:20:07AM +0100, Arnd Bergmann wrote:
> AFAIK, s390 is the only architecture that has hardware support for taking
> system dumps without the lkcd patch. Since the lkcd patch does not
> appear to be going into mainline linux and most s390 users want the
> kerntypes anyway (every distributor includes them), arch/s390/boot
> seems to be the right place to put them.

No. The Kerntypes patch makes lots of sense even without lkcd. Once
again I'm all in favour of adding this patch, but adding such a generic
facility in architecture depend code is a bad idea.

2003-03-27 11:53:56

by Martin Schwidefsky

[permalink] [raw]
Subject: Re: [PATCH] s390 update (3/9): listing & kerntypes.


> No. The Kerntypes patch makes lots of sense even without lkcd. Once
> again I'm all in favour of adding this patch, but adding such a generic
> facility in architecture depend code is a bad idea.

I still think that due to the fact that each architecture has it own
special set of includes that this is not really a generic facility.
But anyhow if you want to do this via the lkcd patch them be it.

blue skies,
Martin