[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Crash-utility] crash vs irqs



D. Hugh Redelmeier wrote:
| From: Dave Anderson <anderson redhat com>

| D. Hugh Redelmeier wrote:
| > I'm having a problem with the Fedora 7 kernel 2.6.21-1.3228.fc7 for
| > x86_64.  So I am trying to use crash-4.0-4.2 to analyze the problem.
| > (The version of crash in F7 won't work with this kernel.)

| > When I use the irq command I get this error message:
| >   irq: cannot determine size of irq_desc_t
| | Could be shifting sands syndrome, which happens all the time. | | Perhaps "irq_desc_t" has been removed from that kernel?
| I've got a slightly older 2.6.21-1.3125.fc7 source tree
| hanging around that shows this:
| | /*
|  * Migration helpers for obsolete names, they will go away:
|  */
| #define hw_interrupt_type       irq_chip
| typedef struct irq_chip         hw_irq_controller;
| #define no_irq_type             no_irq_chip
| typedef struct irq_desc         irq_desc_t;
| | Interesting, the "go away" comment -- perhaps it's no longer
| there in -1.3228?

I'm playing with linux-2.6.22-rc7 now.  It has the same problem with
the crash irq command.

Those lines are still in
  linux-2.6.22-rc7/include/linux/irq.h
so I don't know why this problem has come up.

In any case, I have a patch that seems to fix the problem and that
should be backward compatible.  It is based on the suggestions you
outlined.  I'm starting with the crash-4.0-4.3.

===================================================================
RCS file: RCS/kernel.c,v
retrieving revision 1.1
diff -u -r1.1 kernel.c
--- kernel.c	2007/07/07 17:23:06	1.1
+++ kernel.c	2007/07/07 17:56:59
@@ -49,7 +49,7 @@
 static void BUG_bytes_init(void);
 static int BUG_x86(void);
 static int BUG_x86_64(void);
-
+static /*const*/ char *irq_desc_type_name;	
/*
@@ -278,13 +278,19 @@
STRUCT_SIZE_INIT(hlist_head, "hlist_head"); STRUCT_SIZE_INIT(hlist_node, "hlist_node"); - MEMBER_OFFSET_INIT(irq_desc_t_status, "irq_desc_t", "status");
-	if (MEMBER_EXISTS("irq_desc_t", "handler"))
-		MEMBER_OFFSET_INIT(irq_desc_t_handler, "irq_desc_t", "handler");
+	/* see linux-* /include/linux/irq.h to find how IRQ information is represented by the kernel */
+	if (STRUCT_EXISTS("irq_desc_t"))
+	    irq_desc_type_name = "irq_desc_t";
+	else
+	    irq_desc_type_name = "irq_desc";
+
+	MEMBER_OFFSET_INIT(irq_desc_t_status,  irq_desc_type_name, "status");
+	if (MEMBER_EXISTS(irq_desc_type_name, "handler"))
+		MEMBER_OFFSET_INIT(irq_desc_t_handler, irq_desc_type_name, "handler");
 	else
-		MEMBER_OFFSET_INIT(irq_desc_t_chip, "irq_desc_t", "chip");
-	MEMBER_OFFSET_INIT(irq_desc_t_action, "irq_desc_t", "action");
-	MEMBER_OFFSET_INIT(irq_desc_t_depth, "irq_desc_t", "depth");
+		MEMBER_OFFSET_INIT(irq_desc_t_chip, irq_desc_type_name, "chip");
+	MEMBER_OFFSET_INIT(irq_desc_t_action, irq_desc_type_name, "action");
+	MEMBER_OFFSET_INIT(irq_desc_t_depth, irq_desc_type_name, "depth");
 	if (STRUCT_EXISTS("hw_interrupt_type")) {
 		MEMBER_OFFSET_INIT(hw_interrupt_type_typename,
 			"hw_interrupt_type", "typename");
@@ -346,7 +352,7 @@
 	MEMBER_OFFSET_INIT(irqaction_dev_id, "irqaction", "dev_id");
 	MEMBER_OFFSET_INIT(irqaction_next, "irqaction", "next");
- STRUCT_SIZE_INIT(irq_desc_t, "irq_desc_t");
+	STRUCT_SIZE_INIT(irq_desc_t, irq_desc_type_name);
STRUCT_SIZE_INIT(irq_cpustat_t, "irq_cpustat_t"); MEMBER_OFFSET_INIT(irq_cpustat_t___softirq_active, ================ end of patch ================



I still don't understand why it's not being picked up in the
debuginfo data.  There was a problem with gcc 3.4.*, and then
subsequently a regression in gcc 4.0.0, both of which were related
to data structure information not being contained in the vmlinux
debuginfo data.

Anyway, thanks -- the patch looks good.  Even with the mystery
it's worth updating it in preparation for its eventual advertised
removal from the kernel.  In the Linux 2.2 days when the crash
code was originally written, and through 2.4, the kernel defined
it as:

    typedef struct {
        ...
    } irq_desc_t;

In 2.6 a "struct irq_desc" struct was introduced.

Queued for the next release.

Thanks,
  Dave



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]