History

bpf: clarify when bpf_trace_printk discards lines

I opened /sys/kernel/tracing/trace once and kept reading from it. bpf_trace_printk somehow did not seem to work, no entries were appended to that trace file. It turns out that tracing is disabled when that file is open. Save the next person some time and document this. The trace file is described in Documentation/trace/ftrace.rst, however the implication "tracing is disabled" did not immediate translate to "bpf_trace_printk silently discards entries".

Peter Wu committed 7 years ago

Commit 55c33df1 parent 8050a391 file · +2 −0Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/bpf.h+2−0
@@ -580,6 +580,8 @@ union bpf_attr { · 579 unmodified lines
580580 * limited to five).
581581 *
582582 * Each time the helper is called, it appends a line to the trace.
583+ * Lines are discarded while *\/sys/kernel/debug/tracing/trace* is
584+ * open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this.
583585 * The format of the trace is customizable, and the exact output
584586 * one will get depends on the options set in
585587 * *\/sys/kernel/debug/tracing/trace_options* (see also the

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t