4.32. whatis

Usage

whatis [-a] [-f] [-l] [-n] [-w outfile] expression
    

Description

Display, in C-like fashion, detailed information about kernel types 
(structs, unions, typedefs, base types, etc.) If the -a option is 
specified, display a list of all types. If the -l option is specified, 
display type information in tabular form. When the -f option is 
specified, along with the -l option, display additional information about 
the type. If the -n option is specified for a struct or union, along with 
the -l option, display information about each member.
    

Note

For display of information for multi-worded types (e.g. "short int") you have to use parenthesis around the type.

Example 4-25. whatis

>> whatis mem_map
    ADDR  OFFSET  TYPE         NAME
============================================================
c02addec       0  GLOBAL_DATA  mem_map

>> whatis (short unsigned int) -l
NAME                      TYPE             TYPE_NUM         REAL_TYPE  SIZE
===============================================================================
short unsigned int        BASE     0001000000000009  0000000000000000    2
===============================================================================
1 type found

>> whatis page
struct page {
        struct page *next;
        struct page *prev;
        pgoff_t index;
        struct inode *inode;
        struct page *next_hash;
        atomic_t count;
        long unsigned int flags;
        struct wait_queue *wait;
        struct page **pprev_hash;
        struct buffer_head *buffers;
};

>> whatis page.index
pgoff_t

>> whatis pgoff_t 
long unsigned int 

>> whatis page -l
NAME                      TYPE             TYPE_NUM         REAL_TYPE  SIZE
===============================================================================
page                      STRUCT   0001002300000014  0000000000000000   40
===============================================================================
1 type found

>> whatis page.index -l -f
NAME                      TYPE             TYPE_NUM         REAL_TYPE  SIZE
===============================================================================
long unsigned int         BASE     0001000000000005  0000000000000000    4
  ST_BIT_OFFSET=0, ST_BIT_SIZE=0
  ELEMENT_TYPE=0x0, INDEX_TYPE=0x1000000000005, VALUE=0
  FLAGS=0x2, OFFSET=0
  TYPESTR="long unsigned int "
  LOW_BOUNDS=0, HIGH_BOUNDS=-1, MEMBER=0x0, NEXT=0x0

===============================================================================
1 type found

>> whatis -a -l
FileVersion               TYPEDEF  0001004e00000007  0001000900000017    0
PioctlData                STRUCT   0001004e00000049  0000000000000000   20
Unique_t                  TYPEDEF  0001004e00000006  0001000900000017    0
...
loff_t                    TYPEDEF  000100090000000d  0001000c00000013    0
long double               BASE     000100000000000e  0000000000000000   12
long int                  BASE     0001000000000003  0000000000000000    4
long long int             BASE     0001000000000006  0000000000000000    8
long long unsigned int    BASE     0001000000000007  0000000000000000    8
long unsigned int         BASE     0001000000000005  0000000000000000    4
machine_type              ENUM     0001004900000001  0000000000000000    0
mem_map_t                 TYPEDEF  0001000200000016  0001002300000014    0
...
task_struct               STRUCT   0001002500000002  0000000000000000 1424
task_union                UNION    0001000300000014  0000000000000000 8192
tcflag_t                  TYPEDEF  0001007b00000003  0001000000000004    0
termio                    STRUCT   0001007a00000002  0000000000000000   18
...
void                      BASE     0001000000000013  0001000000000013   -1
vuid_t                    TYPEDEF  0001004e0000000a  0001000900000020    0
wait_queue                STRUCT   0001001c00000003  0000000000000000   12
wait_queue_head_t         TYPEDEF  0001002500000004  0001001c00000002    0
wait_queue_t              TYPEDEF  0001002500000003  0001001c00000003    0
winsize                   STRUCT   0001007a00000001  0000000000000000    8
===============================================================================
491 types found