Re: [PATCH v9 tip 5/9] tracing: allow BPF programs to call bpf_trace_printk()

2015-03-22 Thread Alexei Starovoitov
On 3/22/15 4:10 AM, Ingo Molnar wrote: * Alexei Starovoitov wrote: +static const struct bpf_func_proto bpf_trace_printk_proto = { + .func = bpf_trace_printk, + .gpl_only = true, + .ret_type = RET_INTEGER, + .arg1_type = ARG_PTR_TO_STACK, + .arg2_type = ARG_CONST_

Re: [PATCH v9 tip 5/9] tracing: allow BPF programs to call bpf_trace_printk()

2015-03-22 Thread Ingo Molnar
* Alexei Starovoitov wrote: > +static const struct bpf_func_proto bpf_trace_printk_proto = { > + .func = bpf_trace_printk, > + .gpl_only = true, > + .ret_type = RET_INTEGER, > + .arg1_type = ARG_PTR_TO_STACK, > + .arg2_type = ARG_CONST_STACK_SIZE, > +}; A nit, please align s

[PATCH v9 tip 5/9] tracing: allow BPF programs to call bpf_trace_printk()

2015-03-20 Thread Alexei Starovoitov
Debugging of BPF programs needs some form of printk from the program, so let programs call limited trace_printk() with %d %u %x %p modifiers only. Similar to kernel modules, during program load verifier checks whether program is calling bpf_trace_printk() and if so, kernel allocates trace_printk b