Michael Jeanson [Mon, 22 Mar 2021 19:09:55 +0000 (15:09 -0400)]
configure: convert the remaining tab indent to spaces
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I452eb6ffad31ee0951f7eb2e44861dcfc49cae77
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 18:59:31 +0000 (14:59 -0400)]
configure: regroup autoconf substituted variable
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: If2938c615477604693787ea69c956a37931cef13
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 18:40:41 +0000 (14:40 -0400)]
configure: regroup automake conditionals
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I3b7f8f15ac6f8752aa2d7eb9a62e45cf4ac354f9
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 18:34:47 +0000 (14:34 -0400)]
configure: regroup C defines
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I1aa80c098f0c36640eff3113db3544bd303a815c
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 17:29:58 +0000 (13:29 -0400)]
Introduce AE_FEATURE to manage configure features
The new AE_FEATURE set of macros are wrappers over autoconf's
AC_ARG_ENABLE. The main objective is to make the m4sh code more readable
to the less seasoned autotools enthusiast among us and reduce the
duplication of code with its associated bugs.
The AE prefix was chosen to mean "Autotools EfficiOS" and is part of an
effort to standardize our custom macros across all our autotools based
projects.
Change-Id: I35268e36e70b2dd826876939e663d63d3123fa9f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 17:17:32 +0000 (13:17 -0400)]
configure: regroup os and arch specific defaults
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: Ib0f3319133ed7dfab8ee844f6bcf99dd9606d344
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 17:12:42 +0000 (13:12 -0400)]
configure: regroup library checks
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: Ieec98a3ab09c2088408b0f0bbd9bc3b605077982
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 17:06:28 +0000 (13:06 -0400)]
configure: regroup program checks
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I32c54c43a82c4b3f532b702bd733a54683167082
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 16:57:44 +0000 (12:57 -0400)]
configure: regroup C header checks
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I659c98ce9eb328e78d1c075a1157f59848195650
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 16:44:54 +0000 (12:44 -0400)]
configure: regroup and expand C compiler checks
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I304f4bda39e60321248772ef9864cd205a049a6f
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 18:44:35 +0000 (14:44 -0400)]
configure: Introduce macro ae_in_git_repo
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: Ifffade15ac4a15823be8ab1b6c8232624a89ab7c
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Mon, 22 Mar 2021 16:24:34 +0000 (12:24 -0400)]
configure: centralize version information
Centralise version information at the beginning of configure.ac to
improve readability.
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: Ia4de4737ac73e7dac55341e7b238780501289350
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 20:37:40 +0000 (16:37 -0400)]
Use a single macro to configure CXX
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I3667b0e61d44fd2e2ff36ac6935888e6a895ce73
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 20:25:34 +0000 (16:25 -0400)]
fix: use the configured cmake binary
Use the configure cmake binary in the examples Makefile instead of a
direct call.
Change-Id: Idb66642345e551b427e359b9cd58f49aad2a8502
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 20:08:48 +0000 (16:08 -0400)]
configure: standardize automake conditional names
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I32fe475e04e77b2972ed9d963f1d2a5c6440a4ce
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 18:16:40 +0000 (14:16 -0400)]
Centralize arch detection in a public header
Add a public header with centralized compiler arch detection and arch
specific parameters. Namespace everything under 'LTTNG_UST_ARCH_'.
Move "LTTNG_UST_HAVE_EFFICIENT_UNALIGNED_ACCESS" from a configure time
define to a static one base on compiler arch detection.
This will simplify the build system and remove the possibility of
accidently mixing aligned and unaligned access in a multiarch
environment with shared header files.
Change-Id: Ic977d13f031ad070bea4ff5d7b2b8079843e0c26
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 18:00:34 +0000 (14:00 -0400)]
Set the default ust constructor timeout in the headers
This is not user-configurable, use the same strategy as all other
internal defaults.
Change-Id: I05d61999afee44687336bf70712ee99e2da19f71
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 17:57:13 +0000 (13:57 -0400)]
fix: don't override the project wide AM_CPPFLAGS
Fix some makefiles imported after we switched to a global standardized
include path in AM_CPPFLAGS.
Change-Id: Ibb02293f86848b968c4fe190b137e562f94e83b4
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 17:49:55 +0000 (13:49 -0400)]
Add basic shell tests script framework
Import a stripped down shell tests script framework from babeltrace2.
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I41ea4b186fe744fd6841d866daa87a802c96b692
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 18 Mar 2021 17:45:06 +0000 (13:45 -0400)]
Simplify python agent build
Import the fixes and simplification to the python build integration with
autotools from babeltrace2.
This is part of an effort to standardise our autotools setup across
project to simplify maintenance.
Change-Id: I1da953c48acc2162f369893793e195803376a4f8
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Wed, 16 Dec 2020 17:39:46 +0000 (12:39 -0500)]
port: update pthread get/set name compat
Sync the pthread set/get name compat with tools, to add support for
recent FreeBSD and MacOS API.
Change-Id: I9c16fc32e2a75e3f484198279e1660f3e2c5e142
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 22 Mar 2021 16:52:54 +0000 (12:52 -0400)]
Fix: bytecode linker: validate event and field array/sequence encoding
The bytecode linker should only allow linking filter expressions loading
fields which are string-encoded arrays and sequence for comparison
against a string, and reject arrays and sequences without encoding, so
the filter interpreter does not attempt to load non-NULL terminated
arrays/sequences as if they were strings.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I7e0d42dc53738f36af372b4352c44bc1fff916d1
Mathieu Desnoyers [Mon, 22 Mar 2021 14:01:55 +0000 (10:01 -0400)]
Validate match of all session channel's UUID
Add a validation at channel creation to ensure that the uuid of all
channels created within a session match.
Note that we still need to keep a copy of the uuid field in the channel
private data at this stage, because the consumer daemon creates channels
with a NULL session pointer.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3490bab8879ffa66bc1e19559b0a1a60d33d605b
Mathieu Desnoyers [Mon, 22 Mar 2021 13:50:19 +0000 (09:50 -0400)]
Cleanup: Remove whiteline
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I128bcc42913028f28035794519900d688373544f
Mathieu Desnoyers [Mon, 22 Mar 2021 13:47:30 +0000 (09:47 -0400)]
Cleanup: align private header comments
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I358a424e765a150c395fc3efa1b61e3f2020a2c5
Mathieu Desnoyers [Mon, 22 Mar 2021 13:45:21 +0000 (09:45 -0400)]
Cleanup: remove old comments
Those comments are not useful for internal structures.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I5341e686e20f164333166b008dd9d446c3e6dea3
Mathieu Desnoyers [Fri, 19 Mar 2021 04:03:17 +0000 (00:03 -0400)]
Refactoring and fix: bytecode ABI
Introduce an "event filter" callback to be called by the instrumentation
probe, and move the bytecode list into private data structures.
This will allow much more freedom in choosing how bytecodes are combined
both in terms of logic (OR vs AND) and implementation (jits).
Currently, we keep callbacks internally as well for each bytecode
evaluation, but nothing prevents to change how this works in the future
to improve performance now that this is all private.
For filters, we add the following fields to struct lttng_ust_event_common:
int eval_filter; /* Need to evaluate filters */
int (*run_filter)(struct lttng_ust_event_common *event,
const char *stack_data,
void *filter_ctx);
"eval_filter" is a state indicating whether the filter should be
evaluated at all. It combines internal knowledge of whether the filter
bytecode list is empty, and whether there are enablers without filter
bytecode attached to the event.
For captures, a new struct lttng_ust_notification_ctx is introduced,
which is to be used as additional "context" to the notification_send()
callback. This allows passing the "eval_capture" state from the probe
to the notification callback, and fixes a bug where a sequence of:
- create notification enabler,
- enable notification enabler,
- add capture to enabler,
where a tracepoint runs concurrently with add capture happens to do a
first capture list_empty check which skips the stack preparation,
whereas the second capture list_empty check within the notification
callback finds a capture entry, and thus attempts to use an
uninitialized stack. The notification callback is also modified to use
an RCU-aware list traversal.
For captures, the following field is added to struct lttng_ust_event_notifier:
int eval_capture; /* Need to evaluate capture */
which is to be read once by the probe and its state saved and used
thorough the entire probe execution.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iae70c5e7924f14b38e14676368cf2516951218ee
Mathieu Desnoyers [Fri, 19 Mar 2021 03:22:18 +0000 (23:22 -0400)]
Bytecode: update documentation
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I687ad8f08c735704ce1084c21d9c782deadd2541
Mathieu Desnoyers [Thu, 18 Mar 2021 21:04:07 +0000 (17:04 -0400)]
Refactoring: bytecode interpreter ABI
Refactor the ABI of the bytecode interpreter, which is used by the probe
provider callbacks:
- Return a "int" rather than uint64_t,
- The return values are now:
LTTNG_UST_BYTECODE_INTERPRETER_ERROR = -1,
LTTNG_UST_BYTECODE_INTERPRETER_OK = 0,
- Introduce a bytecode "context". This context is specific for each
bytecode "class" (filter or capture). The filter class context
has a "result" (accept/reject) output, whereas the capture class
has an "output".
- The bytecode context is extensible with the struct_size scheme.
- Merge filter and capture interpreters into a single callback.
That callback uses a new "bytecode type" field within the bytecode
private data to figure out the specific bytecode class (filter or
capture).
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Id528e141d0c213e9bb41f68d6d7e632104daa1cf
Mathieu Desnoyers [Thu, 18 Mar 2021 20:08:10 +0000 (16:08 -0400)]
Fix: java agent: migrate to new channel structures
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ic20da8461a6d8fe741b701b7b9e68a3aeb2ad7a1
Mathieu Desnoyers [Thu, 18 Mar 2021 19:57:06 +0000 (15:57 -0400)]
Move event context to private structures
The list of contexts active for an event can be moved to a private
structure by keeping the temporary pointer to the RCU dereferenced
context in the ring buffer client's internal context rather than within
the context shared between the probe and the ring buffer client.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3040edf42ea59786a4ee1b5b3f9a90e1834821ab
Mathieu Desnoyers [Thu, 18 Mar 2021 19:49:11 +0000 (15:49 -0400)]
Move channel context to private structures
The list of contexts active for a channel can be moved to a private
structure by keeping the temporary pointer to the RCU dereferenced
context in the ring buffer client's internal context rather than within
the context shared between the probe and the ring buffer client.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iaf9491255d1a0940450dea613ac6e5bc0705506d
Mathieu Desnoyers [Thu, 18 Mar 2021 15:44:30 +0000 (11:44 -0400)]
Refactoring: Channel structures
Now that struct lttng_channel is separate from the consumer daemon
channel config message ABI layout, we can perform a significant amount
of refactoring:
- Namespace theses structures with lttng_ust_ prefix,
- Use struct_size extensibility scheme.
- Split fields into public/private structures,
- Split public and private structures into a child (ring buffer)
and parent (common). This will allow introducing other channel
children types in the future (e.g. counters).
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I6acec4e4ffff721e6ea5698e64a063045e1c1022
Mathieu Desnoyers [Thu, 18 Mar 2021 13:34:55 +0000 (09:34 -0400)]
struct lttng_channel: split protocol ABI from instrumentation ABI
Duplicate struct lttng_channel to introduce a new struct
lttng_ust_abi_channel_config meant to hold configuration data within the
memory area belonging to the ring buffer private data. Now the
application and consumer private pointer will be a separate pointer,
for which the memory will be owned by the caller.
This will allow us to modify the layout of struct lttng_channel without
breaking the UST communication protocol.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I96684aa6658f59dc3332da6034bdf9e3f921261f
Michael Jeanson [Wed, 17 Mar 2021 20:31:53 +0000 (16:31 -0400)]
Remove the LTTNG_PACKED macro
We already use __attribute__((packed)) directly in some public headers.
Remove the LTTNG_PACKED macro and replace it with the literal attribute.
The LTTNG_PACKED macro was meant to support Cygwin, but the Cygwin
LTTng-UST support was never completed.
Change-Id: I8bf5d3db94b979e16bf9b9b5c582b85b6b73f10b
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Wed, 17 Mar 2021 20:00:33 +0000 (16:00 -0400)]
Move public tracepoint definition headers to 'lttng/tp'
Separate the tracepoint definition headers for tracef and tracelog from
the rest of the public API headers.
Change-Id: I8e38e2c8c0a3c2d6f7ab172c3fdbc2d6e5ad8d9d
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Wed, 17 Mar 2021 19:27:10 +0000 (15:27 -0400)]
Namespace lttng/align.h as lttng/ust-align.h
Since the 'lttng/' header directory is shared between ust and tools,
namespace this common name header with 'ust-' to match the same pattern
as the other files.
Change-Id: Iad25ad76b75e87e040b4d7dd9f461ce6522ac361
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Wed, 17 Mar 2021 19:19:37 +0000 (15:19 -0400)]
Namespace lttng/bug.h as lttng/ust-bug.h
Since the 'lttng/' header directory is shared between ust and tools,
namespace this common name header with 'ust-' to match the same pattern
as the other files.
Change-Id: I08e853d9edcce218a9bd57717316a557f49200d7
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 17 Mar 2021 20:23:25 +0000 (16:23 -0400)]
Namespace enum lttng_ust_bytecode_interpreter_ret flags with lttng_ust_ prefix
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I0106752714ab42f3f6c45191aee0d69d698b1cfe
Mathieu Desnoyers [Wed, 17 Mar 2021 20:16:48 +0000 (16:16 -0400)]
Namespace _float_mant_dig with lttng_ust_ prefix
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I25085e6c9d93e6b0c4ff8392d263d53117505c40
Mathieu Desnoyers [Wed, 17 Mar 2021 20:13:54 +0000 (16:13 -0400)]
Namespace enumeration structures/enum with lttng_ust_ prefix
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Icefbecc56d6425d2e6a3adebc592babf70ff60f9
Mathieu Desnoyers [Wed, 17 Mar 2021 20:07:10 +0000 (16:07 -0400)]
ust-elf.h should be private, with public symbols
The symbols belonging to ust-elf.h need to be public, because
liblttng-ust-dl uses them, but the header per se should be internal.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I04495249c0c8b80b251dbf2a7f5488d093a6d999
Mathieu Desnoyers [Wed, 17 Mar 2021 20:01:53 +0000 (16:01 -0400)]
counter-config.h should be private
Move it to libcounter/.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I28891c708d105c933bbe2c3cf656c7b7b6e6e550
Mathieu Desnoyers [Wed, 17 Mar 2021 19:24:59 +0000 (15:24 -0400)]
Fix: perf counters context: error handling on type allocation
Found by Coverity:
** CID
1450865: Resource leaks (RESOURCE_LEAK)
/liblttng-ust/lttng-context-perf-counters.c: 606 in lttng_add_perf_counter_to_ct)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I9b0cf29ceb4f8c95f0905455cda4c157c7a37165
Mathieu Desnoyers [Wed, 17 Mar 2021 19:23:26 +0000 (15:23 -0400)]
Fix: lttng_ust_destroy_type: add missing free() for compound types
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iea05b0cad779adef251ec000e4c126493e17aff8
Mathieu Desnoyers [Wed, 17 Mar 2021 18:56:46 +0000 (14:56 -0400)]
Fix: missing field name refactoring in java agent
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I28fcf080545cad5bc44270419059bcaaa627572e
Mathieu Desnoyers [Wed, 17 Mar 2021 18:39:10 +0000 (14:39 -0400)]
Fix: replace ringbuffer-config.h by ringbuffer-context.h include
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I5d1f3333c8906afaf632b82742d101683a13cd5c
Mathieu Desnoyers [Wed, 17 Mar 2021 18:18:28 +0000 (14:18 -0400)]
Add missing ringbuffer-context.h
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3dcf5b2c12c88570b9089b187d7e560af26e96af
Mathieu Desnoyers [Wed, 17 Mar 2021 18:10:38 +0000 (14:10 -0400)]
Refactoring: Privatize ring buffer config header
The public header ringbuffer-config.h contains two distinct sets of APIs
and structure declarations:
- Ring buffer configuration, which should become private (moved to
libringbuffer/ringbuffer-config.h),
- Ring buffer context for use when writing an event record into the
ring buffer. This part is moved to a new "ringbuffer-context.h" public
header.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I07dae33ab5e3925dea0158058d484c49292a0bb0
Mathieu Desnoyers [Wed, 17 Mar 2021 16:44:51 +0000 (12:44 -0400)]
Refactoring: Introduce extensibility scheme for tracepoint structures
- Introduce struct_size extensibility scheme for all tracepoint public
structures, except for struct lttng_ust_tracepoint_probe which is
embedded in a public array of structures, thus making it tricky for
instrumentation sites to efficiently skip over the array elements
without reading their size.
- Remove padding from those structures.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I2387a62c03f6f729c59ddc3fafa3a9b5546fb287
Jérémie Galarneau [Wed, 17 Mar 2021 16:20:05 +0000 (12:20 -0400)]
Clean-up: ustctl: adapt comment to use new ABI name
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ie099ab21cccd82212ad7339ae3c55dee685b54a0
Jérémie Galarneau [Wed, 17 Mar 2021 16:16:18 +0000 (12:16 -0400)]
Fix: ustctl: leak of event notifier data on communication error
The `len != sizeof(*event_notifier)` error path does not free
the `event_notifier_data` even though it is not provided to the caller.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ie3b4ebf77e8ca7205d802c6db67c23c347aa29df
Mathieu Desnoyers [Wed, 17 Mar 2021 02:41:20 +0000 (22:41 -0400)]
Refactoring: UST types public interfaces
- Properly namespace public type interfaces with lttng_ust_ prefix,
- Move from union to parent embedding into children for inheritance.
- Introduce struct lttng_ust_type_common, which is fixed-size, to
contain the type selector. Used as parent for each sub-type.
- Use compound literals on tracepoint probe definition rather than
nesting into event field structure to allow each type to be extended
with a struct_size scheme.
- The parent field is required to be the first field of each sub-type,
allowing cast between parent and children types.
- Remove const-ness from various probe provider visible types to
facilitate re-use of the code for eventual dynamically allocated
structures.
- Remove "field_name" field from lttng_ust_ctx_field. Instead,
dynamically allocate field names for each context.
- Introduce get_type_max_align() in lttng-context.c now used by
lttng_context_update(). It performs a recursive traversal of the
nested types rather than erroring out on recursive cases.
- Move "encoding" from integer type to array and sequences types.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: If99a2689f042b7e642b373e4646e9f85c009a47d
Mathieu Desnoyers [Wed, 17 Mar 2021 02:12:13 +0000 (22:12 -0400)]
Refactoring: remove struct_size from struct lttng_ust_ctx_value
The struct_size scheme is not appropriate to extend struct
lttng_ust_ctx_value because its type selector and union already
act as a mean to extend it. When new entries are added to the union,
the size of that union may increase, thus shifting the offset of
fields following that union. It is therefore not possible to extend
it by adding fields after the union, thus making the struct_size
scheme irrelevant.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I9e80e0ea87c3df3fe76863ed5343de733210045e
Mathieu Desnoyers [Tue, 16 Mar 2021 20:31:30 +0000 (16:31 -0400)]
Refactoring: struct lttng_ust_channel_ops
- Move internal fields to struct lttng_ust_channel_ops_private.
- Add private/public relationships between the two structures.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Id8018d8e11df6db569e20fffb6f2ed08e47c452e
Mathieu Desnoyers [Tue, 16 Mar 2021 20:21:00 +0000 (16:21 -0400)]
Hide forward declaration of struct lttng_event_notifier_group
Only used internally.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I71e26758404df22923371b76761eff9d1a4a8237
Mathieu Desnoyers [Tue, 16 Mar 2021 20:19:34 +0000 (16:19 -0400)]
Namepace struct lttng_session with lttng_ust_ prefix
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I6f35753cda29c51f62cc90ccf7328a7255f77af7
Mathieu Desnoyers [Tue, 16 Mar 2021 20:17:26 +0000 (16:17 -0400)]
Cleanup: public type macros coding style
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I6732b20d1e2975f2a00678e00dc84c4ac6f7be67
Mathieu Desnoyers [Tue, 16 Mar 2021 20:11:37 +0000 (16:11 -0400)]
Cleanup: Add whitelines after struct_size fields
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I78e521c17437a17b1a65fd4387ad422d2e79aa36
Mathieu Desnoyers [Tue, 16 Mar 2021 18:51:18 +0000 (14:51 -0400)]
Refactoring: context structures
The context structures are now hidden in headers which are not
installed, but those are still part of the UST ABI. Therefore, we need
to update them to make sure those are extensible.
- Namespace theses structures with lttng_ust_ prefix,
- Use struct_size extensibility scheme. There was no prior padding, so
extensibility was an issue in the past.
- Remove padding.
- This requires that none of those structures can be nested. It also
requires that all arrays of structures must be replaced by arrays of
pointers to structures.
- Replace struct lttng_perf_counter_field pointer by a private data
pointer.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I4ecb8f73652770f15c693c1b5b2acce3e871a64b
Michael Jeanson [Mon, 15 Mar 2021 17:50:50 +0000 (13:50 -0400)]
cleanup: add comments to lttng/ust-endian.h
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I60967d2791434dc513d36dbb8d7b671f13c0be7e
Michael Jeanson [Fri, 12 Mar 2021 20:27:26 +0000 (15:27 -0500)]
Namespace 'struct channel' under 'lttng_ust_lib_ring_buffer_'
The major SONAME bump to '1' gives us the opportunity to properly
namespace some older parts of the API.
Change-Id: Iab40cde0c9ccc36d9fb537d665eb11d8d96da847
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Fri, 12 Mar 2021 19:04:44 +0000 (14:04 -0500)]
Move context types to private header
This is an API change but the major SONAME bump to '1' gives us the
opportunity to hide symbols that should have been private from the
start.
Change-Id: Iad136e690b420e497b6b8d39155608278f537f7b
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Fri, 12 Mar 2021 15:50:00 +0000 (10:50 -0500)]
Move lttng_ust_dl_update to private ABI
This symbol is part of the ABI between liblttng-ust-dl and liblltng-ust
and is not part of the public API.
Change-Id: Ic2a12568b8e0d78ec3493e644c797df1cf87c63b
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 11 Mar 2021 21:48:47 +0000 (16:48 -0500)]
Namespace private ABI lttng_transport_find symbol
The major SONAME bump to '1' gives us the opportunity to properly
namespace public symbols. This symbol is part of the ABI between
liblttng-ust-ctl and liblltng-ust and is not part of the public API.
Change-Id: Ibdb33aff98f7b974fac3c28889718851286ce2f9
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 11 Mar 2021 21:40:02 +0000 (16:40 -0500)]
Hide private lttng_session_active symbol
The major SONAME bump to '1' gives us the opportunity to hide private
symbols that should never have been visible.
Change-Id: I2700903465892d58d430bec0b76cde12018fede2
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Thu, 11 Mar 2021 21:24:46 +0000 (16:24 -0500)]
Namespace lttng_context_procname_reset public symbol
The major SONAME bump to '1' gives us the opportunity to properly
namespace public symbols. Note that this is also an API break.
Change-Id: I9f966ce7f4c112542f602e78a5e4f5c8f0d0f642
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Wed, 10 Mar 2021 19:09:52 +0000 (14:09 -0500)]
Remove LTTNG_HIDDEN macro
We already use __attribute__((visibility("hidden"))) directly in the
public API and in some parts of the code. Remove the LTTNG_HIDDEN macro
and replace it with the literal attribute.
Change-Id: I9aa0698ba08c742c2a25aec24560b7789e303eaa
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Michael Jeanson [Tue, 9 Mar 2021 19:56:44 +0000 (14:56 -0500)]
Hide or namespace the remaining tracepoint internal symbols
The major SONAME bump to '1' gives us the opportunity to hide private
symbols that should never have been visible.
Namespace the symbols that are part of the liblttng-ust-tracepoint ABI
but are not part of the public API.
Change-Id: I46125715e88f88891fe0c02a95adbbf6792a33e2
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 16 Mar 2021 03:13:54 +0000 (23:13 -0400)]
Refactoring: struct lttng_stack_ctx
- Namespace this structure with lttng_ust_ prefix,
- Use struct_size extensibility scheme.
- Remove padding.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ieb0679f78a18553c6d60a70d78e0f7f99181d646
Mathieu Desnoyers [Tue, 16 Mar 2021 03:06:59 +0000 (23:06 -0400)]
Refactoring: struct lttng_bytecode_runtime
- Namespace this structure with lttng_ust_ prefix,
- Use struct_size extensibility scheme. There was no prior padding, so
extensibility was an issue in the past.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I27f28092894332ec1ba6f9f9d0a5fae3f04df6fd
Mathieu Desnoyers [Tue, 16 Mar 2021 02:59:35 +0000 (22:59 -0400)]
Move hash tables to internal header
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I314bd74c593c2b48dbc9af31ff25dab7a3738382
Mathieu Desnoyers [Tue, 16 Mar 2021 02:57:58 +0000 (22:57 -0400)]
Cleanup: add whiteline after struct_size field
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I5a5ba8ee5e0f5b3fb539cb5c548f6086916f198b
Mathieu Desnoyers [Tue, 16 Mar 2021 02:56:45 +0000 (22:56 -0400)]
Move struct lttng_counter_ops to internal header
As of LTTng-UST 2.13, this structure does not yet need to be public.
Keep it internal for now.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3346a61ff1a98dcbebbcfe4ac68eb823f5645f7b
Mathieu Desnoyers [Tue, 16 Mar 2021 02:53:36 +0000 (22:53 -0400)]
Move struct lttng_enum to internal header
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I7bc601ea23fe57c23cca2ce45dc3931824b17a8e
Mathieu Desnoyers [Tue, 16 Mar 2021 02:50:28 +0000 (22:50 -0400)]
Refactoring: struct lttng_channel_ops
- Namespace this structure with lttng_ust_ prefix,
- Use struct_size extensibility scheme. There was no prior padding, so
extensibility was an issue in the past.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ie8334f5f651f100aaea60ee83d3c8e2b6b300a5a
Mathieu Desnoyers [Tue, 16 Mar 2021 02:35:29 +0000 (22:35 -0400)]
Refactoring: struct lttng_enum_desc and lttng_enum_entry
- Namespace these structures with lttng_ust_ prefix,
- Use struct_size extensibility scheme,
- Remove padding,
- Use an array of pointers to structure rather than array of enumeration
entries to allow easier handling of extensibility. This is achieved by
using __LTTNG_COMPOUND_LITERAL().
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I2bf6e24e22c9646fc321f6c7c9ffcbd32ed22da0
Mathieu Desnoyers [Mon, 15 Mar 2021 21:23:57 +0000 (17:23 -0400)]
Refactoring: struct lttng_event_field
- Namespace this structure with lttng_ust_ prefix,
- Use struct_size extensibility scheme,
- Remove padding,
- Use an array of pointers to structure rather than array of event
fields to allow easier handling of extensibility. This is achieved by
using __LTTNG_COMPOUND_LITERAL().
- Move nofilter field into structure.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iaa0056ff2d67042d0b6fca156c8f8072ae1820ea
Mathieu Desnoyers [Mon, 15 Mar 2021 20:48:58 +0000 (16:48 -0400)]
Refactoring: struct lttng_event_desc and lttng_probe_desc
- Properly namespace probe registration functions,
- Namespace those structures with lttng_ust_ prefix,
- Use struct_size extensibility scheme,
- Remove padding.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I316a4120d568b663381f4b9eae3e1405a83a1db5
Mathieu Desnoyers [Mon, 15 Mar 2021 20:33:31 +0000 (16:33 -0400)]
Document public event and session structures
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I50cd2a5d122eed9fe5b333919bbba351dd0867d3
Mathieu Desnoyers [Mon, 15 Mar 2021 20:30:48 +0000 (16:30 -0400)]
Document public event structures
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ibf2db56513a3b8dc010ee41951d287b410c9144b
Mathieu Desnoyers [Mon, 15 Mar 2021 18:57:44 +0000 (14:57 -0400)]
Refactoring: combine event recorder and notifier callback functions
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I6e2c8021220072da9a8455a31e48db9d740edfe7
Mathieu Desnoyers [Mon, 15 Mar 2021 15:20:48 +0000 (11:20 -0400)]
Introduce event type field in common structure
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iee7f9700d60fab87e928bba11309fd8f4fad09a8
Mathieu Desnoyers [Mon, 15 Mar 2021 14:37:44 +0000 (10:37 -0400)]
Refactor struct lttng_ust_lib_ring_buffer_ctx
- Remove padding entirely. Will be replaced by checks against
@struct_size.
- Rename @ctx_len to @struct_size, to align with the rest of the other
structures.
- Remove priv vs priv2 private data fields. "priv" held a pointer only
useful for legacy ABI. Set priv2 to the lttng_ctx used in the current
ABI instead.
- Remove checks for @ctx_len only useful to support old ABI.
- Remove fallback code for old ABI.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I1273be9615846304266206769700e799bde4e51f
Mathieu Desnoyers [Mon, 15 Mar 2021 14:06:39 +0000 (10:06 -0400)]
Combine common recorder/notifier functions to lttng_free_event_filter_runtime
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: If62cd44dd4036a907d28398ee9057d624b54fe89
Mathieu Desnoyers [Fri, 12 Mar 2021 22:01:36 +0000 (17:01 -0500)]
Rename struct lttng_event_notifier to struct lttng_ust_event_notifier
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iadedb3dec4a8746f7a67f43f3e15c9f2e19c5063
Mathieu Desnoyers [Fri, 12 Mar 2021 20:11:02 +0000 (15:11 -0500)]
Refactoring: namespace ust-abi.h content under regular prefix
Eliminates namespace clashes within lttng-ust. Use the LTTNG_UST_ABI_
and lttng_ust_abi_ prefixes for all symbols and defines in
lttng/ust-abi.h.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ic31956416ec384a23023d9c69b140a3694edc839
Mathieu Desnoyers [Fri, 12 Mar 2021 19:36:22 +0000 (14:36 -0500)]
Refactor event notifier structure
Move common public fields to struct lttng_ust_event_common, and move
private fields to struct lttng_ust_event_notifier_private.
The user_token is moved to struct lttng_ust_event_common_private,
because it will be used by trace hit counters in the future.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I056a632b02e4e7cf7adae87ad03a3bdd871e56a5
Mathieu Desnoyers [Fri, 12 Mar 2021 19:05:54 +0000 (14:05 -0500)]
Rename struct lttng_event_common to struct lttng_ust_event_common
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ie0c7898c8ff65f8d121ca2efb803275c08eadf99
Mathieu Desnoyers [Fri, 12 Mar 2021 19:01:55 +0000 (14:01 -0500)]
Rename struct lttng_event to struct lttng_ust_event_recorder
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I8b71cdf178602b2fe12292454960e498248da887
Mathieu Desnoyers [Fri, 12 Mar 2021 18:35:47 +0000 (13:35 -0500)]
Introduce common event structure
Will allow combining common fields of event and event notifier structures.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iae4ac899d31b1bc3e3130f6f8e17451920bc5fbb
Mathieu Desnoyers [Fri, 12 Mar 2021 13:42:23 +0000 (08:42 -0500)]
Fix: bytecode linker: iteration on wrong list head
lttng_enabler_link_bytecode() calls link_bytecode() passing an insertion
location (insert_loc) within the list. This insert location is meant to
be used as cursor position where to add the new element.
However, bytecode_is_linked() uses it as iteration list head, and this
is where things fall apart: it will thus consider the real list head as
being a list node, and will erroneously think that it is contained
within a struct lttng_bytecode_runtime, and thus try to perform possibly
out-of-bound read or read garbage data for the comparison.
It worked fine most of the time because in usual scenarios the insert
location is the list head. It falls apart when many bytecodes are linked
to a given event.
Fixes: 53b9d7db85d ("Decouple `struct lttng_event` from filter code")
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ie47171e981986a30b45b92f82811ff15aae38ad2
Mathieu Desnoyers [Thu, 11 Mar 2021 21:33:45 +0000 (16:33 -0500)]
Fix: re-introduce basic type serialization functions
The basic type serialization functions were removed by mistake in the
recent type cleanup. Add them back, but targeting the new (non-legacy)
field members rather than the legacy field members which are now
removed.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I36ab9f8354982c9208eb0acd8a7d62ba4fbb85a1
Mathieu Desnoyers [Thu, 11 Mar 2021 21:20:12 +0000 (16:20 -0500)]
Remove array, sequence, enum, struct legacy types
Those are replaced by array_nestable, sequence_nestable, enum_nestable
and struct_nestable. The ABI bump allows removing the old types.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ida75c05db82fa51408b54bb005a300a40b601f88
Mathieu Desnoyers [Thu, 11 Mar 2021 21:02:00 +0000 (16:02 -0500)]
Add structure size field to struct lttng_session
Made possible by ABI bump. This scheme can be used for extensibility.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I8d264969b866e7f06a835731753911718dd09727
Mathieu Desnoyers [Thu, 11 Mar 2021 21:00:19 +0000 (16:00 -0500)]
Add structure size field to struct lttng_event
Made possible by ABI bump. This scheme can be used for extensibility.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I38b15636605339f3f8702983aeaffafa1ab56719
Mathieu Desnoyers [Thu, 11 Mar 2021 20:48:52 +0000 (15:48 -0500)]
Refactoring: introduce session private structure
Move private session fields to private structure. Made possible by major
ABI bump.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I7fa738363c79bfb9636f2c0e57d5f40fe95da7ca
Mathieu Desnoyers [Thu, 11 Mar 2021 20:26:03 +0000 (15:26 -0500)]
Refactoring: introduce bytecode runtime private structure
Move private bytecode runtime fields to private structure. Made possible
by major ABI bump.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I142d0edafb2fe1231454d145822b60a8a8a91c6e
Mathieu Desnoyers [Thu, 11 Mar 2021 20:07:20 +0000 (15:07 -0500)]
Refactoring: introduce event private structure
Move private event fields to private structure. Made possible by major
ABI bump.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I241a2a574fb2b58d1b0e466058931af45e1d69e0
Michael Jeanson [Wed, 10 Mar 2021 22:07:57 +0000 (17:07 -0500)]
Namespace tracepoint_init and tracepoint_exit
These are ABI symbols of liblttng-ust-tracepoint, namespace them under
'lttng_ust_tp_'.
Change-Id: Ic9fe173cd475179444a2a680e2e3eaba6622cbef
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.043199 seconds and 4 git commands to generate.