抓取高通ftrace

高通文档

写成脚本

 

#!/system/bin/sh

DIR=/sys/kernel/tracing

echo 0 > $DIR/tracing_on

echo "" > $DIR/trace

rm -rf /data/local/trace.txt

echo 0 > $DIR/tracing_on

echo 150000 > $DIR/buffer_size_kb

cat $DIR/buffer_size_kb

echo "" > $DIR/set_event

echo "" > $DIR/trace

echo clk:clk_disable clk:clk_enable clk:clk_set_rate clk:clk_state >> $DIR/set_event

echo power:cpu_frequency power:cpu_idle sched:sched_wakeup sched:sched_switch sched:sched_enq_deq_task >> $DIR/set_event

echo sched:sched_find_best_target >> $DIR/set_event

echo sched:sched_task_util_colocated sched:sched_task_util_bias_to_waker >> $DIR/set_event

echo sched:sched_update_task_ravg sched:sched_load_to_gov >> $DIR/set_event

echo power:bw_hwmon_meas power:bw_hwmon_update power:memlat_dev_meas power:memlat_dev_update >>$DIR/set_event

echo sched:core_ctl_eval_need perf_trace_counters:sched_switch_with_ctrs >> $DIR/set_event

echo sched:sched_set_boost sched:sched_set_preferred_cluster >> $DIR/set_event

echo power:sugov_next_freq power:sugov_util_update >> $DIR/set_event

echo sched:sched_migrate_task sched:sched_load_balance sched:sched_task_util >> $DIR/set_event

echo msm_bus:bus_update_request >> $DIR/set_event

echo kgsl:kgsl_clk kgsl:kgsl_pwrlevel kgsl:kgsl_buslevel kgsl:kgsl_gpubusy kgsl:kgsl_pwrstats kgsl:kgsl_pwr_set_state >> $DIR/set_event

echo regulator:regulator_set_voltage_complete regulator:regulator_disable_complete regulator:regulator_enable_complete >> $DIR/set_event

cat $DIR/set_event

cat /d/clk/trace_clocks

if [ -d "/d/tracing/events/msm_bus/bus_client_status" ]; then

         echo "bus_client_status exists hence enabling it"

         echo 1 > /d/tracing/events/msm_bus/bus_client_status/enable

         cat /d/msm-bus-dbg/client-data/dump_clients

fi

sleep 5

echo 1 > /d/tracing/events/clk/clk_state/enable

echo 1 > $DIR/tracing_on

sleep 60

echo 0 > $DIR/tracing_on

cat $DIR/trace > /data/local/trace.txt

cat &(date) >> /data/local/trace.txt

 

我一般的步骤是:

adb push ftrace_test.sh /data

chmod 777 ftrace_test.sh

nohup ./ftrace_test.sh &

抓到后在/data/local 下会出现trace.txt

adb pull /data/local/trace.txt .

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值