$ btfdiff vmlinux
$
As expected, no change, both sort to the same output, now lets add
--jobs to the DWARF case.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
To ask for sorting output, initially by name.
This is needed in 'btfdiff' to diff the output of 'pahole -F dwarf
--jobs N', where N threads will go on consuming DWARF compile units and
and pretty printing them, producing a non deterministic output.
So we need to sort the output for both BTF and DWARF, and then diff
them.
This is still not enough for some cases where different types have the
same name, things like "usb_priv" that exists in multiple DWARF compile
units, the first processed is "winning", i.e. being the only one
considered.
I have to look how BTF handles this to adopt a similar algorithm and
keep btfdiff usable as a regression test for the BTF and DWARF loader
and the BTF encoder.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Needed to defer calling printing classes to after we have all sorted out
by name with the upcoming 'pahole --sort' option, needed to make it
possible to compare 'pahole -F btf' with 'pahole -F dwarf -j', as the
multithreaded DWARF loader will not have all classes in a deterministic
order. This is needed for 'btfdiff'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
So that 'pahole --sort -F dwarf' can defer printing all classes to when
it has all of them processed and sorted.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
So that loaders such as the DWARF one can store there the DWARF handler
(Dwfl) that needs to stay live while tools use the core tags (struct
class, struct union, struct tag, etc) because they point to strings that
are managed by Dwfl, so we have to defer dwfl_end() to after tools are
done processing the core tags.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Introduce first parallell DWARF loading, test it, then move on to use it
together with BTF encoding.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Prep work for multithreaded DWARF loading, when there will be concurrent
access to this data structure.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Another simplification made possible by using a plain char string
instead of string_t, that was only needed in the core as prep work
for CTF encoding.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Another simplification made possible by using a plain char string
instead of string_t, that was only needed in the core as prep work
for CTF encoding.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Another simplification made possible by using a plain char string
instead of string_t, that was only needed in the core as prep work
for CTF encoding.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Another simplification made possible by using a plain char string
instead of string_t, that was only needed in the core as prep work
for CTF encoding.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
They call each other, so do the three at once.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Since we stopped using per-cu obstacks we don't need it. If we ever
want to use it we can do per thread obstacks.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Go on processing CUs till we have everything sorted out, which includes
the --header type.
On a file with DWARF info where the header type was the last to be found
it wasn't being resolved and the tool fails to resolve header variable
references and emits this misleading error message:
⬢[acme@toolbox pahole]$ pahole ~/bin/perf --header=perf_file_header --seek_bytes '$header.data.offset' --size_bytes='$header.data.size' -C 'perf_event_header(sizeof,type,type_enum=perf_event_type)' < perf.data
pahole: --seek_bytes ($header.data.offset) makes reference to --header but it wasn't specified
⬢[acme@toolbox pahole]$
And that 'struct perf_file_header' _is_ in one of the CUs in ~/bin/perf:
⬢[acme@toolbox pahole]$ pahole ~/bin/perf -C perf_file_header
struct perf_file_header {
u64 magic; /* 0 8 */
u64 size; /* 8 8 */
u64 attr_size; /* 16 8 */
struct perf_file_section attrs; /* 24 16 */
struct perf_file_section data; /* 40 16 */
struct perf_file_section event_types; /* 56 16 */
/* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */
long unsigned int adds_features[4]; /* 72 32 */
/* size: 104, cachelines: 2, members: 7 */
/* last cacheline: 40 bytes */
};
⬢[acme@toolbox pahole]$
With this fix all the records are printed.
This probably wasn't noticed before because most tests were made with a
~/bin/perf file with BTF information, i.e. just one "CU", so the logic
of deferring the pretty printing till everything gets resolved wasn't
being exercised properly.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
It was unconditionally reading from 'stdin', when a 'fp' is supplied.
Fix this as now we'll stop unconditionally reading from stdin for the
pretty printer.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Now that we stopped using string indexes, no need for that, just set
namespace->name with the new class name.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
We were using this just for the ctf_encoder, that never really got
complete, so ditch it.
For BTF the strings table is done by libbpf, so we don't need it there
either.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
As we'll implement that kabi_prefix thing there and without using global
variables.
This is because we're stopping usage of strings.c, where the kabi_prefix
feature was implemented.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>