Skip to content

Commit

Permalink
Merge tag 'trace-v4.7-rc3' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/rostedt/linux-trace

Pull tracing fixes from Steven Rostedt:
 "Two fixes for the tracing system:

   - When trace_printk() is used with a non constant format descriptor,
     it adds a NULL pointer into the trace format section, and the code
     isn't prepared to deal with it.  This bug appeared by a change that
     was added in v3.5.

   - The ftracetest (selftests section) can't handle testing histograms
     when histograms are not configured.  Currently it shows that they
     fail the test, when they should state that they are unsupported.
     This bug was added in the 4.7 merge window with the addition of the
     historgram code"

* tag 'trace-v4.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  ftracetest: Fix hist unsupported result in hist selftests
  tracing: Handle NULL formats in hold_module_trace_bprintk_format()
  • Loading branch information
torvalds committed Jun 20, 2016
2 parents 97f78c7 + 0ded517 commit f780f00
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
7 changes: 6 additions & 1 deletion kernel/trace/trace_printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ struct trace_bprintk_fmt {
static inline struct trace_bprintk_fmt *lookup_format(const char *fmt)
{
struct trace_bprintk_fmt *pos;

if (!fmt)
return ERR_PTR(-EINVAL);

list_for_each_entry(pos, &trace_bprintk_fmt_list, list) {
if (!strcmp(pos->fmt, fmt))
return pos;
Expand All @@ -57,7 +61,8 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
for (iter = start; iter < end; iter++) {
struct trace_bprintk_fmt *tb_fmt = lookup_format(*iter);
if (tb_fmt) {
*iter = tb_fmt->fmt;
if (!IS_ERR(tb_fmt))
*iter = tb_fmt->fmt;
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ if [ ! -f events/sched/sched_process_fork/trigger ]; then
exit_unsupported
fi

reset_tracer
do_reset

FEATURE=`grep hist events/sched/sched_process_fork/trigger`
if [ -z "$FEATURE" ]; then
if [ ! -f events/sched/sched_process_fork/hist ]; then
echo "hist trigger is not supported"
exit_unsupported
fi

reset_tracer
do_reset

echo "Test histogram with execname modifier"

echo 'hist:keys=common_pid.execname' > events/sched/sched_process_fork/trigger
Expand Down
9 changes: 4 additions & 5 deletions tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ if [ ! -f events/sched/sched_process_fork/trigger ]; then
exit_unsupported
fi

reset_tracer
do_reset

FEATURE=`grep hist events/sched/sched_process_fork/trigger`
if [ -z "$FEATURE" ]; then
if [ ! -f events/sched/sched_process_fork/hist ]; then
echo "hist trigger is not supported"
exit_unsupported
fi

reset_tracer
do_reset

echo "Test histogram basic tigger"

echo 'hist:keys=parent_pid:vals=child_pid' > events/sched/sched_process_fork/trigger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ if [ ! -f events/sched/sched_process_fork/trigger ]; then
exit_unsupported
fi

reset_tracer
do_reset

FEATURE=`grep hist events/sched/sched_process_fork/trigger`
if [ -z "$FEATURE" ]; then
if [ ! -f events/sched/sched_process_fork/hist ]; then
echo "hist trigger is not supported"
exit_unsupported
fi

reset_tracer
do_reset

reset_trigger

echo "Test histogram multiple tiggers"
Expand Down

0 comments on commit f780f00

Please sign in to comment.