[PATCH] powerpc: Export flat device tree via debugfs for debugging

Kumar Gala galak at kernel.crashing.org
Tue May 2 15:53:45 EST 2006


On May 1, 2006, at 7:20 PM, Michael Ellerman wrote:

> On Mon, 2006-05-01 at 12:54 -0500, Kumar Gala wrote:
>> On May 1, 2006, at 2:40 AM, Michael Ellerman wrote:
>>
>>> If DEBUG is turned on in prom.c, export the flat device tree via
>>> debugfs.
>>> This has been handy on several occasions.
>>>
>>> To look at it:
>>>  # mount -t debugfs none /sys/kernel/debug
>>>  # od -a /sys/kernel/debug/powerpc/flat-device-tree
>>>  and/or
>>>  # dtc -fI dtb /sys/kernel/debug/powerpc/flat-device-tree -O dts
>>>
>>> Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
>>> ---
>>>
>>>  arch/powerpc/kernel/prom.c |   25 +++++++++++++++++++++++++
>>>  1 file changed, 25 insertions(+)
>>>
>>> Index: to-merge/arch/powerpc/kernel/prom.c
>>> ===================================================================
>>> --- to-merge.orig/arch/powerpc/kernel/prom.c
>>> +++ to-merge/arch/powerpc/kernel/prom.c
>>> @@ -30,6 +30,7 @@
>>>  #include <linux/bitops.h>
>>>  #include <linux/module.h>
>>>  #include <linux/kexec.h>
>>> +#include <linux/debugfs.h>
>>>
>>>  #include <asm/prom.h>
>>>  #include <asm/rtas.h>
>>> @@ -2009,3 +2010,27 @@ void kdump_move_device_tree(void)
>>>  	/* XXX should we unreserve the old DT? */
>>>  }
>>>  #endif /* CONFIG_KEXEC */
>>> +
>>> +#ifdef DEBUG
>>
>> Shouldn't this also depend on DEBUGFS being built in.
>
> It could, but DEBUG_FS is written so that you don't have to care, so I
> didn't :)

Cool.  Haven't messed with DEBUG_FS.

- k



More information about the Linuxppc-dev mailing list