ftrace buffer size

toor4@lrc:/sys/kernel/debug/tracing# cat buffer_total_size_kb
22528
toor4@lrc:/sys/kernel/debug/tracing# cat buffer_size_kb (每CPU的ftrace buffer size)
1408
toor4@lrc:/sys/kernel/debug/tracing# e cho $[1408*16]    (系统有16个core)
22528

[xiatian@ou28 trace]$ pwd
/var/xiatian/lfs_linux/Documentation/trace
[xiatian@ou28 trace]$ more ftrace.txt:
  buffer_size_kb:
         This sets or displays the number of kilobytes each CPUbuffer holds. By default, the trace buffers are the same size for each CPU. The displayed number is the size of the CPU buffer and not total size of all buffers. The trace buffers are allocated in pages (blocks of memory that the kernel uses for allocation, usually 4 KB in size).
        If the last page allocated has room for more bytes than requested, the rest of the page will be used, making the actual allocation bigger than requested.( Note, the size may not be a multiple of the page size due to buffer management meta-data. )

  buffer_total_size_kb:
        This displays the total combined size of all the trace buffers.

  per_cpu/cpu0/buffer_size_kb :
         The ftrace buffer is defined per_cpu. That is, there's a separate buffer for each CPU to allow writes to be done atomically,  and free from cache bouncing. These buffers may have different size buffers. This file is similar to the buffer_size_kb file, but it only displays or sets the buffer size for the specific CPU. (here cpu0).

toor4@lrc: /sys/kernel/debug/tracing# ls
README                buffer_total_size_kb  instances             printk_formats        trace                 trace_pipe            tracing_thresh
available_events      current_tracer        latency_hist          saved_cmdlines        trace_clock           tracing_cpumask
available_tracers     events                options               set_event             trace_marker          tracing_max_latency
buffer_size_kb        free_buffer           per_cpu               snapshot              trace_options         tracing_on
toor4@lrc:/sys/kernel/debug/tracing# cat buffer_total_size_kb
22528 (16core*1408)
toor4@lrc:/sys/kernel/debug/tracing# cat buffer_size_kb
1408
toor4@lrc:/sys/kernel/debug/tracing# cat per_cpu/cpu0/buffer_size_kb
1408
toor4@lrc:/sys/kernel/debug/tracing# echo 4096 > buffer_size_kb   (将作用于所有:per_cpu/cpux/buffer_size_kb)
toor4@lrc:/sys/kernel/debug/tracing# cat buffer_size_kb
4096
toor4@lrc:/sys/kernel/debug/tracing# cat per_cpu/cpu0/buffer_size_kb
4096
toor4@lrc:/sys/kernel/debug/tracing# cat per_cpu/cpu1/buffer_size_kb 
4096
toor4@lrc:/sys/kernel/debug/tracing# echo 4095 > per_cpu/cpu1/buffer_size_kb   (只对本core起作用)
toor4@lrc:/sys/kernel/debug/tracing# cat buffer_size_kb (/sys/kernel/debug/tracing/buffer_size_kb将无法无确定)
X
toor4@lrc:/sys/kernel/debug/tracing# cat per_cpu/cpu1/buffer_size_kb
4095
toor4@lrc:/sys/kernel/debug/tracing# cat per_cpu/cpu0/buffer_size_kb
4096
toor4@lrc:/sys/kernel/debug/tracing# cat per_cpu/cpu2/buffer_size_kb 
4096

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值