0
点赞
收藏
分享

微信扫一扫

Google Guava 数学工具使用详解

小时候是个乖乖 2023-12-04 阅读 53

Linux: ftrace: echo function_graph > current_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/function-graph-tracer: 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("<==========")>-1:
			flag1=0

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

举报

相关推荐

0 条评论