Operating System - HP-UX
1847129 Members
5692 Online
110263 Solutions
New Discussion

Re: List kernel symbol table

 
SOLVED
Go to solution
Mranalini
New Member

List kernel symbol table

Hi,

We are porting an application from HP-UX11i 32-bit to HP-UX11i 64-bit. The application uses a lot of kernel structures like svstat, rfsreqcnt_v2, rfsreqcnt_v2_ndata, rfsreqcnt_v3, rfsreqcnt_v3_ndata, rcstat, rsstat etc. Is there a way to check if these structures have changed on 64-bit platform?

For eg. certain members of the kernel structures that were int(on 32-bit platform) are now long(on 64-bit) and hence would impact our porting.

Kindly let me know if there a book/site/newsgroup that lists the header files for these data structures.

I have tried to use adb, but adb just lists the value. Besides is there a way to list the kernel symbol table?

Thanks and Regards,
Mranalini
5 REPLIES 5
Hazem Mahmoud_3
Respected Contributor

Re: List kernel symbol table

I'm not sure about the header files for the data structures, however, regarding the kernel table, take a look at the commands sysdef and kmtune (do a man on both). That might get you started.

-Hazem
Bharat Katkar
Honored Contributor

Re: List kernel symbol table

I mentioned by hazem u can use
#sysdef
or
#kmtune -l
Command to see what all kernel parameters are there and configured with what value.
You need to know a lot to actually know how little you know
A. Clay Stephenson
Acclaimed Contributor

Re: List kernel symbol table

Well, if all you want is the symbol table then "nm /stand/vmunix" will do that. In general, 32-bit vs 64-bit data structures don't change from int to long per se but rather the meaning of int and long changes depending upon the compiler options used.
The sysconf() system call can also be of limited use but your best bet is to study the Transition Guides available from docs.hp.com. Here is a start:
http://docs.hp.com/cgi-bin/onlinedocs.py?mpn=5966-9887&service=hpux&path=00/00/1&title=HP-UX%2064-bit%20Porting%20and%20Transition%20Guide
If it ain't broke, I can fix that.
Jdamian
Respected Contributor
Solution

Re: List kernel symbol table

Hi

Perhaps you may use q4. Q4 can print the symbols, constants and fields of structures of kernel.

It works on a savecrash file.
I suggest to use the following Q4 commands:

catalog
fields
constants
symbols

For instance
q4> catalog physiobuf
BYTES FIELDS SHAPE NAME
56 7 struct physiobufstats
56 7 typedef physiobufstats_t
2 types matched
q4> fields struct physiobufstats
OFFSET SIZE FLAVOR NAME
bytes +bits bytes +bits
0 0 8 0 u_long alloc_call
8 0 8 0 u_long alloc_hit
16 0 8 0 u_long alloc_miss
24 0 8 0 u_long alloc_sleep
32 0 8 0 u_long free_call
40 0 8 0 u_long free_hit
48 0 8 0 u_long free_miss

Look into /usr/contrib/Q4/doc directory. A reference guide in PostScript format exists (I miss in PDF format because I cannot print PS files).
Mranalini
New Member

Re: List kernel symbol table

Hi,

Thanks for the reply. I am able to view the address of the symbol using

q4>symbol clstat
OCTAL DECIMAL HEX DIST TYPE NAME
01600000000040005524220 16140901068792309904 0xe00000010016a890 192 OBJT clstat

but since the type is listed as OBJT I am unable to use the fields command to list the fields. Any idea what OBJT means? Is it possible to list the fields of something listed as OBJT?

Thanks and Regards,
Mranalini