Commit Graph

39 Commits

Author SHA1 Message Date
Arnaldo Carvalho de Melo c2b7b8c208 pahole: Prep 1.23
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-12-08 09:19:32 -03:00
Arnaldo Carvalho de Melo f02af2553e pahole: Prep 1.22
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-08-23 09:48:58 -03:00
Arnaldo Carvalho de Melo 739bc50b90 cmake: Add a module to find if obstack is in a separate library
The main musl libc, used in Alpine Linux, doesn't have argp support, so
check if it is somewhere else, maybe in the musl-obstack package.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-08-20 16:40:27 -03:00
Arnaldo Carvalho de Melo 3f70d31571 cmake: Add a module to find if argp is in a separate library
The musl libc, used in Alpine Linux, doesn't have argp support, so check
if it is somewhere else, maybe in the argp-standalone package.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-08-20 16:40:27 -03:00
Arnaldo Carvalho de Melo 9fed416b38 MANIFEST: Add lib/include/bpf
The tarball wasn't working without this file:

  [ 32%] Building C object CMakeFiles/dwarves.dir/btf_encoder.c.o
  /tmp/dwarves-1.22/btf_encoder.c:18:10: fatal error: bpf/btf.h: No such file or directory
   #include <bpf/btf.h>
            ^~~~~~~~~~~
  compilation terminated.

Cc: Luca Boccassi <bluca@debian.org>
Fixes: 82756ea3ea ("libbpf: Fixup patch to allow to use packaged version")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-08-20 16:40:27 -03:00
Arnaldo Carvalho de Melo b5140d5e6c MANIFEST: Remove long gone strings header files
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-08-20 16:40:27 -03:00
Arnaldo Carvalho de Melo 02fd228f6a MANIFEST: Add buildcmd.sh
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-08-20 16:40:27 -03:00
Arnaldo Carvalho de Melo 743f2536d8 btf_encoder: Move libbtf.c to btf_encoder.c, the only user of its functions
All those functions now operate on a 'struct btf_encoder' object, there
is no need to make them visible outside the btf_encoder.c source file,
so move them all there and make them static.

This leads to some savings as the compiler is free to optimize further,
inlining stuff used in just one place, etc:

Before, for encoding then reading we have:

  ⬢[acme@toolbox pahole]$ rm -f vmlinux.btf ; perf stat -r5 pahole -j vmlinux.btf vmlinux && perf stat -r5 btfdiff vmlinux vmlinux.btf

   Performance counter stats for 'pahole -j vmlinux.btf vmlinux' (5 runs):

            8,546.56 msec task-clock:u              #    0.989 CPUs utilized            ( +-  0.71% )
                   0      context-switches:u        #    0.000 /sec
                   0      cpu-migrations:u          #    0.000 /sec
             775,699      page-faults:u             #   89.802 K/sec                    ( +-  0.00% )
      34,082,471,148      cycles:u                  #    3.946 GHz                      ( +-  0.22% )  (83.33%)
         636,039,662      stalled-cycles-frontend:u #    1.87% frontend cycles idle     ( +-  1.69% )  (83.33%)
       4,895,524,778      stalled-cycles-backend:u  #   14.38% backend cycles idle      ( +-  2.10% )  (83.33%)
      77,379,632,646      instructions:u            #    2.27  insn per cycle
                                                    #    0.07  stalled cycles per insn  ( +-  0.04% )  (83.33%)
      18,185,560,802      branches:u                #    2.105 G/sec                    ( +-  0.03% )  (83.34%)
         149,715,849      branch-misses:u           #    0.82% of all branches          ( +-  0.15% )  (83.34%)

              8.6412 +- 0.0612 seconds time elapsed  ( +-  0.71% )

   Performance counter stats for 'btfdiff vmlinux vmlinux.btf' (5 runs):

            7,168.97 msec task-clock:u              #    1.016 CPUs utilized            ( +-  0.50% )
                   0      context-switches:u        #    0.000 /sec
                   0      cpu-migrations:u          #    0.000 /sec
             727,965      page-faults:u             #  103.257 K/sec                    ( +-  0.00% )
      27,339,019,686      cycles:u                  #    3.878 GHz                      ( +-  0.17% )  (83.28%)
         511,689,773      stalled-cycles-frontend:u #    1.88% frontend cycles idle     ( +-  1.84% )  (83.34%)
       3,677,090,126      stalled-cycles-backend:u  #   13.53% backend cycles idle      ( +-  1.47% )  (83.35%)
      66,182,032,226      instructions:u            #    2.44  insn per cycle
                                                    #    0.06  stalled cycles per insn  ( +-  0.02% )  (83.35%)
      15,747,149,247      branches:u                #    2.234 G/sec                    ( +-  0.02% )  (83.36%)
          98,013,024      branch-misses:u           #    0.62% of all branches          ( +-  0.21% )  (83.33%)

              7.0554 +- 0.0357 seconds time elapsed  ( +-  0.51% )

  ⬢[acme@toolbox pahole]$

Then, with this patch:

  ⬢[acme@toolbox pahole]$ rm -f vmlinux.btf ; perf stat -r5 pahole -j vmlinux.btf vmlinux && perf stat -r5 btfdiff vmlinux vmlinux.btf

   Performance counter stats for 'pahole -j vmlinux.btf vmlinux' (5 runs):

            8,280.48 msec task-clock:u              #    0.975 CPUs utilized            ( +-  0.72% )
                   0      context-switches:u        #    0.000 /sec
                   0      cpu-migrations:u          #    0.000 /sec
             775,699      page-faults:u             #   91.481 K/sec                    ( +-  0.00% )
      33,265,078,702      cycles:u                  #    3.923 GHz                      ( +-  0.32% )  (83.32%)
         725,690,346      stalled-cycles-frontend:u #    2.16% frontend cycles idle     ( +-  1.76% )  (83.34%)
       4,803,211,469      stalled-cycles-backend:u  #   14.33% backend cycles idle      ( +-  2.43% )  (83.34%)
      77,162,277,929      instructions:u            #    2.30  insn per cycle
                                                    #    0.07  stalled cycles per insn  ( +-  0.06% )  (83.34%)
      18,139,715,894      branches:u                #    2.139 G/sec                    ( +-  0.03% )  (83.34%)
         149,609,552      branch-misses:u           #    0.82% of all branches          ( +-  0.16% )  (83.33%)

              8.4921 +- 0.0630 seconds time elapsed  ( +-  0.74% )

   Performance counter stats for 'btfdiff vmlinux vmlinux.btf' (5 runs):

            7,018.11 msec task-clock:u              #    1.013 CPUs utilized            ( +-  0.68% )
                   0      context-switches:u        #    0.000 /sec
                   0      cpu-migrations:u          #    0.000 /sec
             727,949      page-faults:u             #  105.207 K/sec                    ( +-  0.00% )
      26,632,191,985      cycles:u                  #    3.849 GHz                      ( +-  0.31% )  (83.35%)
         496,648,058      stalled-cycles-frontend:u #    1.87% frontend cycles idle     ( +-  2.02% )  (83.29%)
       3,437,243,040      stalled-cycles-backend:u  #   12.92% backend cycles idle      ( +-  0.90% )  (83.33%)
      66,192,034,237      instructions:u            #    2.49  insn per cycle
                                                    #    0.05  stalled cycles per insn  ( +-  0.03% )  (83.34%)
      15,750,883,004      branches:u                #    2.276 G/sec                    ( +-  0.03% )  (83.35%)
          97,544,298      branch-misses:u           #    0.62% of all branches          ( +-  0.12% )  (83.36%)

              6.9247 +- 0.0478 seconds time elapsed  ( +-  0.69% )

  ⬢[acme@toolbox pahole]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-06-09 13:34:15 -03:00
Arnaldo Carvalho de Melo 25ad41e7b5 pahole: Prep 1.21
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-04-09 19:39:15 -03:00
Arnaldo Carvalho de Melo 0d415f68c4 pahole: Prep 1.20
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-02-03 21:45:01 -03:00
Arnaldo Carvalho de Melo dd15aa4b0a dwarves: Prep v1.19
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-11-23 09:52:44 -03:00
Arnaldo Carvalho de Melo 75f3520fed strings: Rename strings.h to avoid clashing with /usr/include/strings.h
This was detected with:

  In file included from /home/acme/git/pahole/strings.h:9,
                   from /usr/include/string.h:432,
                   from /home/acme/git/pahole/lib/bpf/src/libbpf_common.h:12,
                   from /home/acme/git/pahole/lib/bpf/src/libbpf.h:20,
                   from /home/acme/git/pahole/lib/bpf/src/ringbuf.c:20:
  /home/acme/git/pahole/lib/bpf/src/btf.h:33:11: error: expected ‘;’ before ‘void’
     33 | LIBBPF_API void btf__free(struct btf *btf);
        |           ^~~~~
        |           ;

libbpf_common.h has:

  #include <string.h>

  #ifndef LIBBPF_API
  #define LIBBPF_API __attribute__((visibility("default")))
  #endif

So before defining LIBBPF_API it includes libc's string.h that in turn
includes pahole's strings.h and now it includes:

  #include "lib/bpf/src/btf.h"

That will need the LIBBPF_API, b00m.

So lets just rename pahole's strings.h to pahole_strings.h to avoid this
pitfall.

This patch was moved to before this problem takes place so that we keep
everything bisectable.

Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-10-20 17:11:34 -03:00
Arnaldo Carvalho de Melo fdc639188c dwarves: Prep v1.18
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-10-02 17:29:59 -03:00
Arnaldo Carvalho de Melo e709afe6a9 dwarves: Prep v1.17
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-03-13 16:36:02 -03:00
Domenico Andreoli cb17f94f46 Add changes-v1.16 to the MANIFEST file
Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-01-17 13:34:37 -03:00
Arnaldo Carvalho de Melo ca294eebfc MANIFEST: Add missing files
Domenico reported that the README.DEBUG and changes-v1.13 files were not
in MANIFEST, so were not making into the release tarballs, fix that.

Reported-by: Domenico Andreoli <domenico.andreoli@linux.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-09-20 16:23:44 -03:00
Arnaldo Carvalho de Melo 8288d88423 MANIFEST: Add missing files to generate the tarball
btf_loader.c and the libbpf obtained via the git module are needed to
be able to build from the tarball generated via:

  tar cvfj rpm/SOURCES/dwarves-1.13.tar.bz2 `cat MANIFEST`

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-04-16 20:55:59 -03:00
Arnaldo Carvalho de Melo 92a4118812 v1.13: New release
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-04-16 16:13:19 -03:00
Arnaldo Carvalho de Melo 92417082aa MANIFEST: Add missing COPYING file
That wasn't going into the tarballs generated when releasing new
versions.

Reported-by: Michal Schmidt <mschmidt@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-09-11 11:22:41 -03:00
Arnaldo Carvalho de Melo 4a21c5c8db v1.12 - New Release
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-08-16 16:15:27 -03:00
Peter Jones c9d1352dfe Add scncopy to CMakeLists.txt
Add scncopy to the build.

Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-01-12 14:23:54 -02:00
Arnaldo Carvalho de Melo da0781e405 MANIFEST: Remove the .py extension for regtest
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-11-07 16:59:20 -02:00
Arnaldo Carvalho de Melo 68bac65d2e regtest: Convert the regtests to a python script and include it in the repo
I'm using it using a directory with all debuginfo packages in fedora, so
that I can run a before and after with different tools (pahole, pfunct),
and check the differences after some change.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-08-20 18:47:57 -03:00
Arnaldo Carvalho de Melo e429f8efbb dwarves: Add an rbtree for the functions in a cu
That is used by cus__find_function_by_addr & cu__func_function_by_addr.

First user is pfunct --addr, but this is really for pfunct --annotate, that
will process a perf.data file generated by 'perf report', load the debugging
info and regenerate the functions (pfunct -TVi like) that had hits, using
libdisasm to show the assembly code, etc.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-06-04 14:56:44 -03:00
Arnaldo Carvalho de Melo 602e02fc28 MANIFEST: add missing files
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-04-23 14:49:44 -03:00
Arnaldo Carvalho de Melo 7b6c135e7c pahole: finally the beginnings of a man page
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-02-11 12:19:46 -02:00
Arnaldo Carvalho de Melo 2dfa5fe6ea [DWARVES]: Initial CTF support
Using a library written by David S. Miller.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-03-04 15:37:02 -03:00
Arnaldo Carvalho de Melo b3489e14eb [DWARVES]: Move all the DWARF specific loading routines to dwarf_loader.c
In libdwarves.so well continue using DW_TAG_ entries and types for now, but its
becoming non-DWARF specific as will be demonstrated with the introduction of
ctf_loader.c in the upcoming csets.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-03-03 13:50:44 -03:00
Arnaldo Carvalho de Melo 833ac2782c [RPM]: 1.6 release
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-02-11 12:04:14 -02:00
Arnaldo Carvalho de Melo 2c01420b51 [CMAKE]: Add linux.blacklist.cu to the install targets
Also updating the manifest and lib/Makefile to find it in
/usr/share/dwarves/runtime.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-12-06 17:43:20 -02:00
Arnaldo Carvalho de Melo 1382ee83da [SYSCSE]: System Call Sign Extender
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-06-12 15:53:46 -03:00
Arnaldo Carvalho de Melo 776f5a6418 [PAHOLE]: Use a common separator in the formatters
For now its a tab, will be configurable in the next cset.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
2007-05-23 16:15:21 -03:00
Arnaldo Carvalho de Melo fbb50fc851 [LIB]: Move class__reorganize & friends to a new lib: libdwarves_reorganize
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
2007-05-07 00:30:02 -03:00
Arnaldo Carvalho de Melo 05351ece16 [LIB]: Move the __emit functions to a separate library, libdwarves_emit
To isolate functionality only used in utilities such as ctracer.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
2007-05-06 14:50:28 -03:00
Arnaldo Carvalho de Melo ce9d7e11fe [CTRACER]: Lots of improvements
1. We now use relayfs
2. ostra-cg is shipped and used in the Makefile
3. README.ctracer has all the details

I followed README.ctracer and the result, in my workstation, was this one:
http://oops.ghostprotocols.net:81/acme/dwarves/callgraphs/acme_eating_his_dog_food/6.html

I've started on the 6th page as it is more interesting, having tcp and netlink
callchains, don't be disappointed by some pages having just one level of
nesting, that is just the lack of containers and aliases (to follow tcp_sock,
skb->sk, etc) from the OSTRA days, but it's getting there! :-)

Ah, it is collecting all the base types in the specified struct by doing a
struct "view", i.e. trimming the struct to have just members that are
"reducible" to basic types (int, long, char, signed and unsigned), then
reorganizing it with the code introduced in pahole --reorganize to get it to
the best layout possible, reducing the size of the entry probe points trace
entries.

Updated rpms are available at the usual place:

http://oops.ghostprotocols.net:81/acme/dwarves/rpm/

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-02-02 15:15:27 -02:00
Arnaldo Carvalho de Melo b7cad1782d [RPM]: Release 13
Adding pglobal and the latest advancements in pahole --reorganize.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-02-02 12:30:56 -02:00
Arnaldo Carvalho de Melo 9555603666 [RPM]: 9th release
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-01-27 19:42:54 -02:00
Arnaldo Carvalho de Melo fab0db03ea [PDWTAGS]: New tool
Pretty prints all of the tags, still needs a bit more work.

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
2007-01-18 21:13:56 -02:00
Arnaldo Carvalho de Melo e988381a48 [MANIFEST]: Add a MANIFEST file to use when building the tarball
[acme@newtoy pahole]$ tar cvfj rpm/SOURCES/pahole-0.tar.bz2 $(cat MANIFEST)

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2007-01-11 16:43:18 -02:00