Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ad474de authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'trace-v4.2-rc2-fix2' of...

Merge tag 'trace-v4.2-rc2-fix2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing sample code fix from Steven Rostedt:
 "He Kuang noticed that the sample code using the trace_event helper
  function __get_dynamic_array_len() is broken.

  This only changes the sample code, and I'm pushing this now instead of
  later because I don't want others using the broken code as an example
  when using it for real"

* tag 'trace-v4.2-rc2-fix2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix sample output of dynamic arrays
parents 9d634c41 d6726c81
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -168,7 +168,10 @@
 *
 *      For __dynamic_array(int, foo, bar) use __get_dynamic_array(foo)
 *            Use __get_dynamic_array_len(foo) to get the length of the array
 *            saved.
 *            saved. Note, __get_dynamic_array_len() returns the total allocated
 *            length of the dynamic array; __print_array() expects the second
 *            parameter to be the number of elements. To get that, the array length
 *            needs to be divided by the element size.
 *
 *      For __string(foo, bar) use __get_str(foo)
 *
@@ -288,7 +291,7 @@ TRACE_EVENT(foo_bar,
 *    This prints out the array that is defined by __array in a nice format.
 */
		  __print_array(__get_dynamic_array(list),
				__get_dynamic_array_len(list),
				__get_dynamic_array_len(list) / sizeof(int),
				sizeof(int)),
		  __get_str(str), __get_bitmask(cpus))
);