Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from uprobes to usdt for tracing #352

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

bobrik
Copy link
Contributor

@bobrik bobrik commented Feb 27, 2024

Attaching uprobes if fickle and requires function attributes to work properly. Let's switch to usdt, which have no such downside. The price we pay is a dependecy on systemtap-sdt-dev, which is manageable.

We get nicer attachment code with BPF_USDT as a bonus.

The usdt probes can be inspected:

ivan@vm:~/projects/ebpf_exporter$ sudo tplist-bpfcc -vv -l tracing/demos/cfs-throttling/demo
ebpf_exporter:cfs_set_parent_span [sema 0x0]
  location #1 tracing/demos/cfs-throttling/demo 0x92f3cc
    argument #1 8 unsigned bytes @ regs[10]
    argument #2 8 unsigned bytes @ regs[9]
    argument #3 8 unsigned bytes @ regs[8]
  location #2 tracing/demos/cfs-throttling/demo 0x92f408
    argument #1 8 unsigned bytes @ regs[13]
    argument #2 8 unsigned bytes @ regs[11]
    argument #3 8 unsigned bytes @ regs[8]
ebpf_exporter:cfs_clear_parent_span [sema 0x0]
  location #1 tracing/demos/cfs-throttling/demo 0x92f3d8
  location #2 tracing/demos/cfs-throttling/demo 0x92f3e0

Attaching uprobes if fickle and requires function attributes to work properly.
Let's switch to usdt, which have no such downside. The price we pay is
a dependecy on `systemtap-sdt-dev`, which is manageable.

We get nicer attachment code with `BPF_USDT` as a bonus.

The usdt probes can be inspected:

```
ivan@vm:~/projects/ebpf_exporter$ sudo tplist-bpfcc -vv -l tracing/demos/cfs-throttling/demo
ebpf_exporter:cfs_set_parent_span [sema 0x0]
  location #1 tracing/demos/cfs-throttling/demo 0x92f3cc
    argument #1 8 unsigned bytes @ regs[10]
    argument cloudflare#2 8 unsigned bytes @ regs[9]
    argument cloudflare#3 8 unsigned bytes @ regs[8]
  location cloudflare#2 tracing/demos/cfs-throttling/demo 0x92f408
    argument #1 8 unsigned bytes @ regs[13]
    argument cloudflare#2 8 unsigned bytes @ regs[11]
    argument cloudflare#3 8 unsigned bytes @ regs[8]
ebpf_exporter:cfs_clear_parent_span [sema 0x0]
  location #1 tracing/demos/cfs-throttling/demo 0x92f3d8
  location cloudflare#2 tracing/demos/cfs-throttling/demo 0x92f3e0
```
@bobrik bobrik merged commit 9be354d into cloudflare:master Feb 27, 2024
19 checks passed
@bobrik bobrik deleted the ivan/usdt-tracing branch February 27, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant