-
Notifications
You must be signed in to change notification settings - Fork 357
feat: Propagate the uprobe link into sample type #824
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| SEC("uprobe/generic") | ||
| int uprobe__generic(void *ctx) | ||
| { | ||
| u64 cookie = bpf_get_attach_cookie(ctx); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The minimal supported version is currently 5.4 - see https://github.com/open-telemetry/opentelemetry-ebpf-profiler?tab=readme-ov-file#supported-linux-kernel-version.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI will fail, once #826 is merged and this change is rebased.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not super experienced with the bpf tooling, but is should be possible to either target uprobes only for kernels 5.15+ or have a program each with/without cookie helper?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so far, the complexity is avoided to differentiate such cases. a work around could be to define a global variable, that is loaded at load time of the eBPF program and sets the value to differentiate different attach points. |
||
| u64 pid_tgid = bpf_get_current_pid_tgid(); | ||
| u32 pid = pid_tgid >> 32; | ||
| u32 tid = pid_tgid & 0xFFFFFFFF; | ||
|
|
@@ -16,5 +17,5 @@ int uprobe__generic(void *ctx) | |
|
|
||
| u64 ts = bpf_ktime_get_ns(); | ||
|
|
||
| return collect_trace(ctx, TRACE_UPROBE, pid, tid, ts, 0); | ||
| return collect_trace(ctx, TRACE_UPROBE, pid, tid, ts, cookie); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this goes ahead I would say we need to rename
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To follow along this thought: What is the expected field in the OTel Profiling signal to communicate this? |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
TypeStracross the Origins are not consistent right now, I think we lack to follow the spec here:https://github.com/open-telemetry/opentelemetry-proto/blob/0d02f212598f3ec1dda35274e87f59351f619058/opentelemetry/proto/profiles/v1development/profiles.proto#L267-L271
This feels closer to the spec.