summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-27 18:15:16 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-27 18:15:16 (GMT)
commit722b262c966a388a1f8bfcdd100cd19c4ce59ab9 (patch)
tree34e755b07dbca16f65ad7eb5bb1fade06032cebf /samples
parent4e02bea82b4e6c1eebeac6e6f4ecb93e9c2aa8c0 (diff)
parentcbfe8fa6cd672011c755c3cd85c9ffd4e2d10a6f (diff)
downloadlinux-722b262c966a388a1f8bfcdd100cd19c4ce59ab9.tar.xz
Merge 4.2-rc4 into usb-next
We want the USB fixes that went into that release in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/trace_events/trace-events-sample.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index 8965d1b..125d640 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -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))
);