argdist - USDT probes filtering
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
argdist filtering option doesn't seem to work for USDT probes.
Example:
In the LIBC library, we have a static USDT tracepoint
LIBC_PROBE (memory_heap_free, 2, heap, heap->size);
The following probe is attached without filtering option
```
$./argdist -C 'u:/lib/x86_64-linux-gnu/libc-2.27.so:memory_heap_free():size_t:arg2' -p 25660
[04:48:42]
u:/lib/x86_64-linux-gnu/libc-2.27.so:memory_heap_free():size_t:arg2
COUNT EVENT
[04:48:43]
u:/lib/x86_64-linux-gnu/libc-2.27.so:memory_heap_free():size_t:arg2
COUNT EVENT
```
When I try to filter based on "arg2" parameters in tracepoint, probe attach fails
```
#./argdist -C 'u:/lib/x86_64-linux-gnu/libc-2.27.so:memory_heap_free():size_t:arg2:arg2>100' -p 25660
/virtual/main.c:37:15: error: use of undeclared identifier 'arg2'
if (!(arg2>100)) return 0;
^
1 error generated.
Failed to compile BPF module
```
It looks like "trace" tool handles the filtering gracefully and probe is attached.
```
# ./trace 'u:/lib/x86_64-linux-gnu/libc-2.27.so:memory_heap_free (arg2 > 100) "size %u", arg2' -p 25699
PID TID COMM FUNC -
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the argdist USDT probe filtering path and compare it with the trace entry point, using the provided memory_heap_free examples as the reproduction. The work is done when an arg2 filter compiles and the USDT probe attaches and filters events as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100