OS Manuals

/usr/bin/pahole

dwarf manipulation utilities

From pahole 1.32-r0 (os), captured 2026-11-05 by running pahole --help (exit 0). permalink

Usage: pahole [OPTION...] FILE

  -a, --anon_include         include anonymous classes
  -A, --nested_anon_include  include nested (inside other structs) anonymous
                             classes
      --btf_attributes       Allow generation of attributes in BTF. Attributes
                             are the type tags and decl tags with the kind_flag
                             set to 1.
      --btf_base=PATH        Path to the base BTF file
      --btf_encode_detached=FILENAME
                             Encode as BTF in a detached file
      --btf_encode_force     Ignore those symbols found invalid when encoding
                             BTF.
                                   --btf_features=FEATURE_LIST
Specify supported BTF features in FEATURE_LIST or
                             'default' for default set of supported features.
                             See the pahole manual page for the list of
                             supported, default features.
      --btf_features_strict=FEATURE_LIST_STRICT
                             Specify supported BTF features in
                             FEATURE_LIST_STRICT or 'default' for default set
                             of supported features.  Unlike --btf_features,
                             unrecognized features will trigger an error.
      --btf_gen_all          Allow using all the BTF features supported by
                             pahole.
      --btf_gen_floats       Allow producing BTF_KIND_FLOAT entries.
      --btf_gen_optimized    Generate BTF for functions with
                             optimization-related suffixes (.isra,
                             .constprop).
  -B, --bit_holes=NR_HOLES   Show only structs at least NR_HOLES bit holes
      --classes_as_structs   Use 'struct' when printing classes
      --compile              Emit compilable types
      --contains_enumerator=ENUMERATOR
                             Show enumerations that contains ENUMERATOR
      --count=COUNT          Print only COUNT input records
  -c, --cacheline_size=SIZE  set cacheline size to SIZE
  -C, --class_name=CLASS_NAME   Show just this class
      --devel_version        Print development version with git SHA (e.g.,
                             v1.31-189-g437fced33da3393e)
  -d, --recursive            recursive mode, affects several other flags
  -D, --decl_exclude=PREFIX  exclude classes declared in files with PREFIX
  -E, --expand_types         expand class members
      --features=FEATURE_LIST   Specify supported features in FEATURE_LIST or
                             'default' for default set of supported features.
                             See the pahole manual page for the list of
                             supported, default features.
      --first_obj_only       Only process the first object file in the binary
      --fixup_silly_bitfields   Fix silly bitfields such as int foo:32
      --flat_arrays          Flat arrays
  -f, --find_pointers_to=CLASS_NAME
                             Find pointers to CLASS_NAME
  -F, --format_path=FORMAT_LIST   List of debugging formats to try
      --hashbits=BITS        Number of bits for the hash table key
      --header_type=TYPE     File header type
      --hex                  Print offsets and sizes in hexadecimal
  -H, --holes=NR_HOLES       show only structs with at least NR_HOLES holes
  -i, --contains=CLASS_NAME  Show classes that contains CLASS_NAME
  -I, --show_decl_info       Show the file and line number where the tags were
                             defined
  -j, --jobs[=NR_JOBS]       run N jobs in parallel [default to number of
                             online processors + 10%]
  -J, --btf_encode           Encode as BTF
      --kabi_prefix=STRING   When the prefix of the string is STRING, treat the
                             string as STRING.
      --lang=LANGUAGES       Only consider compilation units written in these
                             languages
      --lang_exclude=LANGUAGES   Don't consider compilation units written in
                             these languages
  -l, --show_first_biggest_size_base_type_member
                             show first biggest size base_type member
  -m, --nr_methods           show number of methods
  -M, --show_only_data_members   show only the members that use space in the
                             class layout
      --numeric_version      Print a numeric version, i.e. 119 instead of v1.19

  -n, --nr_members           show number of members
  -N, --class_name_len       show size of classes
      --packed               Show just packed structs
      --padding_ge=SIZE_PADDING   show only structs with at least SIZE_PADDING
                             bytes padding at its end
      --prettify=PATH        Path to the raw data to pretty print
      --ptr_table_stats      Print internal data structures stats
  -p, --expand_pointers      expand class pointer members
  -P, --packable             show only structs that has holes that can be
                             packed
  -q, --quiet                be quieter
      --range=STRUCT         Data struct with 'offset' and 'size' fields to
                             determine --seek_bytes and --size_bytes
      --reproducible_build   Generate reproducile BTF output
      --running_kernel_vmlinux   Search for, possibly getting from a debuginfo
                             server, a vmlinux matching the running kernel
                             build-id (from /sys/kernel/notes)
  -r, --rel_offset           show relative offsets of members in inner structs
  -R, --reorganize           reorg struct trying to kill holes
      --seek_bytes=BYTES     Seek COUNT input records
      --show_private_classes Show classes that are defined inside other classes
                             or in functions
      --size_bytes=BYTES     Read only this number of bytes from this point
                             onwards
      --skip=COUNT           Skip COUNT input records
      --skip_emitting_atomic_typedefs
                             Do not emit 'typedef _Atomic int atomic_int' &
                             friends.
      --skip_encoding_btf_decl_tag
                             Do not encode TAGs in BTF.
      --skip_encoding_btf_enum64   Do not encode ENUM64sin BTF.
                                   --skip_encoding_btf_inconsistent_proto
Skip functions that have multiple inconsistent
                             function prototypes sharing the same name, or that
                             use unexpected registers for parameter values.
      --skip_encoding_btf_type_tag
                             Do not encode TAGs in BTF.
      --skip_encoding_btf_vars   Do not encode any VARs in BTF [if this is not
                             specified, only percpu variables are encoded. To
                             encode global variables too, use
                             --encode_btf_global_vars].
      --skip_missing         skip missing types passed to -C rather than stop
      --sort                 Sort types by name
      --structs              Show just structs
      --supported_btf_features   Show list of btf_features supported by pahole
                             and exit.
      --suppress_aligned_attribute
                             Suppress __attribute__((aligned(N))
      --suppress_force_paddings   Suppress int :N paddings at the end
      --suppress_packed      Suppress output of inferred
                             __attribute__((__packed__))
  -s, --sizes                show size of classes
  -S, --show_reorg_steps     show the struct layout at each reorganization
                             step
  -t, --separator=SEP        use SEP as the field separator
  -T, --nr_definitions       show how many times struct was defined
      --unions               Show just unions
  -u, --defined_in           show CUs where CLASS_NAME (-C) is defined
  -V, --verbose              be verbose
      --with_embedded_flexible_array
                             show only structs with an embedded flexible array
                             (containing a struct that has a flexible array)
      --with_flexible_array  show only structs with a flexible array
  -w, --word_size=WORD_SIZE  change the arch word size to WORD_SIZE
  -x, --exclude=PREFIX       exclude PREFIXed classes
  -X, --cu_exclude=PREFIX    exclude PREFIXed compilation units
  -y, --prefix_filter=PREFIX include PREFIXed classes
  -z, --hole_size_ge=HOLE_SIZE   show only structs with at least one hole
                             greater or equal to HOLE_SIZE
  -Z, --ctf_encode           Encode as CTF: DISABLED, consider helping porting
                             to libctf
  -?, --help                 Give this help list
      --usage                Give a short usage message
      --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
Options (92)
OptionDescriptionSource
-a, --anon_includeInclude anonymous classes.help + man
-A, --nested_anon_includeInclude nested (inside other structs) anonymous classes.help + man
--btf_attributesAllow generation of attributes in BTF.help
--btf_base PATHPath to the base BTF file, for instance: vmlinux when encoding kernel module BTF information.help + man
--btf_encode_detached FILENAMESame thing as -J/--btf_encode, but storing the raw BTF info into a separate file.help + man
--btf_encode_forceIgnore those symbols found invalid when encoding BTF.help + man
--btf_features_strict FEATURE_LIST_STRICTSpecify supported BTF features in FEATURE_LIST_STRICT or 'default' for default set of supported features.help + man
--btf_gen_allAllow using all the BTF features supported by pahole.help + man
--btf_gen_floatsAllow producing BTF_KIND_FLOAT entries in systems where the vmlinux DWARF information has float types.help + man
--btf_gen_optimizedGenerate BTF for functions with optimization-related suffixes (.isra, .constprop).help + man
-B, --bit_holes NR_HOLESShow only structs at least NR_HOLES bit holes.help + man
--classes_as_structsUse 'struct' when printing classeshelp
--compileGenerate compileable code, with all definitions for all types, i.e.:help + man
--contains_enumerator ENUMERATORShow enumeration that contains ENUMERATOR_NAME.help + man
--count COUNTPretty print the first COUNT records from input.help + man
-c, --cacheline_size SIZESet cacheline size to SIZE bytes.help + man
-C, --class_name CLASS_NAMEShow just these classes.help + man
--devel_versionPrint development version with git SHA (e.g., v1.31-189-g437fced33da3393e)help
-d, --recursiveRecursive mode, affects several other flags.help + man
-D, --decl_exclude PREFIXexclude classes declared in files with PREFIX.help + man
-E, --expand_typesExpand class members.help + man
--features FEATURE_LISTThis is also available as --btf_features=FEATURE_LIST, unknown features, like those added in newer versions of pahole, are ignored.help + man
--first_obj_onlyOnly process the first object file in the binaryhelp
--fixup_silly_bitfieldsConverts silly bitfields such as "int foo:32" to plain "int foo".help + man
--flat_arraysFlatten arrays, so that array[10][2] becomes array[20].help + man
-f, --find_pointers_to CLASS_NAMEFind pointers to CLASS_NAME.help + man
-F, --format_path FORMAT_LISTAllows specifying a list of debugging formats to try, in order.help + man
--hashbits BITSAllows specifying the number of bits for the debugging format loader to use.help + man
--header_type TYPEFile header typehelp
--hexPrint offsets and sizes in hexadecimal.help + man
-H, --holes NR_HOLESShow only structs with at least NR_HOLES holes.help + man
-i, --contains CLASS_NAMEShow classes that contains CLASS_NAME.help + man
-I, --show_decl_infoShow the file and line number where the tags were defined, if available in the debugging information.help + man
-j, --jobs NR_JOBSrun N jobs in parallel [default to number of online processors + 10%]help + man
-J, --btf_encodeEncode BTF information from DWARF, used in the Linux kernel build process when CONFIG_DEBUG_INFO_BTF=y is present, introduced in Linux v5.2.help + man
--kabi_prefix STRINGWhen the prefix of the string is STRING, treat the string as STRING.help + man
--lang LANGUAGESOnly process compilation units built from source code written in the specified languages.help + man
--lang_exclude LANGUAGESTo filter out compilation units written in Rust, for instance, use:help + man
-l, --show_first_biggest_size_base_type_memberShow first biggest size base_type member.help + man
-m, --nr_methodsShow number of methods of all classes, i.e., the number of functions have arguments that are pointers to a given class.help + man
-M, --show_only_data_membersShow only the members that use space in the class layout.help + man
--numeric_versionShow a numeric only version, suitable for use in Makefiles and scripts where one wants to know what if the installed version has some feature, i.e.: 118 instead of "v1.18".help + man
-n, --nr_membersShow number of members.help + man
-N, --class_name_lenShow size of classes.help + man
--packedShow only packed structs, all the other filters apply, i.e. to show just the sizes of all packed structs combine --packed with --sizes, etc.help + man
--padding_ge SIZE_PADDINGShow only structs with at least SIZE_PADDING bytes of padding at its end.help + man
--prettify PATHPath to the raw data to pretty printhelp
--ptr_table_statsPrint statistics about ptr_table data structures, used to hold all the types, tags and functions data structures, for development tuning of such tables, tuned for a typical 2021 vmlinux file.help + man
-p, --expand_pointersExpand class pointer members.help + man
-P, --packableShow only structs that has holes that can be packed if members are reorganized, for instance when using the --reorganize option.help + man
-q, --quietBe quieter.help + man
--range STRUCTData struct with 'offset' and 'size' fields to determine --seek_bytes and --size_byteshelp
--reproducible_buildGenerate reproducile BTF outputhelp
--running_kernel_vmlinuxSearch for, possibly getting from a debuginfo server, a vmlinux matching the running kernel build-id (from /sys/kernel/notes).help + man
-r, --rel_offsetShow relative offsets of members in inner structs.help + man
-R, --reorganizeReorganize struct, demoting and combining bitfields, moving members to remove alignment holes and padding.help + man
--seek_bytes BYTESSeek COUNT input recordshelp
--size_bytes BYTESRead only this number of bytes from this point onwardshelp
--skip COUNTSkip COUNT input records.help + man
--skip_emitting_atomic_typedefsDo not emit 'typedef _Atomic int atomic_int' & friends when used with options like --compile.help + man
--skip_encoding_btf_decl_tagDo not encode decl tags in BTF.help + man
--skip_encoding_btf_enum64Do not encode ENUM64sin BTF.help + man
--skip_encoding_btf_type_tagDo not encode type tags in BTF.help + man
--skip_encoding_btf_varsDo not encode any VARs in BTF [if this is not specified, only percpu variables are encoded.help + man
--skip_missingskip missing types passed to -C rather than stophelp
--sortSort the output by type name, maybe this will grow to allow sorting by other criteria.help + man
--structsShow only structs, all the other filters apply, i.e. to show just the sizes of all structs combine --structs with --sizes, etc.help + man
--supported_btf_featuresShow set of BTF features supported by --btf_features option and exit.help + man
--suppress_aligned_attributeSuppress forced alignment markers, so that one can compare BTF or CTF output, that don't have that info, to output from DWARF >= 5.help + man
--suppress_force_paddingsSuppress bitfield forced padding at the end of structs, as this requires something like DWARF's DW_AT_alignment, so that one can compare BTF or CTF output, that don't have that info.help + man
--suppress_packedSuppress the output of the inference of __attribute__((__packed__)), so that one can compare BTF or CTF output, the inference algorithm uses things like DW_AT_alignment, so until it is improved to…help + man
-s, --sizesShow size of classes.help + man
-S, --show_reorg_stepsShow the struct layout at each reorganization step.help + man
-t, --separator SEPUse SEP as the field separator.help + man
-T, --nr_definitionsShow how many times struct was defined.help + man
--unionsShow only unions, all the other filters apply, i.e. to show just the sizes of all unions combine --union with --sizes, etc.help + man
-u, --defined_inShow CUs where CLASS_NAME (-C) is defined.help + man
-V, --verbosebe verbosehelp + man
--with_embedded_flexible_arrayShow only structs that have an embedded flexible array, i.e., a contained struct that has flexible array(s) "in the middle".help + man
--with_flexible_arrayShow only structs that have a flexible array.help + man
-w, --word_size WORD_SIZEChange the arch word size to WORD_SIZE.help + man
-x, --exclude PREFIXExclude PREFIXed classes.help + man
-X, --cu_exclude PREFIXExclude PREFIXed compilation units.help + man
-z, --hole_size_ge HOLE_SIZEShow only structs with at least one hole greater or equal to HOLE_SIZE.help + man
-Z, --ctf_encodeEncode as CTF: DISABLED, consider helping porting to libctfhelp
-?, --helpGive this help listhelp
--usageGive a short usage messagehelp
--versionShow a traditional string version, i.e.: "v1.18".help + man
--padding SIZE_PADDINGShow only structs with SIZE_PADDING bytes of padding at its end. (in the manual page but not in --help)man
--skip_encoding_btf_inconsistent_protoDo not encode functions with multiple inconsistent prototypes or unexpected register use for their parameters, where the registers used do not match calling conventions. (in the manual page but not in --help)man
-O, --dwarf_offset OFFSETShow tag with DWARF OFFSET. (in the manual page but not in --help)man
-y, --prefix_filter PREFIXInclude PREFIXed classes. (in the manual page but not in --help)man
Examples (11) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.