//************************************************************************** | |
//* | |
//* Copyright (c) 2016 ZTE Corporation. | |
//* | |
//************************************************************************** | |
// geanfeng | |
//************************************************************************** | |
//* ½Å±¾½âÎöÇøÓò | |
//************************************************************************** | |
//´´½¨Ò»¸ö´°¿Ú£» | |
&width=50. | |
&nameWidth=20. | |
&fileColumns=1000. | |
&fileLines=1000. | |
area.create trace &fileColumns &fileLines | |
area.clear trace | |
area.select trace | |
//´ò¿ªÎļþ£» | |
&dir=os.pwd()+"\log_kmalloc" | |
if !os.dir(&dir) | |
( | |
mkdir &dir | |
) | |
&file="&dir\result.txt" | |
area.open trace &file | |
area.view trace | |
//Èç¹ûT32ÔÚÔËÐÐÒª¶Ïס£» | |
if run() | |
( | |
break | |
) | |
&node=v.value(kmem_employ_head.next) | |
&head=v.value(&kmem_employ_head) | |
while !(&node==&head) | |
( | |
&addr=v.value(((struct heap_record*)&node)->addr) | |
&size=v.value(((struct heap_record*)&node)->size) | |
&thread=v.string(((struct heap_record*)&node)->task_name) | |
&i=0 | |
&stack="" | |
&stack_value=v.value(((struct heap_record*)&node)->stack_frame[&i]) | |
while &i<0xa | |
( | |
if !(&stack_value==0) | |
( | |
&stack_frame=Y.function(P:&stack_value) | |
&stack_frame=os.file.name("&stack_frame") | |
&stack="&stack"+"&i:"+"&stack_frame " | |
&i=&i+1 | |
&stack_value=v.value(((struct heap_record*)&node)->stack_frame[&i]) | |
) | |
else | |
( | |
goto next | |
) | |
) | |
next: | |
&size=format.decimal(10., &size) | |
print "node: "+"&node"+" addr: "+"&addr"+" size:"+"&size"+" thread:"+"&thread"+" stack_frame:"+"&stack" | |
&node=v.value(((struct list_head*)&node)->next) | |
) | |
print "allocated kmalloc End-----------------------------" | |
area.close trace | |
ENDDO | |
//****ÔËÐнáÊø***** |