From e9c1439442e8c15766a5ae034d119ff7819a1571 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Mon, 10 Aug 2009 16:11:32 +0200 Subject: [PATCH] --- yaml --- r: 156639 b: refs/heads/master c: 304703aba31a87903b8c0db8f5e6890cac2d596d h: refs/heads/master i: 156637: d2dd6f9a13bbe4c3a0f5c752305a2b9353722b80 156635: 0d9f874161d4a1a531f6668b64329850bcfd0196 156631: 20d611b4300d6e9e055255fbf36f1147f7b64f0c 156623: 650de985dde38283c2c8506da14bfb7665f3bd27 156607: 8a41e2ab29a54e11021e807064d6315145cb107e v: v3 --- [refs] | 2 +- trunk/include/trace/ftrace.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 6767bf51cee0..d08e750312a1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a4e95fc2cbb31d70a65beffeaf8773f881328c34 +refs/heads/master: 304703aba31a87903b8c0db8f5e6890cac2d596d diff --git a/trunk/include/trace/ftrace.h b/trunk/include/trace/ftrace.h index 7167b9b97da2..a05524fa245d 100644 --- a/trunk/include/trace/ftrace.h +++ b/trunk/include/trace/ftrace.h @@ -637,7 +637,12 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ * pc = preempt_count(); * * __data_size = ftrace_get_offsets_(&__data_offsets, args); - * __entry_size = __data_size + sizeof(*entry); + * + * // Below we want to get the aligned size by taking into account + * // the u32 field that will later store the buffer size + * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32), + * sizeof(u64)); + * __entry_size -= sizeof(u32); * * do { * char raw_data[__entry_size]; <- allocate our sample in the stack @@ -687,6 +692,7 @@ static void ftrace_profile_##call(proto) \ __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ sizeof(u64)); \ + __entry_size -= sizeof(u32); \ \ do { \ char raw_data[__entry_size]; \