summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-08-13 12:42:55 (GMT)
committerLinus Walleij <linus.walleij@linaro.org>2015-08-13 12:42:55 (GMT)
commit5f6f02cd49d61e9856ff2c337578316a1a1b3f88 (patch)
treefd2e6961e8f609af41dd4a282008e1bc52cfa7c7 /samples
parent3afa129a9de0957d72165cf08a54e5c69938011c (diff)
parentcbfe8fa6cd672011c755c3cd85c9ffd4e2d10a6f (diff)
downloadlinux-5f6f02cd49d61e9856ff2c337578316a1a1b3f88.tar.xz
Merge tag 'v4.2-rc4' into devel
Linux 4.2-rc4
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))
);