[Crash-utility] [PATCH] add -s option for struct command

qiaonuohan qiaonuohan at cn.fujitsu.com
Tue Apr 17 07:25:00 UTC 2012


Hello Dave,

The patch attached with this mail is to add "-s" option for struct 
command. The output is like below.

crash> page.private,_mapcount.counter,lru.next -s ffffea0000000850
0       -1      0xffffea0000000878
crash> page.private,_mapcount.counter,lru.next -s ffffea0000000850 -h
0x0     0xffffffff      0xffffea0000000878

There are three features provided by the patches.

1. the data can be output in one line, easier to be parsed

2. it is extremly faster than original struct command and print command. 
When using command like "struct xxx.yyy -s < address_list", if there are 
lots of addresses in the file, address_list, the original struct command 
will spend several minutes and even several hours. But the patch will 
reduce the time to several seconds.

3. submember can also be output, like "_mapcount.counter" int the above 
example

P.S.
The first patch is used to modified gdb. It add a command called 
"printm", which can output the relative information of a struct's member.

-- 
--
Regards
Qiao Nuohan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-printm-command-for-gdb.patch
Type: text/x-patch
Size: 2952 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120417/0120921a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-add-s-option-for-struct-command.patch
Type: text/x-patch
Size: 9434 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120417/0120921a/attachment-0001.bin>


More information about the Crash-utility mailing list