Go to file
Arnaldo Carvalho de Melo ab714acec8 pahole: Support zero sized base type arrays
Like the one in:

  $ pahole -C perf_record_sample ~/bin/perf
  struct perf_record_sample {
  	struct perf_event_header   header;               /*     0     8 */
  	__u64                      array[];              /*     8     0 */

  	/* size: 8, cachelines: 1, members: 2 */
  	/* last cacheline: 8 bytes */
  };
  $

So now we get those:

  $ perf report -D
  <SNIP>
  0x420 [0x60]: event: 10
  . ... raw event: size 96 bytes
  .  0000:  0a 00 00 00 02 00 60 00 50 7e 00 00 50 7e 00 00  ......`.P~..P~..
  .  0010:  00 90 b6 d8 ff 7f 00 00 00 20 00 00 00 00 00 00  ..<B6><D8><FF>.... ......
  .  0020:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  .  0030:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  .  0040:  05 00 00 00 02 10 00 00 5b 76 64 73 6f 5d 00 00  ........[vdso]..
  .  0050:  50 7e 00 00 50 7e 00 00 e7 c5 2a c3 aa 90 01 00  P~..P~..<E7><C5>*<C3><AA>...

  440538069911015 0x420 [0x60]: PERF_RECORD_MMAP2 32336/32336: [0x7fffd8b69000(0x2000) @ 0 00:00 0 0]: r-xp [vdso]

  0x480 [0x28]: event: 9
  . ... raw event: size 40 bytes
  .  0000:  09 00 00 00 01 40 28 00 27 0b c0 88 ff ff ff ff  .....@(.'.<C0>.<FF><FF><FF><FF>
  .  0010:  50 7e 00 00 50 7e 00 00 44 35 2b c3 aa 90 01 00  P~..P~..D5+<C3><AA>...
  .  0020:  01 00 00 00 00 00 00 00                          ........

  440538069939524 0x480 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4001): 32336/32336: 0xffffffff88c00b27 period: 1 addr: 0
   ... thread: sleep:32336
   ...... dso: <not found>

  0x4a8 [0x28]: event: 9
  . ... raw event: size 40 bytes
  .  0000:  09 00 00 00 01 40 28 00 27 0b c0 88 ff ff ff ff  .....@(.'.<C0>.<FF><FF><FF><FF>
  .  0010:  50 7e 00 00 50 7e 00 00 90 4a 2b c3 aa 90 01 00  P~..P~...J+<C3><AA>...
  .  0020:  01 00 00 00 00 00 00 00                          ........

  440538069944976 0x4a8 [0x28]: PERF_RECORD_SAMPLE(IP, 0x4001): 32336/32336: 0xffffffff88c00b27 period: 1 addr: 0

  $ pahole --seek_bytes=0x420 -C 'perf_event_header(sizeof=size,type=type,type_enum=perf_event_type)' --count 3 ~/bin/perf < perf.data
  {
  	.header = 0x0a 0x00 0x00 0x00 0x02 0x00 0x60 0x00,
  	.pid = 0x7e50,
  	.tid = 0x7e50,
  	.start = 0x7fffd8b69000,
  	.len = 0x2000,
  	.pgoff = 0,
  	.maj = 0,
  	.min = 0,
  	.ino = 0,
  	.ino_generation = 0,
  	.prot = 0x5,
  	.flags = 0x1002,
  	.filename = "[vdso]",
  },
  {
  	.header = 0x09 0x00 0x00 0x00 0x01 0x40 0x28 0x00,
  	.array = { 0xffffffff88c00b27, 0x7e5000007e50, 0x190aac32b3544, 0x1 },
  },
  {
  	.header = 0x09 0x00 0x00 0x00 0x01 0x40 0x28 0x00,
  	.array = { 0xffffffff88c00b27, 0x7e5000007e50, 0x190aac32b4a90, 0x1 },
  },
  $

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-08-05 15:16:19 -03:00
cmake/modules cmake: libebl was merged into libdw 2020-02-03 08:42:13 +01:00
lib libbpf: Get latest libbpf 2020-02-03 08:43:10 +01:00
man-pages pahole: Introduce --seek_bytes 2020-07-01 09:25:57 -03:00
ostra ostra: Initial python3 conversion 2019-04-23 12:02:22 -03:00
rpm/SPECS spec: Fix date 2020-06-12 09:21:52 -03:00
.gitignore pahole: Add build dir, config.h to .gitignore 2019-02-11 12:55:46 -03:00
.gitmodules pahole: add libbpf as submodule under lib/bpf 2019-02-11 12:56:40 -03:00
CMakeLists.txt dwarves: Prep v1.17 2020-03-13 16:36:02 -03:00
COPYING [LICENSE]: Add COPYING file and add missing license info on some files 2007-12-17 14:15:42 -02:00
MANIFEST dwarves: Prep v1.17 2020-03-13 16:36:02 -03:00
NEWS dwarves: Prep v1.17 2020-03-13 16:36:02 -03:00
README [CMAKE]: Make the default install prefix be /usr/local 2007-04-19 18:01:47 -03:00
README.DEBUG README.DEBUG: Add an extra step to make the instructions cut'n'exec 2017-12-14 14:15:54 -03:00
README.btf v1.13: New release 2019-04-16 16:13:19 -03:00
README.ctracer ctracer: update README.ctracer, f9 has the dwarves 2008-10-29 08:54:53 -02:00
README.tarball docs: Add command line to generate tarball with a prefix 2020-03-12 16:55:15 -03:00
btf_encoder.c btf_encoder: Teach pahole to store percpu variables in vmlinux BTF. 2020-08-05 14:51:17 -03:00
btf_encoder.h btf_encoder: Teach pahole to store percpu variables in vmlinux BTF. 2020-08-05 14:51:17 -03:00
btf_loader.c dwarves: Allow setting a struct/class member as the source of sizeof() 2020-08-05 15:16:19 -03:00
btfdiff v1.13: New release 2019-04-16 16:13:19 -03:00
changes-v1.13 v1.13: New release 2019-04-16 16:13:19 -03:00
changes-v1.16 dwarves: Prep v1.16 2019-12-16 11:43:53 -03:00
changes-v1.17 dwarves: Prep v1.17 2020-03-13 16:36:02 -03:00
codiff.c codiff: Remove unused filenames variable 2019-07-01 16:41:02 -03:00
config.h.cmake [DWARVES] Fixes a FIXME relating to a missing elf (libdw) symbol check. 2008-02-12 21:08:49 -02:00
ctf.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
ctf_encoder.c libctf: The type_ids returned are uint32_t fixup where it was uint16_t 2019-03-11 11:44:53 -03:00
ctf_encoder.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
ctf_loader.c dwarves: Allow setting a struct/class member as the source of sizeof() 2020-08-05 15:16:19 -03:00
ctfdwdiff ctfdwdiff: Don't ask for variables and inline expansions in pfunct 2009-03-31 19:21:46 -03:00
ctracer.c dwarves: Adopt tag__is_base_type() from ctrace.c 2020-06-24 14:14:33 -03:00
dtagnames.c Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
dutil.c dutil: Add a strlwr() helper to lowercase a string, returning it 2020-08-05 15:16:19 -03:00
dutil.h dutil: Add a strlwr() helper to lowercase a string, returning it 2020-08-05 15:16:19 -03:00
dwarf_loader.c dwarves: Allow setting a struct/class member as the source of sizeof() 2020-08-05 15:16:19 -03:00
dwarves.c dwarves: Introduce cu__find_enumeration_by_name() 2020-08-05 15:16:19 -03:00
dwarves.h pahole: Introduce 'type_enum' class argument 2020-08-05 15:16:19 -03:00
dwarves_emit.c emit: Remove unused 'is_pointer' variable 2019-07-02 10:27:16 -03:00
dwarves_emit.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
dwarves_fprintf.c fprintf: Fixup truncation possibility pointed out by gcc -O2 2019-12-16 11:19:47 -03:00
dwarves_reorganize.c reorganize: Enclose bitfield routines under ifdef 2019-07-02 12:28:50 -03:00
dwarves_reorganize.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
elf_symtab.c Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
elf_symtab.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
elfcreator.c elfcreator: Address initialization warning emitted by 'gcc -O6' 2019-12-16 11:19:47 -03:00
elfcreator.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
fullcircle v1.13: New release 2019-04-16 16:13:19 -03:00
gobuffer.c gobuffer: Do not crash on object without any public symbols 2020-01-17 13:54:15 -03:00
gobuffer.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
hash.h [DWARVES]: Use a hash table for the tags in a CU 2008-02-11 11:47:17 -02:00
libbtf.c btf_encoder: Teach pahole to store percpu variables in vmlinux BTF. 2020-08-05 14:51:17 -03:00
libbtf.h btf_encoder: Teach pahole to store percpu variables in vmlinux BTF. 2020-08-05 14:51:17 -03:00
libctf.c libctf: Enlarge the 'cmd' buffer to not possibly truncate the pathname 2019-07-02 12:14:02 -03:00
libctf.h libctf: The type_ids returned are uint32_t fixup where it was uint16_t 2019-03-11 11:44:53 -03:00
list.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
pahole.c pahole: Support zero sized base type arrays 2020-08-05 15:16:19 -03:00
pdwtags.c core: Allow the loaders to advertise features they have 2019-04-15 14:45:27 -03:00
pfunct.c btf_loader: Add support for BTF_KIND_FUNC 2019-11-05 12:04:23 -03:00
pglobal.c pglobal: Allow passing the format path specifier, to use with BTF 2019-10-24 08:17:16 -03:00
prefcnt.c prefcnt: Avoid ambiguous else with for_each macro 2019-07-02 12:31:57 -03:00
rbtree.c Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
rbtree.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
regtest regtest: Accept --diff instad of plain 'diff' as long option 2012-05-14 19:36:58 -03:00
scncopy.c Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
strings.c Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
strings.h Adopt SPDX-License-Identifier 2019-01-18 15:41:48 -03:00
syscse.c dwarves: Make function__for_each_parameter receive 'cu' arg 2020-01-09 14:16:52 -03:00

README

Build instructions:

1. install cmake
2. mkdir build
3. cd build
4. cmake -D__LIB=lib ..
5. make install

Default is to be installed on /usr/local, see rpm spec file for
installing on other places.

Known to work scenarios:

Mandriva Cooker:

cmake 2.4.5-1mdv2007.1
libelfutils1-devel 0.123-1mdv2007.1

Debian Unstable:

cmake 2.4.5-1
libdw-dev 0.123-2

Fedora Core 6:

cmake 2.4.5-2.fc6
elfutils-devel 0.126-1.fc6