"Sachin P. Sant" wrote:
Dave Anderson wrote:
> On a RHEL5 x86:
>
>   crash> sym -q __per_cpu | grep -e start -e end
>   c03100a0 (A) __per_cpu_start
>   c0315ae4 (A) __per_cpu_end
>   crash>
>
> But on your RHEL5 ppc64 kernel:
>
>   # nm -Bn vmlinux | grep __per_cpu
>   c000000000430100 D __per_cpu_start
>   c0000000004356f0 D __per_cpu_end
>   #
>
> So if you remove the two "type == 'A'" qualifiers
> from the if statement above, does it work OK?
>
Dave , thanks for the hint. Yes these symbols are of
type D on PPC64 machine. Infact after checking on latest
RHEL5 kernels [ with relocatable support ] this is
the case with even other archs also.

[root@llm19 boot]# cat System.map-2.6.18-1.2767.el5 | grep __per_cpu_
c065dd2c r __ksymtab___per_cpu_offset
c0663c64 r __kcrctab___per_cpu_offset
c0666c12 r __kstrtab___per_cpu_offset
c06e6b80 D __per_cpu_offset
c077d100 D __per_cpu_start
c0781de4 D __per_cpu_end
[root@llm19 boot]# uname -i
i386
[root@llm19 boot]#
 

Yes, you are right -- I was looking at a much earlier
RHEL5 dumpfile...
 
So this probably can be a generic problem affecting other arch's
also.

Thanks for the help.

Attached here is a patch to fix this problem. Let me know if it's
ok.

Thanks
-Sachin
 

Looks good -- queued for the next release.

Thanks,
  Dave
 

* On a UP machine running SMP kernel, crash fails while reading idle tasks
* from per cpu data.

Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
---

  ------------------------------------------------------------------------------------------------------------------------
* On a UP machine running SMP kernel, crash fails while reading idle tasks
* from per cpu data.

Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
---

diff -Naurp crash-4.0-3.16/kernel.c crash-4.0-3.16-new/kernel.c
--- crash-4.0-3.16/kernel.c     2006-12-22 01:24:11.000000000 +0530
+++ crash-4.0-3.16-new/kernel.c 2007-01-05 10:49:39.000000000 +0530
@@ -114,7 +114,8 @@ kernel_init()

        if ((sp1 = symbol_search("__per_cpu_start")) &&
            (sp2 =  symbol_search("__per_cpu_end")) &&
-           (sp1->type == 'A') && (sp2->type == 'A') &&
+           (sp1->type == 'A' || sp1->type == 'D') &&
+           (sp2->type == 'A' || sp2->type == 'D') &&
            (sp2->value > sp1->value))
                kt->flags |= SMP|PER_CPU_OFF;