From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH v9 tip 6/9] samples: bpf: simple non-portable kprobe filter example Date: Mon, 23 Mar 2015 10:23:04 -0700 Message-ID: <55104BF8.8000606@plumgrid.com> References: <1426894210-27441-1-git-send-email-ast@plumgrid.com> <1426894210-27441-7-git-send-email-ast@plumgrid.com> <20150323072929.GB25184@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150323072929.GB25184-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Ingo Molnar Cc: Steven Rostedt , Namhyung Kim , Arnaldo Carvalho de Melo , Jiri Olsa , Masami Hiramatsu , "David S. Miller" , Daniel Borkmann , Peter Zijlstra , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org 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.