iovisor / iovisor/bcc

USDT with semaphore can't be enabled without pid

Open
#3,375 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

I am trying to add some USDT to my application, and I see that for an USDT which does not have a semaphore, I can start tracing before I start the process.

```
todd@euclid ~/fab
1 v0.7 % readelf -n /home/todd/fab/fab/fabd/fabd.devel.xapi

Displaying notes found in: .note.stapsdt
Owner Data size Description
stapsdt 0x00000032 NT_STAPSDT (SystemTap probe descriptors)
Provider: bam
Name: config_reparse
Location: 0x000000000066ff74, Base: 0x000000000085d95c, Semaphore: 0x0000000000000000
Arguments: 8@%rax
stapsdt 0x00000036 NT_STAPSDT (SystemTap probe descriptors)
Provider: bam
Name: config_reconfigure
Location: 0x0000000000670063, Base: 0x000000000085d95c, Semaphore: 0x0000000000000000
Arguments: 8@%rax

todd@euclid ~/fab
0 v0.7 % sudo /usr/share/bcc/tools/trace 'u:/home/todd/fab/fab/fabd/fabd.devel.xapi:bam:config_reparse "%s", arg1'
PID TID COMM FUNC -
```

However, when I add a semaphore, then it's no longer possible (though it does work, if I start the process first and trace with the pid)

```
todd@euclid ~/fab
1 v0.7 % readelf -n /home/todd/fab/fab/fabd/fabd.devel.xapi
Displaying notes found in: .note.stapsdt
Owner Data size Description
stapsdt 0x00000032 NT_STAPSDT (SystemTap probe descriptors)
Provider: bam
Name: config_reparse
Location: 0x000000000066ff80, Base: 0x000000000085d95c, Semaphore: 0x0000000000ddf702
Arguments: 8@%rax
stapsdt 0x00000036 NT_STAPSDT (SystemTap probe descriptors)
Provider: bam
Name: config_reconfigure
Location: 0x000000000067007b, Base: 0x000000000085d95c, Semaphore: 0x0000000000ddf700
Arguments: 8@%rax

todd@euclid ~/fab
0 v0.7 % sudo /usr/share/bcc/tools/trace 'u:/home/todd/fab/fab/fabd/fabd.devel.xapi:bam:config_reparse "%s", arg1'
bam config_reparse probe_bam_config_reparse_1
Failed to enable USDT probe 'bam:config_reparse' -1:
the specified pid might not contain the given language's runtime,
or the runtime was not built with the required USDT probes. Look
for a configure flag similar to --with-dtrace or --enable-dtrace.
To check which probes are present in the process, use the tplist tool.
```

Is this expected, or have I found a bug?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.