Merge tag 'trace-v4.4-rc4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Jan 2016 21:32:39 +0000 (13:32 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Jan 2016 21:32:39 +0000 (13:32 -0800)
Pull tracing fixes from Steven Rostedt:
 "Two more fixes:

  1. The recordmcount change had an output that used sprintf()
     (incorrectly) when it should have been a fprintf() to stderr.

  2. The printk_formats file could crash if someone added a
     trace_printk() in the core kernel, and also added one in a module.
     This does not affect production kernels.  Only kernels where
     developers add trace_printk() for debugging can crash"

* tag 'trace-v4.4-rc4-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix setting of start_index in find_next()
  ftrace/scripts: Fix incorrect use of sprintf in recordmcount

kernel/trace/trace_printk.c
scripts/recordmcount.c

index 1c2b28536feb8113a408b2335c38fb0a0c4272e1..060df67dbdd1d038dba8ec35909890f3e892b6d7 100644 (file)
@@ -273,6 +273,7 @@ static const char **find_next(void *v, loff_t *pos)
        if (*pos < last_index + start_index)
                return __start___tracepoint_str + (*pos - last_index);
 
+       start_index += last_index;
        return find_next_mod_format(start_index, v, fmt, pos);
 }
 
index 301d70b0174f3b3ff3aaea7a721ffdd905a576f9..e167592793a70e8a1bac057d58ca7456e064db8e 100644 (file)
@@ -586,7 +586,7 @@ main(int argc, char *argv[])
                        do_file(file);
                        break;
                case SJ_FAIL:    /* error in do_file or below */
-                       sprintf("%s: failed\n", file);
+                       fprintf(stderr, "%s: failed\n", file);
                        ++n_error;
                        break;
                case SJ_SUCCEED:    /* premature success */