共 11 篇文章
显示摘要每页显示  条
注:对于为什么去掉 tracing_enabled 我问过 Ftrace 的维护人Steven Rostedt,他说使用 tracing_on 可以快速的打开 Ftrace 的追踪,这让 tracing_enabled 显得很轻量级或者说显得比较冗余,下面可以会说到,我们写内核程序时可以使用Ftrace 提供的内核函数 tracing_on() or tracing_off() 直接打开追踪,这其实就是使用的 tracing_on ,所以在...
[tracing]# echo hello world >trace_marker [tracing]# cat trace # tracer: nop # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | <...>-3718 [001] 5546.183420: 0: hello world.if (trace_fd >= 0) write(trace_fd, "1", 1);[tracing]# echo 0 >tracing_on [tracing]# echo function_graph >current_tracer ...
[tracing]# echo function_graph >current_tracer [tracing]# insmod ~/modules/foo.ko [tracing]# cat trace # tracer: function_graph # # CPU DURATION FUNCTION CALLS # | | | | | | | 3) + 16.283 us | } 3) + 17.364 us | } 3) | do_one_initcall() { 3) | /* read foo 10 out of bar ffff88001191bef8 */ 3) 4.221 us | } 3) | __wak...
note: /d is a symbol link to /sys/kernel/debugecho 0 >tracing_onecho >traceecho tracename >/d/tracing/current_tracerecho 1 >/d/tracing/tracing_enabledecho 1 >tracing_on.echo nop >/d/tracing/current_tracerecho 0 >tracing_onecho >traceecho eventname >set_eventecho 1 >/d/tracing/tracing_enab...
Using the TRACE./* This part must be outside protection */ #undef TRACE_INCLUDE_PATH #define TRACE_INCLUDE_PATH .#define TRACE_INCLUDE_FILE silly-trace #include <trace/define_trace.h>Theinclude/trace/define_trace.h file does some basic set up for the TRACE_EVENT() macro,but for a trace to take advantage of it, i...
Since these functions have unique prototypes (defined by theTP_PROTO and TP_ARGS macros in the TRACE_EVENT()definition),reference unique structures (defined by theTP_STRUCT__entry macro), assignthem uniquely to the ring buffer (as defined by TP_fast_assign), and has a unique wayto print out the data (defined in TP_pri...
TP_STRUCT__entry(__array(char,prev_comm,TASK_COMM_LEN)__field(pid_t,prev_pid)__field(int,prev_prio)__field(long,prev_state)__array(char,next_comm,TASK_COMM_LEN)__field(pid_t,next_pid)__field(int,next_prio) ),TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s ==> ""next_comm=%s next_pid=%d...
帮助 | 留言交流 | 联系我们 | 服务条款 | 下载网文摘手 | 下载手机客户端
北京六智信息技术股份有限公司 Copyright© 2005-2024 360doc.com , All Rights Reserved
京ICP证090625号 京ICP备05038915号 京网文[2016]6433-853号 京公网安备11010502030377号
返回
顶部