Mathieu Desnoyers [Thu, 16 May 2024 19:18:43 +0000 (15:18 -0400)]
pretty print: do not print 2 levels of brackets for variant
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 16 May 2024 18:39:52 +0000 (14:39 -0400)]
pretty print tracer: use { } for structures and fields
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 16 May 2024 18:35:03 +0000 (14:35 -0400)]
pretty print tracer: add missing comma in caller printout
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 16 May 2024 18:31:28 +0000 (14:31 -0400)]
pretty-print tracer: cleanup dynamic {} and remove caller addr
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 15 May 2024 14:34:46 +0000 (10:34 -0400)]
Fix: tracer: utf16/32 gather types handling
tracer_convert_string_to_utf8 should return the size of the input
(including null terminator) rather than the size of the utf8 output.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 10 May 2024 18:10:26 +0000 (14:10 -0400)]
Update rfc
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 10 May 2024 15:22:51 +0000 (11:22 -0400)]
Rename rfc-libside.txt to rfc-side-abi.txt
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 10 May 2024 15:21:33 +0000 (11:21 -0400)]
Update libside RFC
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 8 May 2024 20:11:25 +0000 (16:11 -0400)]
Update libside rfc
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 8 May 2024 20:09:14 +0000 (16:09 -0400)]
Add libside RFC
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 2 May 2024 14:44:36 +0000 (10:44 -0400)]
fix: handle EINTR correctly in get_cpu_mask_from_sysfs
If the read() in get_cpu_mask_from_sysfs() fails with EINTR, the code is
supposed to retry, but the while loop condition has (bytes_read > 0),
which is false when read() fails with EINTR. The result is that the code
exits the loop, having only read part of the string.
Use (bytes_read != 0) in the while loop condition instead, since the
(bytes_read < 0) case is already handled in the loop.
Original fix in liburcu from Benjamin Marzinski <bmarzins@redhat.com>:
commit
9922f33e2986 ("fix: handle EINTR correctly in get_cpu_mask_from_sysfs")
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 23 Apr 2024 19:36:03 +0000 (15:36 -0400)]
side: Introduce caller address
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 23 Apr 2024 15:46:54 +0000 (11:46 -0400)]
side: explicit statedump request key
Make the statedump request key explicit rather than hiding it as a
Thread-Local Storage variable within libside. It's type is still opaque
to the application (void *), but this allows schemes where the statedump
callbacks are not required to emit statedump events from the same
thread: it can pass the statedump_request_key to another thread
responsible for emitting those events.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 23 Apr 2024 15:48:56 +0000 (11:48 -0400)]
rcu: Update following librseq public API updates
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Tue, 23 Apr 2024 15:45:28 +0000 (11:45 -0400)]
Cleanup function argument alignment
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 19 Feb 2024 18:58:55 +0000 (13:58 -0500)]
Implement side_cpu_relax for x86
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 19 Feb 2024 18:28:53 +0000 (13:28 -0500)]
Document application fork/clone vs statedump locking limitations
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 19 Feb 2024 18:19:43 +0000 (13:19 -0500)]
Handle statedump agent thread state across fork
Implement pthread_atfork handlers to deal with statedump agent thread
state across fork.
For glibc, this requires glibc 2.24 or more recent.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 22 Dec 2023 20:03:07 +0000 (15:03 -0500)]
Implement agent thread wakeup scheme with pthread cond var
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 22 Dec 2023 18:29:16 +0000 (13:29 -0500)]
Implement agent thread
Currently uses 1 second polling for state. To be replaced by a proper
wait/wakeup.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 22 Dec 2023 18:28:07 +0000 (13:28 -0500)]
list: fix safe list iteration
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 22 Dec 2023 17:00:55 +0000 (12:00 -0500)]
Statedump improvements
- Introduce polling vs agent thread statedump callbacks,
- Use uint64_t for tracer key.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 18 Dec 2023 21:37:08 +0000 (16:37 -0500)]
Extend statedump API
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 18 Dec 2023 18:29:19 +0000 (13:29 -0500)]
Introduce side ptrace hook
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 18 Dec 2023 15:16:39 +0000 (10:16 -0500)]
Use RCU for statedump
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 18 Dec 2023 14:49:55 +0000 (09:49 -0500)]
Add rculist
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 18 Dec 2023 14:28:00 +0000 (09:28 -0500)]
Introduce list_types.h
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 15 Dec 2023 21:44:47 +0000 (16:44 -0500)]
Implement statedump unit test
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 15 Dec 2023 20:53:02 +0000 (15:53 -0500)]
Implement statedump request notifications
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 15 Dec 2023 20:17:25 +0000 (15:17 -0500)]
Use TLS variable for key state
Keep this hidden from the application.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 15 Dec 2023 19:17:00 +0000 (14:17 -0500)]
Add "key" to callback registration
This is in preparation to support the state-dump feature.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 15 Dec 2023 16:29:06 +0000 (11:29 -0500)]
Update gitignore
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 15 Dec 2023 16:26:33 +0000 (11:26 -0500)]
Remove backup file
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 11 Dec 2023 16:23:10 +0000 (11:23 -0500)]
Add indirection for visitor arguments
In order to keep the argument vector const, add an indirection for
visitor arguments to a non-const area of memory, which is clearly
documented as modified by libside.
Add a "cached_arg" placeholder pointer to the visitor structures.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Wed, 6 Dec 2023 15:57:17 +0000 (10:57 -0500)]
Implement 128-bit integer support
TODO in tracer example: Implement 128-bit integer with len_bits != 128
or nonzero offset_bit.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 4 Dec 2023 16:47:53 +0000 (11:47 -0500)]
API: Add 128-bit integer support
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 4 Dec 2023 16:47:34 +0000 (11:47 -0500)]
Add __int128 support
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Mon, 4 Dec 2023 14:51:43 +0000 (09:51 -0500)]
Integer 128 split byte order helpers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 1 Dec 2023 21:58:53 +0000 (16:58 -0500)]
Revert "Remove const on all side_arg"
This reverts commit
511ee756cf8aa9259489b4386feb2911bb58c20a.
Re-introduce constness of side_arg to ensure that side_calls are pure.
This will facilitate integration with various runtimes and eliminate
corner-cases.
We plan on copying side argument vectors within libside when translating
from visitor types to flattened types.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 1 Dec 2023 21:55:45 +0000 (16:55 -0500)]
Use zero-sized array as last field of event description
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 1 Dec 2023 21:46:45 +0000 (16:46 -0500)]
Add u128/s128 integer to ABI
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 1 Dec 2023 15:13:52 +0000 (10:13 -0500)]
API: Intitialize arg flags to 0
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 1 Dec 2023 15:13:35 +0000 (10:13 -0500)]
ABI: Introduce incomplete type flag
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 30 Nov 2023 21:24:19 +0000 (16:24 -0500)]
Remove const on all side_arg
Remove const from side_arg and types containing a side_arg so they can
be altered by libside for visitor caching.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 22:40:32 +0000 (17:40 -0500)]
Remove packed from visitor ABI
The visitor ABI is a contract between instrumented applications and
userspace tracers only, and follows C calling convention, so packing
those data structures serve no purpose.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 22:29:26 +0000 (17:29 -0500)]
Move side_callback to libside internals
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 21:55:03 +0000 (16:55 -0500)]
Remove packed from struct side_callback
This is internal to libside.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 21:07:40 +0000 (16:07 -0500)]
Rename side state "p" field to "parent"
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 20:56:47 +0000 (15:56 -0500)]
Move nr_callbacks to event state
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 20:51:40 +0000 (15:51 -0500)]
Use uintptr_t for enabled state to eliminate partial register stalls
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 20:43:08 +0000 (15:43 -0500)]
side event state does not need side_ptr_t
This is not relevant for tracers: only between instrumented application
and libside.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 20:17:39 +0000 (15:17 -0500)]
Remove event state abi version validation from tracer
This is internal to libside.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 20:14:06 +0000 (15:14 -0500)]
Document ABI extensibility schemes
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 19:14:44 +0000 (14:14 -0500)]
Move ABI headers under side/abi/
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 17:10:27 +0000 (12:10 -0500)]
Remove unneeded fwd declaration
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Fri, 24 Nov 2023 17:07:57 +0000 (12:07 -0500)]
Split trace.h into API/ABI sub-headers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 22:36:09 +0000 (17:36 -0500)]
Introduce event state ABI version
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 22:06:06 +0000 (17:06 -0500)]
Extensible struct side_event_state
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 22:04:13 +0000 (17:04 -0500)]
Document side_ptr_get can be used as r or lvalue
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 21:55:45 +0000 (16:55 -0500)]
Update side_ptr_t macros
Allow fetching a single 32-bit pointer on 32-bit architectures.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 21:22:54 +0000 (16:22 -0500)]
Use structure size and version for event description extensibility
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 20:38:48 +0000 (15:38 -0500)]
Update gitignore to ignore editor .swp files
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 20:37:14 +0000 (15:37 -0500)]
Remove bogus swap file
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 20:36:53 +0000 (15:36 -0500)]
tracer: Validate number of known event types
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 20:28:11 +0000 (15:28 -0500)]
Add nr_side_type_label and nr_side_attr_type event description fields
Allow tracers to discover whether they know about all field types
present when the event instrumentation was compiled.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 19:34:58 +0000 (14:34 -0500)]
enum side_error is actually used
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 23 Nov 2023 19:32:02 +0000 (14:32 -0500)]
Enforce ABI size checks
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 11:56:37 +0000 (12:56 +0100)]
side.c: Use assert to validate flags
Flag validation is redundant with the logic already verified on
registration. Therefore, use an assertion, which can be compiled-out
when performance matters.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 11:53:58 +0000 (12:53 +0100)]
trace.h: Cleanup: Add missing () around macro parameter
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 11:49:27 +0000 (12:49 +0100)]
Use event state as argument to call fast path
Eliminate the need to load the event description cache lines (to load a
pointer to the event state) on the fast path by passing a pointer to the
event state as argument to the call.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:54:18 +0000 (11:54 +0100)]
trace.h: Move back nr_callbacks to event description
nr_callbacks is not used on the fast path, therefore move it back to the
event description to optimize cache density of the event state enabled
flags.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:36:02 +0000 (11:36 +0100)]
trace.h: Use side_enum_t for enum side_type_label_byte_order
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:30:32 +0000 (11:30 +0100)]
Comment that side_error enum is unused
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:29:32 +0000 (11:29 +0100)]
trace.h: Use side_enum_t for side_loglevel enum
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:28:14 +0000 (11:28 +0100)]
trace.h: Use side_enum_t for side_attr_type enum
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:26:00 +0000 (11:26 +0100)]
trace.h: Use side_enum_t for enum side_type_label
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:25:25 +0000 (11:25 +0100)]
macros.h: Implement side_enum_t
side_enum_t allows defining fixed-sized enumerations while preserving
typing information.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 10:06:03 +0000 (11:06 +0100)]
trace.h: Use side_ptr_t for event description
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 09:54:09 +0000 (10:54 +0100)]
Use side_ptr_t for dynamic arguments
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 09:41:15 +0000 (10:41 +0100)]
trace.h: Use side_ptr_t for gather args
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 09:35:15 +0000 (10:35 +0100)]
trace.h: Use side_ptr_t for string_value pointer
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 09:29:28 +0000 (10:29 +0100)]
trace.h: Use side_ptr_t for stack-copy compound type args
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 09:20:41 +0000 (10:20 +0100)]
trace.h: Use side_ptr_t for additional fields
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 06:39:56 +0000 (07:39 +0100)]
Use side_ptr_t for enum mappings pointers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 06:35:19 +0000 (07:35 +0100)]
Use side_ptr_t for other attribute pointers
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 06:34:36 +0000 (07:34 +0100)]
Fix: accept variable list of arguments from SIDE_PTR_INIT
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 06:22:19 +0000 (07:22 +0100)]
Use side_ptr_t in side_type_bool
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 06:19:45 +0000 (07:19 +0100)]
Use SIDE_PTR_INIT in side_type_raw_string
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 06:16:49 +0000 (07:16 +0100)]
Use side_ptr_t for side_type_null attr pointer
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 06:16:31 +0000 (07:16 +0100)]
macros.h: Introduce SIDE_PTR_INIT helper
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 05:56:03 +0000 (06:56 +0100)]
Convert side_type_raw_string pointer to side_ptr
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 05:43:57 +0000 (06:43 +0100)]
macros.h: Introduce side_ptr macros
The side_ptr macros allow defining a pointer type which is suitable
for use by 32-bit and 64-bit kernels without compatibility code,
while preserving information about the pointer type.
Those pointers are stored as 64-bit integers, and the type of the
actual pointer is kept alongside with the 64-bit pointer value in a
0-len array within a union.
uintptr_t will fit within a uint64_t except on architectures with
128-bit pointers. This provides fixed-size pointers on architectures
with pointer size of 64-bit or less. Architectures with larger
pointer size will have to handle the ABI offset specifics explicitly.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 05:37:15 +0000 (06:37 +0100)]
Cleanup macros.h
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 05:29:15 +0000 (06:29 +0100)]
Extract callbacks and enabled state to non-packed structure
Atomic load/store should be performed on non-packed structure.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 05:11:28 +0000 (06:11 +0100)]
Fix clang warning
Clang issues a warning about what we are really intending to do. Use an
explicit type as argument to sizeof().
tracer.c:1152:28: warning: 'memcpy' call operates on objects of type 'const char' while the size is based on a different type 'const char *' [-Wsizeof-pointer-memaccess]
memcpy(&ptr, ptr, sizeof(ptr));
~~~ ^~~
tracer.c:1152:28: note: did you mean to provide an explicit length?
memcpy(&ptr, ptr, sizeof(ptr));
^~~
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 05:05:19 +0000 (06:05 +0100)]
unit tests: Use default empty attributes
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 04:43:45 +0000 (05:43 +0100)]
demo unit test: Use default attribute list
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 04:31:37 +0000 (05:31 +0100)]
trace.h: Implement optional attribute lists
Attribute lists are typically empty. Implement support for optional last
macro arguments generating empty attribute lists.
Suggested-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Thu, 21 Sep 2023 04:30:40 +0000 (05:30 +0100)]
macros.h: Implement SIDE_PARAM_SELECT_ARG1
Implement the SIDE_PARAM_SELECT_ARG1 macro which allows side macros to
support optional last argument. This is useful for attribute lists,
which are typically empty.
Suggested-by: Olivier Dion <odion@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mathieu Desnoyers [Sat, 16 Sep 2023 11:26:57 +0000 (13:26 +0200)]
Add demo unit test
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.038274 seconds and 4 git commands to generate.