ftrace: tracing linux function calls

本文详细介绍如何在Linux系统中使用root权限配置内核跟踪功能,包括确认内核配置项如FTRACE、FUNCTION_GRAPH_TRACER等是否启用,以及如何挂载debugfs/tracefs进行系统级跟踪。同时,文章提供了内核跟踪触发器的设置方法,如funcgraph-irqs、tracing_on等,帮助读者深入理解Linux内核的运行机制。

First confirm that you have root privilege.

Second check the config of kernel that you have the configs on:

CONFIG_FTRACE=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_EVENT_TRACING=y
CONFIG_FUNCTION_TRACER
CONFIG_STACK_TRACER
CONFIG_DYNAMIC_FTRACE

Last you confirm you have your debugfs/tracefs mounted, by: 

mount -t debugfs nodev /sys/kernel/debug/

Then go into the sys entry tracing and you will find the friendly README.

List some triggers: 

options/funcgraph-irqs, tracing_on, max_graph_depth, set_graph_function, set_ftrace_filter, set_ftrace_pid, current_tracer.

stack_trace can probe runtime kernel address of functions.

转载于:https://www.cnblogs.com/sansna/p/9866015.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值