Thread (31 messages) 31 messages, 4 authors, 2015-03-25

Re: [PATCH v9 tip 8/9] samples: bpf: IO latency analysis (iosnoop/heatmap)

From: Ingo Molnar <mingo@kernel.org>
Date: 2015-03-23 07:40:37
Also in: linux-api, lkml

* Alexei Starovoitov [off-list ref] wrote:
BPF C program attaches to blk_mq_start_request/blk_update_request kprobe events
to calculate IO latency.
 ...
+/* kprobe is NOT a stable ABI
+ * This bpf+kprobe example can stop working any time.
+ */
+SEC("kprobe/blk_mq_start_request")
+int bpf_prog1(struct pt_regs *ctx)
+{
+	long rq = ctx->di;
+	u64 val = bpf_ktime_get_ns();
+
+	bpf_map_update_elem(&my_map, &rq, &val, BPF_ANY);
+	return 0;
+}
So just to make sure the original BPF instrumentation model is still 
upheld: no matter in what way the kernel changes, neither the kprobe, 
nor the BPF program can ever crash or corrupt the kernel, assuming the 
kprobes, perf and BPF subsystem has no bugs, correct?

So 'stops working' here means that the instrumentation data might not 
be reliable if kernel internal interfaces change - but it won't ever 
make the kernel unreliable in any fashion. Right?

Thanks,

	Ingo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help