blob: fe1cf0e0fd62c5bb7c68668b0879a2680dd5fd82 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001//**************************************************************************
2//*
3//* Copyright (c) 2016 ZTE Corporation.
4//*
5//**************************************************************************
6// geanfeng
7
8//**************************************************************************
9//* ½Å±¾½âÎöÇøÓò
10//**************************************************************************
11//´´½¨Ò»¸ö´°¿Ú£»
12&width=50.
13&nameWidth=20.
14&fileColumns=1000.
15&fileLines=1000.
16
17area.create trace &fileColumns &fileLines
18area.clear trace
19area.select trace
20
21//´ò¿ªÎļþ£»
22&dir=os.pwd()+"\log_kmalloc"
23if !os.dir(&dir)
24(
25 mkdir &dir
26)
27&file="&dir\result.txt"
28area.open trace &file
29area.view trace
30
31//Èç¹ûT32ÔÚÔËÐÐÒª¶Ïס£»
32if run()
33(
34 break
35)
36
37&node=v.value(kmem_employ_head.next)
38
39&head=v.value(&kmem_employ_head)
40
41while !(&node==&head)
42(
43 &addr=v.value(((struct heap_record*)&node)->addr)
44 &size=v.value(((struct heap_record*)&node)->size)
45 &thread=v.string(((struct heap_record*)&node)->task_name)
46 &i=0
47 &stack=""
48 &stack_value=v.value(((struct heap_record*)&node)->stack_frame[&i])
49 while &i<0xa
50 (
51 if !(&stack_value==0)
52 (
53 &stack_frame=Y.function(P:&stack_value)
54 &stack_frame=os.file.name("&stack_frame")
55 &stack="&stack"+"&i:"+"&stack_frame "
56 &i=&i+1
57 &stack_value=v.value(((struct heap_record*)&node)->stack_frame[&i])
58 )
59 else
60 (
61 goto next
62 )
63 )
64next:
65 &size=format.decimal(10., &size)
66 print "node: "+"&node"+" addr: "+"&addr"+" size:"+"&size"+" thread:"+"&thread"+" stack_frame:"+"&stack"
67 &node=v.value(((struct list_head*)&node)->next)
68)
69
70print "allocated kmalloc End-----------------------------"
71
72area.close trace
73ENDDO
74//****ÔËÐнáÊø*****