X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=kernel%2Ftrace%2Ftrace_printk.c;h=2900817ba65c7187c34394814dbeed33c6b07c7a;hb=102c9323c35a83789ad5ebd3c45fa8fb389add88;hp=a9077c1b4ad3f402ecc7580b8c918e0b50db5318;hpb=4b781474682434e7881f20e9dfbe6687ea619795;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git diff --git a/kernel/trace/trace_printk.c b/kernel/trace/trace_printk.c index a9077c1..2900817 100644 --- a/kernel/trace/trace_printk.c +++ b/kernel/trace/trace_printk.c @@ -244,12 +244,31 @@ static const char **find_next(void *v, loff_t *pos) { const char **fmt = v; int start_index; + int last_index; start_index = __stop___trace_bprintk_fmt - __start___trace_bprintk_fmt; if (*pos < start_index) return __start___trace_bprintk_fmt + *pos; + /* + * The __tracepoint_str section is treated the same as the + * __trace_printk_fmt section. The difference is that the + * __trace_printk_fmt section should only be used by trace_printk() + * in a debugging environment, as if anything exists in that section + * the trace_prink() helper buffers are allocated, which would just + * waste space in a production environment. + * + * The __tracepoint_str sections on the other hand are used by + * tracepoints which need to map pointers to their strings to + * the ASCII text for userspace. + */ + last_index = start_index; + start_index = __stop___tracepoint_str - __start___tracepoint_str; + + if (*pos < last_index + start_index) + return __start___tracepoint_str + (*pos - last_index); + return find_next_mod_format(start_index, v, fmt, pos); }