Age | Commit message (Collapse) | Author |
|
mainline-extservices-release
Change-Id: Ic0f3ff24a6d8cf209b1949b4fa6b62aa15ed4b5e
|
|
am: 469cb9091d
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2394172
Change-Id: I9f49550ee21b814d17a765432e84836dc41e8a20
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2394172
Change-Id: If9ac312ffb153d2e0e0f2250b89d2efcf6e8405e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2394172
Change-Id: I39665e681e7199acb59ff3b7a3a6dda5190cd4ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update libtraceevent
For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md
Test: TreeHugger
Change-Id: If05b680336283ce6f5638029e6edde10ef774581
|
|
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Since Linux kernel 5.15 (specifically with the addition of 54357f0c9149c
("tracing: Add migrate-disabled counter to tracing output.")), the
common_preempt_count field of each event also held the "migrate-disable"
field in the most significant byte. This needs to be accounted for as when
the migrate disable field is set, it will show:
systemd--268 3d..3 15368.334398: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..13 15368.334399: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
systemd--268 3d..12 15368.334400: irq_disable: caller=ct_irq_enter_irqson+0x17 parent=0x0
systemd--268 3d..13 15368.334400: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..12 15368.334401: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
Where the events above have:
preempt-count migrate-disable
------------- ---------------
3 0
3 1
2 1
3 1
2 1
That is, in the above print of "3d..13", the '3' of the '13' is the
preempt count and the '1' is the migrate disable. But it really should be:
systemd--268 3d..3. 15368.334398: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..31 15368.334399: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
systemd--268 3d..21 15368.334400: irq_disable: caller=ct_irq_enter_irqson+0x17 parent=0x0
systemd--268 3d..31 15368.334400: rcu_dyntick: --= 4000000000000002 4000000000000000 0x63c
systemd--268 3d..21 15368.334401: rcu_dyntick: ++= 4000000000000000 4000000000000002 0x63c
Where the migrate disabled is always displayed with a '.' when zero and
its hex count when set.
Link: https://lore.kernel.org/linux-trace-devel/20230109184034.359f10ad@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
The raw prints that uses the parsed fields directly, had a bug in it where
the check to catch if reading the event went beyond the event size it
would warn. But instead of testing against the event size, it was testing
against the field size. The test was suppose to test:
field->offset + field->size > data_size
Which would catch an overflow, but instead it was testing:
field->offset + field->size > field->size
Which will always be true! (well, if the field was not at the beginning of
the data, which is always is due to meta data).
Have it check the data size and not the field size.
Link: https://lore.kernel.org/linux-trace-devel/20230106142341.15df4486@gandalf.local.home
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=216896
Reported-by: Douglas RAILLARD <douglas.raillard@arm.com>
Fixes: 09f02890358a2 ("libtraceevent: Improve tep_print_field()")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
libtraceevent-func_apis.txt
When a man page has more than 9 APIs described in it, asciidoc starts to
complain. As there were more functions being added to the function tep
interface, the man page that described the function interface was split to
have the "find" functions in a separate man page. But two functions were
left behind in the old libtraceevent-func_apis.txt man page:
tep_find_function()
tep_find_function_address()
This causes issue because it becomes ambiguous to which man page to read,
and one may become out of date. Remove the description from the
libtraceevent-func_apis.txt as they are described in
libtraceevent-func_find.txt man page.
Link: https://lore.kernel.org/linux-trace-devel/20221224153225.ojre2c3fxktfxtj2@carbon.lan/
Link: https://lore.kernel.org/linux-trace-devel/20230104172655.145516-3-rostedt@goodmis.org
Fixes: dd8094ac7252 ("tools lib traceevent: Man pages for function related libtraceevent APIs")
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Update the check-manpages.sh script to make sure that there are no
functions that are described in more than one man page.
The output will look like this:
Found tep_find_function in libtraceevent-func_find.txt and in libtraceevent-func_apis.txt
Found tep_find_function_address in libtraceevent-func_find.txt and in libtraceevent-func_apis.txt
Link: https://lore.kernel.org/linux-trace-devel/20221224153225.ojre2c3fxktfxtj2@carbon.lan/
Link: https://lore.kernel.org/linux-trace-devel/20230104172655.145516-2-rostedt@goodmis.org
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
The stack traces only show the function name and the full address, which
can be useless for running under gdb, because the address could be
randomized, and to find the locations within the functions, the offsets
from the start of the function really need to be displayed and not just
the full address, as the address isn't known by gdb.
Have the function plugin "offset" option affect stack traces too. That
way, there's a way to display the offsets of the functions too.
Link: https://lore.kernel.org/linux-trace-devel/20221219224258.68a86565@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
As stat() can overflow if a 32 bit user space reads a file on a file
system that has inodes greater than MAX_INT. Compile with
_FILE_OFFSET_BITS=64 that mitigates this problem on 32 bit user space.
Link: https://lore.kernel.org/linux-trace-devel/20221221134656.79589e83@gandalf.local.home
Reported-by: Mike Frysinger <vapier@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
The string parsing of tokens can be confused if the string has a backslash
at the end of the string. That is "\\\0" or \<nul>. The backslash will
skip the next character. If the next character is the end of the string,
it will read past the end of the string.
Check for end of buffer (less than or equal to 0), and if the next
character is the end of buffer, exit the loop regardless if the previous
character was a backslash.
Also fail the parsing of the event if the string is not terminated by the
quote that started it.
Link: https://lore.kernel.org/linux-trace-devel/20221219222630.54fc5bc5@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
When using the library with multiple threads, the global input buffer
pointer gets modified concurrently by each thread. An easy fix for the
problems that arise is to give each struct tep_handle its own input
buffer pointer.
Link: https://lore.kernel.org/linux-trace-devel/20221216102754.257174-1-balbi@kernel.org
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
defined
If the tep handle has not defined a long size yet, then fail to parse
sizeof(long) instead of giving a wrong answer.
Link: https://lore.kernel.org/linux-trace-devel/20221214093649.5a8e43af@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Now that some sizeof() calls can be parsed, create a unit test to test the
process_sizeof() algorithm.
Link: https://lore.kernel.org/linux-trace-devel/20221214084113.211924a7@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Parse sizeof() for known types as well as fields.
sizeof(int) is 4
sizeof(unsigned int) is 4
sizeof(long) is tep->long_size
sizeof(unsigned long) is tep->long_size
sizeof(long long) is 8
sizeof(unsigned long long) is 8
sizeof(REC->foo) is the field "foo" size value.
This will now parse the sample events of trace_events in the kernel.
Link: https://lore.kernel.org/linux-trace-devel/20221213233645.04fc15ed@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
It is perfectly fine if a function parameter has operators. Parse them
properly.
Link: https://lore.kernel.org/linux-trace-devel/20221213221913.0cc8e17c@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
With the new "cpumask_t" field, which is dynamic and is denoted with
"__data_loc", it needs to be processed as dynamic in size, and not as
static.
When calculating the field size, check for both the field being an array
as well as being dynamic, as it can be dynamic without being an array.
Link: https://lore.kernel.org/linux-trace-devel/20221213221651.0d36897a@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Add units tests that cover the TEP_PRINT_CPUMASK cases.
Sicne print_cpumask_to_seq() is based on a per-byte scan, add some tests
that cross byte boundaries when looking for the next non-zero byte.
Link: https://lore.kernel.org/linux-trace-devel/20221213165620.1034287-5-vschneid@redhat.com
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Douglas RAILLARD <douglas.raillard@arm.com>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Now that we can denote which bitmasks are cpumasks, it makes sense to
pretty-print them to a more user-friendly format: a cpulist.
There's two hurdles to that:
1) Estimating the required string buffer size.
I've tried to condense it down to an estimator function that is
computationally simple enough, though it overestimates by ~1/3.
For reference, this estimates:
180 bytes for NR_CPUS=64 (x86 defconfig)
911 bytes for NR_CPUS=256 (arm64 defconfig)
2) Iterating through the bits and bytes.
The kernel has a collection of carefully crafted bitmask iterators which
make this relatively simple (cf. bitmap_list_string()), but I didn't
feel justified in importing half a dozen helpers just for one function.
I've implemented a "homegrown" byte-parsing logic which isn't the
fastest, but is at least condensed to a single function.
Link: https://lore.kernel.org/linux-trace-devel/20221213165620.1034287-4-vschneid@redhat.com
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Douglas RAILLARD <douglas.raillard@arm.com>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
A cpumask event field type was recently added to Linux, which helps
distinguish any odd bitmask from a cpumask. Right now this field type is
not recognized by libtraceevent:
[ipi:ipi_send_cpumask] function __get_cpumask not defined
CPU 0 is empty
CPU 1 is empty
CPU 3 is empty
cpus=4
echo-173 [002] 11.859745: ipi_send_cpumask: [FAILED TO PARSE] cpumask=ARRAY[02,
00, 00, 00, 00, 00, 00, 00] callsite=0xffffffff81121013
Since a cpumask is still a bitmask, define the boiler plate code for this
new field type and wire it all to bitmask handling.
Link: https://lore.kernel.org/linux-trace-devel/20221213165620.1034287-3-vschneid@redhat.com
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Douglas RAILLARD <douglas.raillard@arm.com>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Testing printing cpumasks reveals an issue in print_field_raw()'s handling
of arrays: its final operation is trace_seq_putc(']'), which omits a final
'\0'.
The other cases in the function invoke trace_seq_printf() which does the
right thing, only the TEP_FIELD_IS_ARRAY case has that issue. Still, to
prevent any future surprises, add a call to trace_seq_terminate() at the
end of print_field_raw().
Link: https://lore.kernel.org/linux-trace-devel/20221213165620.1034287-2-vschneid@redhat.com
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Douglas RAILLARD <douglas.raillard@arm.com>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
The kbuffer API has never been documented. Add the man pages for the
functions that applications are likely to use.
Note, the functions:
kbuffer_set_old_format
kbuffer_raw_get
kbuffer_ptr_delta
kbuffer_translate_data
Are for internal use by trace-cmd, and really should not be used by other
applications as they are implementation specific. They are exported, so
they should be stable, but lets not encourage their use by documenting how
to use them.
Link: https://lore.kernel.org/linux-trace-devel/20221208190709.1f1dc458@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
The prototype of tep_find_function_info() was missing from the main
libtraceevent man page. Add it.
Link: https://lore.kernel.org/linux-trace-devel/20221208182146.57a87503@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Add a SAME_AS_HOST to the endian and size parameters of kbuffer_alloc()
that makes it easier for the applications that simply read the ring
buffer.
If the host has 4 byte word, it will call uname() and check the machine
value. If machine contains the string "64", it will assume that the kernel
is 64 bit and that is what the host will be considered.
Link: https://lore.kernel.org/linux-trace-devel/20221208163644.185bf199@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Update the .gitignore file with the following items:
For quilt:
.pc
patches
Editors:
.#*
Generated:
libtraceevent.pc
lib/
Generated in utest:
trace-utest
Link: https://lore.kernel.org/linux-trace-devel/20221208191514.47b40ca1@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Instead of adding a dependency of tep_handle to the kbuffer code, as
kbuffer should not reference the tep_handle, instead, it makes much more
sense to return a kbuffer descriptor from an existing tep_handle from the
tep interface.
Rename kbuffer_create() to tep_kbuffer().
Link: https://lore.kernel.org/linux-trace-devel/20221208155325.50bde2ea@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
Hit this compile error:
include/traceevent/kbuffer.h:32:39: warning: ‘struct tep_handle’ declared inside parameter list will not be visible outside of this definition or declaration
32 | struct kbuffer *kbuffer_create(struct tep_handle *tep);
kbuffer.h does not include event-parse.h, so it needs to declare
sturct tep_handle too.
Link: https://lore.kernel.org/linux-trace-devel/20221206162000.289aca7a@gandalf.local.home
Fixes: 21ba633645 ("libtraceevent: Add kbuffer_create()")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
I needed a way to get the size of a function, and instead of creating
another function that gets the size (having to look up the function by
address again), I decided it would be better to have a single function
that retrieved the name, starting address and the size.
This implements tep_find_function_info() that does just that.
Link: https://lore.kernel.org/linux-trace-devel/20221202180625.58262735@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
The kbuffer_alloc() is awkward to use as the size and endianess needs to
be passed in by enum values. Add a kbuffer_create() that only takes a tep
handle, and it determines these values via the handle instead.
Link: https://lore.kernel.org/linux-trace-devel/20221202123854.5761a742@gandalf.local.home
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
14514a1358
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084733
Change-Id: I757f8542ccd456559cdb2742d83373cee150c6df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
10e426e9fa
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084732
Change-Id: Iffb8f846380982b1389a1479e6040be78bb9f1cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
am: 8949cbffca
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084731
Change-Id: If844bfaeea95c33b9ad865085077d4b8e1039533
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084730
Change-Id: Id6d7ea471892bfd754e36040c0a5bb30185af377
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084729
Change-Id: I7910ef5f9e1beb963b7d83bba79cfc3ced8b8dbc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
dcb747da11 am: ae0d19d0cd am: 9621daca64
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084728
Change-Id: I3a96bb3fa7e42ba0bdf2d41a3609f16494770ff2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084733
Change-Id: I066c27ff79d173000bcfbe14ce87ec70c5bbad29
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084732
Change-Id: I21f67f07f176c4b8fb73e45327f5102366177bc8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084731
Change-Id: I03a191ff2903fe4d238e59e4b9cf07d44d4efb71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084730
Change-Id: I253229b3ef90b799eb749447821f8041078e8f33
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084729
Change-Id: I7fc67c13a4334775fb4cf549d32fb7d6059e4bb2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
dcb747da11 am: ae0d19d0cd
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084728
Change-Id: I15a140bcff1e3dbf19ab742435348f6a05c95469
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084733
Change-Id: Ia55721a0c88442d3d2eb2285f8116143191d4770
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084732
Change-Id: I849083b34025da2607e48f611c3ce57685a410e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084731
Change-Id: If6a77db9432c2d47377969e33510901fc45c0391
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084730
Change-Id: Icf04c591935c7f7f4c9da37801fdf46bce1a58f9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084729
Change-Id: I346e5821385526a586561bc8eb5f55c4f49597e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|
|
dcb747da11
Original change: https://android-review.googlesource.com/c/platform/external/libtraceevent/+/2084728
Change-Id: I632d61b20d869f42a89dcfde1b5c42b432074ad1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
|