Re: [PATCH v9 tip 6/9] samples: bpf: simple non-portable kprobe filter example

Alexei Starovoitov
2015-03-23T17:23:32Z

On 3/23/15 12:29 AM, Ingo Molnar wrote:
>
>> ** **
>> ** This means that this is a DEBUG kernel and it is **
>> ** unsafe for production use. **
>
> But I think printing that it's unsafe for production use is over the
> top: it's up to the admin whether it's safe or unsafe, just like
> inserting a kprobe can be safe or unsafe.
>
> Informing that something happened is enough.

Well that is Steven's banner and I agree that it's a bit extreme.
I think it's done on purpose to scary people away from using
trace_printk() for anything other than debug.
It applies to both native trace_printk() for kernel debugging and
for bpf_trace_printk() for debugging of bpf programs.
I don't have a strong opinion about native case, but for bpf I do want
this banner to be scary. Otherwise it's too easy to start using
bpf_trace_printk() to pass event notifications to user space.
bpf_trace_printk and trace_pipe parsing shouldn't be used as a way
to communicate between programs and user space.
At the end, in actual production use, bpf programs won't be using it
and no banner will be seen.
Anyway, I don't think I can change this banner in this patch set.
If we decide to relax it, it should be done via Steven's tree.