本文介绍: 怎么去掉这些不关心的irq函数调用呢?只能说自己一个脚本将其删除

Linux: ftrace: echo function_graphcurrent_tracer
在做这个函数调用图的时候,会发现这个函数调用非常的大,有些是irq的处理函数,也放在其中,前后标记

Line 18702:  1)   <========== |
Line 22335:  1)   ==========> |

commit f8b755ac8e0cc3f330269e4c4504514f987167a2
Author: Frederic Weisbecker fweisbec@gmail.com
Date: Tue Dec 9 23:55:25 2008 +0100
tracing/functiongraphtracer: Output arrows signal on hardirq call/return
Impact: make more obvious the hardirq calls in the output
When a hardirq is triggered inside the codeflow on output, we have now two arrows that indicate the entry and return of the hardirq.

怎么去掉这些不关心的irq的函数调用呢?只能说自己写一个脚本将其删除
python

f_trace = open('trace.out', 'r')
f_message = open('trace.out.out', 'w')

	
flag1 = 0 
for line in f_trace:
	if len(line)!=1: ###if the line is empty 
		if line.find("==========>")>-1:
			flag1=1

		if line.find("<==========")&gt;-1:
			flag1=0

		if flag1==0 and not line.find("<==========")&gt;-1:
			f_message.write(line)

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注