Skip to content

Commit

Permalink
pahole: Show the file where a struct was used
Browse files Browse the repository at this point in the history
To help with using just that object file, avoiding processing big files
such as vmlinux, e.g.:

  $ pahole -I vmlinux
<SNIP>
  /* Used at: /home/acme/git/perf/init/main.c */
  /* <1f4a5> /home/acme/git/perf/arch/x86/include/asm/orc_types.h:85 */
  struct orc_entry {
          s16                        sp_offset;            /*     0     2 */
          s16                        bp_offset;            /*     2     2 */
          unsigned int               sp_reg:4;             /*     4:28  4 */
          unsigned int               bp_reg:4;             /*     4:24  4 */
          unsigned int               type:2;               /*     4:22  4 */

          /* size: 6, cachelines: 1, members: 5 */
          /* padding: 65534 */
          /* bit_padding: 22 bits */
          /* last cacheline: 6 bytes */

          /* BRAIN FART ALERT! 6 != 8 + 0(holes), diff = -2 */
  };
<SNIP>

So I noticed that BFA, need to work on it, to make the testing process
faster, better not process vmlinux.o, instead, do:

  $ pahole -C orc_entry ${kernel_build_dir}/init/main.o

Much faster, as main.o is much smaller than the vmlinux file.

Now to fix the processing of 'struct orc_entry'.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
acmel committed Dec 15, 2017
1 parent 2dd87be commit 81466af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dwarves_fprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,8 @@ size_t tag__fprintf(struct tag *tag, const struct cu *cu,
++tag->recursivity_level;

if (pconf->show_decl_info) {
printed += fprintf(fp, "%.*s", pconf->indent, tabs);
printed += fprintf(fp, "/* Used at: %s */\n", cu->name);
printed += fprintf(fp, "%.*s", pconf->indent, tabs);
printed += tag__fprintf_decl_info(tag, cu, fp);
}
Expand Down

0 comments on commit 81466af

Please sign in to comment.