yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | //**************************************************************************
|
| 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 |
|
| 17 | area.create trace &fileColumns &fileLines
|
| 18 | area.clear trace
|
| 19 | area.select trace
|
| 20 |
|
| 21 | //´ò¿ªÎļþ£»
|
| 22 | &dir=os.pwd()+"\log_buddfy"
|
| 23 | if !os.dir(&dir)
|
| 24 | (
|
| 25 | mkdir &dir
|
| 26 | )
|
| 27 | &file="&dir\result.txt"
|
| 28 | area.open trace &file
|
| 29 | area.view trace
|
| 30 |
|
| 31 | //Èç¹ûT32ÔÚÔËÐÐÒª¶Ïס£»
|
| 32 | if run()
|
| 33 | (
|
| 34 | break
|
| 35 | )
|
| 36 | &node=v.value(buddy_employ_head.next)
|
| 37 | &head=v.value(&buddy_employ_head)
|
| 38 | while !(&node==&head)
|
| 39 | (
|
| 40 | &addr=v.value(((struct heap_record*)&node)->addr)
|
| 41 | &size=v.value(((struct heap_record*)&node)->size)
|
| 42 | &thread=v.string(((struct heap_record*)&node)->task_name)
|
| 43 | &i=0
|
| 44 | &stack=""
|
| 45 | &stack_value=v.value(((struct heap_record*)&node)->stack_frame[&i])
|
| 46 | while &i<0xa
|
| 47 | (
|
| 48 | if !(&stack_value==0)
|
| 49 | (
|
| 50 | &stack_frame=Y.function(P:&stack_value)
|
| 51 | &stack_frame=os.file.name("&stack_frame")
|
| 52 | &stack="&stack"+"&i:"+"&stack_frame "
|
| 53 | &i=&i+1
|
| 54 | &stack_value=v.value(((struct heap_record*)&node)->stack_frame[&i])
|
| 55 | )
|
| 56 | else
|
| 57 | (
|
| 58 | goto next
|
| 59 | )
|
| 60 | )
|
| 61 | next:
|
| 62 | &size=format.decimal(10., &size)
|
| 63 | print "node: "+"&node"+" addr: "+"&addr"+" size:"+"&size"+" thread:"+"&thread"+" stack_frame:"+"&stack"
|
| 64 | &node=v.value(((struct list_head*)&node)->next)
|
| 65 | )
|
| 66 |
|
| 67 | print "allocated hobby End-----------------------------"
|
| 68 |
|
| 69 | area.close trace
|
| 70 | ENDDO
|
| 71 | //****ÔËÐнáÊø*****
|