mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-27 03:20:56 +07:00
perf_counter: Subtract the buffer size field from the event record size
We compute the perf raw sample size by aligning the raw ftrace event size plus the buffer size field itself. We do that instead of aligning only the perf raw sample size, so that we might economize some in some cases. But this buffer size field is not stored in the perf raw sample, we must then substract its size from the buffer once we computed the alignment unless we may get a useless u32 field in the buffer. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20090810141129.GA5124@nowhere> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
a4e95fc2cb
commit
304703aba3
@ -637,7 +637,12 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
|
||||
* pc = preempt_count();
|
||||
*
|
||||
* __data_size = ftrace_get_offsets_<call>(&__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]; \
|
||||
|
Loading…
Reference in New Issue
Block a user