summaryrefslogtreecommitdiffstats
path: root/Kconfig
diff options
context:
space:
mode:
authorZheng Yejian <zhengyejian1@huawei.com>2023-09-06 17:18:37 +0800
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-10-03 19:02:06 -0400
commita1f157c7a3bb342b972c2830a0ad53f627000a04 (patch)
tree581975ca6adeec96d277589b662de30085c067f3 /Kconfig
parent8a749fd1a8720d4619c91c8b6e7528c0a355c0aa (diff)
downloadlinux-stable-a1f157c7a3bb342b972c2830a0ad53f627000a04.tar.gz
linux-stable-a1f157c7a3bb342b972c2830a0ad53f627000a04.tar.bz2
linux-stable-a1f157c7a3bb342b972c2830a0ad53f627000a04.zip
tracing: Expand all ring buffers individually
The ring buffer of global_trace is set to the minimum size in order to save memory on boot up and then it will be expand when some trace feature enabled. However currently operations under an instance can also cause global_trace ring buffer being expanded, and the expanded memory would be wasted if global_trace then not being used. See following case, we enable 'sched_switch' event in instance 'A', then ring buffer of global_trace is unexpectedly expanded to be 1410KB, also the '(expanded: 1408)' from 'buffer_size_kb' of instance is confusing. # cd /sys/kernel/tracing # mkdir instances/A # cat buffer_size_kb 7 (expanded: 1408) # cat instances/A/buffer_size_kb 1410 (expanded: 1408) # echo sched:sched_switch > instances/A/set_event # cat buffer_size_kb 1410 # cat instances/A/buffer_size_kb 1410 To fix it, we can: - Make 'ring_buffer_expanded' as a member of 'struct trace_array'; - Make 'ring_buffer_expanded' of instance is defaultly true, global_trace is defaultly false; - In order not to expose 'global_trace' outside of file 'kernel/trace/trace.c', introduce trace_set_ring_buffer_expanded() to set 'ring_buffer_expanded' as 'true'; - Pass the expected trace_array to tracing_update_buffers(). Link: https://lore.kernel.org/linux-trace-kernel/20230906091837.3998020-1-zhengyejian1@huawei.com Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'Kconfig')
0 files changed, 0 insertions, 0 deletions