summaryrefslogtreecommitdiff
path: root/src/trace/bpf.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/trace/bpf.zig')
-rw-r--r--src/trace/bpf.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/trace/bpf.zig b/src/trace/bpf.zig
index 5dad4c6..a550419 100644
--- a/src/trace/bpf.zig
+++ b/src/trace/bpf.zig
@@ -482,7 +482,10 @@ pub const Tracer = struct {
}
/// A static probe of the file `path` (`p` from `usdt.probes` with no
- /// bias). The kernel raises its semaphore while we are attached.
+ /// bias). The kernel raises its semaphore in every process that maps
+ /// the file, while we are attached; where the same page of the file is
+ /// mapped writable twice it raises the wrong word, so for a target at
+ /// hand write the semaphore yourself and pass the probe without one.
pub fn usdtProbe(t: *Tracer, elf: usdt.Elf, path: [*:0]const u8, p: usdt.Probe, id: u64) !void {
const semaphore = if (p.semaphore == 0) 0 else elf.offset(p.semaphore) orelse return error.NoSuchProbe;
try t.attach("uprobe", path, elf.offset(p.pc) orelse return error.NoSuchProbe, semaphore, try usdtProgram(t.maps, @intCast(t.pid), id, p.args));