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 | //¶¨Òå¾Ö²¿±äÁ¿
|
| 13 | local &os_time0 &os_time1 &os_time2 &os_time3 &os_time4 &os_time5 &os_time6 &os_time7
|
| 14 | local &os_time_cnt &os_next_time
|
| 15 | local &os_swap_last &os_swap_cnt &os_swap_next
|
| 16 | local &os_irq_start_last &os_irq_start_cnt &os_irq_start_next
|
| 17 | local &os_irq_end_last &os_irq_end_cnt &os_irq_end_next
|
| 18 |
|
| 19 | //for linux
|
| 20 | local &os_softirq_start_last &os_softirq_start_cnt &os_softirq_start_next
|
| 21 | local &os_softirq_end_last &os_softirq_end_cnt &os_softirq_end_next
|
| 22 | local &os_timer_start_last &os_timer_start_cnt &os_timer_start_next
|
| 23 | local &os_timer_end_last &os_timer_end_cnt &os_timer_end_next
|
| 24 |
|
| 25 | local &os_irq_enable &os_softirq_enable &os_timer_enable
|
| 26 | &os_irq_enable=1
|
| 27 | &os_softirq_enable=0
|
| 28 | &os_timer_enable=0
|
| 29 |
|
| 30 | //for tos
|
| 31 | local &os_dsr_start_last &os_dsr_start_cnt &os_dsr_start_next
|
| 32 | local &os_dsr_end_last &os_dsr_end_cnt &os_dsr_end_next
|
| 33 | &os_dsr_enable=0
|
| 34 |
|
| 35 | //´´½¨Ò»¸ö´°¿Ú£»
|
| 36 | &width=20.
|
| 37 | &nameWidth=20.
|
| 38 | &fileColumns=200.
|
| 39 | &fileLines=500.
|
| 40 |
|
| 41 | area.create trace &fileColumns &fileLines
|
| 42 | area.clear trace
|
| 43 | area.select trace
|
| 44 |
|
| 45 | //´ò¿ªÎļþ£»
|
| 46 | &dir=os.pwd()+"\log"
|
| 47 | if !os.dir(&dir)
|
| 48 | (
|
| 49 | mkdir &dir
|
| 50 | )
|
| 51 | &file="&dir\result.txt"
|
| 52 | area.open trace &file
|
| 53 | area.view trace
|
| 54 |
|
| 55 | //Èç¹ûT32ÔÚÔËÐÐÒª¶Ïס£»
|
| 56 | if run()
|
| 57 | (
|
| 58 | break
|
| 59 | )
|
| 60 |
|
| 61 | if symbol.exist(init_task)
|
| 62 | (
|
| 63 | gosub LinuxTrace
|
| 64 | )
|
| 65 |
|
| 66 | if symbol.exist(tos_except)
|
| 67 | (
|
| 68 | gosub TosTrace
|
| 69 | )
|
| 70 |
|
| 71 | area.close trace
|
| 72 |
|
| 73 | ENDDO
|
| 74 | //****ÔËÐнáÊø*****
|
| 75 |
|
| 76 | //*****************º¯Êý¶¨Òå**********************
|
| 77 |
|
| 78 | ; ---------------------------------------------------------
|
| 79 | LinuxTrace:
|
| 80 | local &result
|
| 81 |
|
| 82 | if v.value(g_os_ddr_swapin_statistic)==0
|
| 83 | (
|
| 84 | RETURN
|
| 85 | )
|
| 86 |
|
| 87 | &os_swap_last=v.value(g_os_ddr_swapin_statistic->index)
|
| 88 | &os_swap_cnt=v.value(sizeof(g_os_ddr_swapin_statistic->statistics)/sizeof(g_os_ddr_swapin_statistic->statistics[0]))
|
| 89 | &os_swap_next=&os_swap_last
|
| 90 |
|
| 91 | if &os_irq_enable==1
|
| 92 | (
|
| 93 | &os_irq_start_last=v.value(g_os_ddr_irq_start_statistic->index)
|
| 94 | &os_irq_start_cnt=v.value(sizeof(g_os_ddr_irq_start_statistic->statistics)/sizeof(g_os_ddr_irq_start_statistic->statistics[0]))
|
| 95 | &os_irq_start_next=&os_irq_start_last
|
| 96 | &os_irq_end_last=v.value(g_os_ddr_irq_end_statistic->index)
|
| 97 | &os_irq_end_cnt=v.value(sizeof(g_os_ddr_irq_end_statistic->statistics)/sizeof(g_os_ddr_irq_end_statistic->statistics[0]))
|
| 98 | &os_irq_end_next=&os_irq_end_last
|
| 99 | )
|
| 100 | else
|
| 101 | (
|
| 102 | &os_irq_start_next=-1
|
| 103 | &os_irq_end_next=-1
|
| 104 | )
|
| 105 |
|
| 106 | if &os_softirq_enable==1
|
| 107 | (
|
| 108 | &os_softirq_start_last=v.value(g_os_ddr_softirq_start_statistic->index)
|
| 109 | &os_softirq_start_cnt=v.value(sizeof(g_os_ddr_softirq_start_statistic->statistics)/sizeof(g_os_ddr_softirq_start_statistic->statistics[0]))
|
| 110 | &os_softirq_start_next=&os_softirq_start_last
|
| 111 | &os_softirq_end_last=v.value(g_os_ddr_softirq_end_statistic->index)
|
| 112 | &os_softirq_end_cnt=v.value(sizeof(g_os_ddr_softirq_end_statistic->statistics)/sizeof(g_os_ddr_softirq_end_statistic->statistics[0]))
|
| 113 | &os_softirq_end_next=&os_softirq_end_last
|
| 114 | )
|
| 115 | else
|
| 116 | (
|
| 117 | &os_softirq_start_next=-1
|
| 118 | &os_softirq_end_next=-1
|
| 119 | )
|
| 120 |
|
| 121 | if &os_timer_enable==1
|
| 122 | (
|
| 123 | &os_timer_start_last=v.value(g_os_ddr_timer_start_statistic->index)
|
| 124 | &os_timer_start_cnt=v.value(sizeof(g_os_ddr_timer_start_statistic->statistics)/sizeof(g_os_ddr_timer_start_statistic->statistics[0]))
|
| 125 | &os_timer_start_next=&os_timer_start_last
|
| 126 | &os_timer_end_last=v.value(g_os_ddr_timer_end_statistic->index)
|
| 127 | &os_timer_end_cnt=v.value(sizeof(g_os_ddr_timer_end_statistic->statistics)/sizeof(g_os_ddr_timer_end_statistic->statistics[0]))
|
| 128 | &os_timer_end_next=&os_timer_end_last
|
| 129 | )
|
| 130 | else
|
| 131 | (
|
| 132 | &os_timer_start_next=-1
|
| 133 | &os_timer_end_next=-1
|
| 134 | )
|
| 135 |
|
| 136 | //³õʼ»¯timeÊýÖµ
|
| 137 | if &os_swap_next==-1
|
| 138 | (
|
| 139 | &os_time0=-1
|
| 140 | )
|
| 141 | else
|
| 142 | (
|
| 143 | &os_time0=v.value(g_os_ddr_swapin_statistic->statistics[&os_swap_next].data2)
|
| 144 | )
|
| 145 | if &os_irq_start_next==-1
|
| 146 | (
|
| 147 | &os_time1=-1
|
| 148 | )
|
| 149 | else
|
| 150 | (
|
| 151 | &os_time1=v.value(g_os_ddr_irq_start_statistic->statistics[&os_irq_start_next].data2)
|
| 152 | )
|
| 153 | if &os_irq_end_next==-1
|
| 154 | (
|
| 155 | &os_time2=-1
|
| 156 | )
|
| 157 | else
|
| 158 | (
|
| 159 | &os_time2=v.value(g_os_ddr_irq_end_statistic->statistics[&os_irq_end_next].data2)
|
| 160 | )
|
| 161 | if &os_softirq_start_next==-1
|
| 162 | (
|
| 163 | &os_time3=-1
|
| 164 | )
|
| 165 | else
|
| 166 | (
|
| 167 | &os_time3=v.value(g_os_ddr_softirq_start_statistic->statistics[&os_softirq_start_next].data2)
|
| 168 | )
|
| 169 | if &os_softirq_end_next==-1
|
| 170 | (
|
| 171 | &os_time4=-1
|
| 172 | )
|
| 173 | else
|
| 174 | (
|
| 175 | &os_time4=v.value(g_os_ddr_softirq_end_statistic->statistics[&os_softirq_end_next].data2)
|
| 176 | )
|
| 177 | if &os_timer_start_next==-1
|
| 178 | (
|
| 179 | &os_time5=-1
|
| 180 | )
|
| 181 | else
|
| 182 | (
|
| 183 | &os_time5=v.value(g_os_ddr_timer_start_statistic->statistics[&os_timer_start_next].data2)
|
| 184 | )
|
| 185 | if &os_timer_end_next==-1
|
| 186 | (
|
| 187 | &os_time6=-1
|
| 188 | )
|
| 189 | else
|
| 190 | (
|
| 191 | &os_time6=v.value(g_os_ddr_timer_end_statistic->statistics[&os_timer_end_next].data2)
|
| 192 | )
|
| 193 |
|
| 194 | &os_time_cnt=7.
|
| 195 | &os_next_time=0.
|
| 196 |
|
| 197 | print format.string("Name",32,' ')+" "+"Index"+" "+"Time"+" "+"Exce"
|
| 198 |
|
| 199 | &result=0
|
| 200 | while &result==0
|
| 201 | (
|
| 202 | gosub LinuxPrintNextLine
|
| 203 | if ((&os_swap_next==-1)&&(&os_irq_start_next==-1)&&(&os_irq_end_next==-1)&&(&os_softirq_start_next==-1)&&(&os_softirq_end_next==-1)&&(&os_timer_start_next==-1)&&(&os_timer_end_next==-1))
|
| 204 | (
|
| 205 | print "END"
|
| 206 | &result=-1
|
| 207 | )
|
| 208 | )
|
| 209 | RETURN
|
| 210 |
|
| 211 | ; ---------------------------------------------------------
|
| 212 | LinuxPrintNextLine:
|
| 213 | local &time &str &line_index
|
| 214 |
|
| 215 | gosub GetMinTimeIndex &os_time_cnt
|
| 216 | ENTRY &index
|
| 217 |
|
| 218 | if &index==0
|
| 219 | (
|
| 220 | local &task &addr
|
| 221 | &task=v.value(g_os_ddr_swapin_statistic->statistics[&os_swap_next].data1)
|
| 222 | &addr=v.value(&((struct task_struct*)&task)->comm)
|
| 223 | &str="THREAD: "+data.string(D:&addr)
|
| 224 | &line_index=&os_swap_next
|
| 225 | &time=&os_time0
|
| 226 | gosub GetNextIndex &os_swap_cnt &os_swap_last &os_swap_next
|
| 227 | ENTRY &os_swap_next
|
| 228 | if &os_swap_next==-1
|
| 229 | (
|
| 230 | &os_time0=-1
|
| 231 | )
|
| 232 | else
|
| 233 | (
|
| 234 | &os_time0=v.value(g_os_ddr_swapin_statistic->statistics[&os_swap_next].data2)
|
| 235 | )
|
| 236 | )
|
| 237 | else if &index==1
|
| 238 | (
|
| 239 | local &irq &addr
|
| 240 | &irq=v.value(g_os_ddr_irq_start_statistic->statistics[&os_irq_start_next].data1)
|
| 241 | &addr=v.value(irq_desc[&irq].action->name)
|
| 242 | &str="IRQSTA: "+data.string(D:&addr)+" S"
|
| 243 | &line_index=&os_irq_start_next
|
| 244 | &time=&os_time1
|
| 245 | gosub GetNextIndex &os_irq_start_cnt &os_irq_start_last &os_irq_start_next
|
| 246 | ENTRY &os_irq_start_next
|
| 247 | if &os_irq_start_next==-1
|
| 248 | (
|
| 249 | &os_time1=-1
|
| 250 | )
|
| 251 | else
|
| 252 | (
|
| 253 | &os_time1=v.value(g_os_ddr_irq_start_statistic->statistics[&os_irq_start_next].data2)
|
| 254 | )
|
| 255 | )
|
| 256 | else if &index==2
|
| 257 | (
|
| 258 | local &irq &addr
|
| 259 | &irq=v.value(g_os_ddr_irq_end_statistic->statistics[&os_irq_end_next].data1)
|
| 260 | &addr=v.value(irq_desc[&irq].action->name)
|
| 261 | &str="IRQEND: "+data.string(D:&addr)+" E"
|
| 262 | &line_index=&os_irq_end_next
|
| 263 | &time=&os_time2
|
| 264 | gosub GetNextIndex &os_irq_end_cnt &os_irq_end_last &os_irq_end_next
|
| 265 | ENTRY &os_irq_end_next
|
| 266 | if &os_irq_end_next==-1
|
| 267 | (
|
| 268 | &os_time2=-1
|
| 269 | )
|
| 270 | else
|
| 271 | (
|
| 272 | &os_time2=v.value(g_os_ddr_irq_end_statistic->statistics[&os_irq_end_next].data2)
|
| 273 | )
|
| 274 | )
|
| 275 | else if &index==3
|
| 276 | (
|
| 277 | local &vec &func
|
| 278 | &time=v.value(g_os_ddr_softirq_start_statistic->statistics[&os_softirq_start_next].data2)
|
| 279 | &vec=v.value(g_os_ddr_softirq_start_statistic->statistics[&os_softirq_start_next].data1)
|
| 280 | &func=v.value(softirq_vec[&vec].action)
|
| 281 | &str="SIRQS: "+symbol.function(P:&func)+" S"
|
| 282 | &line_index=&os_softirq_start_next
|
| 283 | &time=&os_time3
|
| 284 | gosub GetNextIndex &os_softirq_start_cnt &os_softirq_start_last &os_softirq_start_next
|
| 285 | ENTRY &os_softirq_start_next
|
| 286 | if &os_softirq_start_next==-1
|
| 287 | (
|
| 288 | &os_time3=-1
|
| 289 | )
|
| 290 | else
|
| 291 | (
|
| 292 | &os_time3=v.value(g_os_ddr_softirq_start_statistic->statistics[&os_softirq_start_next].data2)
|
| 293 | )
|
| 294 | )
|
| 295 | else if &index==4
|
| 296 | (
|
| 297 | local &vec &func
|
| 298 | &time=v.value(g_os_ddr_softirq_end_statistic->statistics[&os_softirq_end_next].data2)
|
| 299 | &vec=v.value(g_os_ddr_softirq_end_statistic->statistics[&os_softirq_end_next].data1)
|
| 300 | &func=v.value(softirq_vec[&vec].action)
|
| 301 | &str="SIRQE: "+symbol.function(P:&func)+" E"
|
| 302 | &line_index=&os_softirq_end_next
|
| 303 | &time=&os_time4
|
| 304 | gosub GetNextIndex &os_softirq_end_cnt &os_softirq_end_last &os_softirq_end_next
|
| 305 | ENTRY &os_softirq_end_next
|
| 306 | if &os_softirq_end_next==-1
|
| 307 | (
|
| 308 | &os_time4=-1
|
| 309 | )
|
| 310 | else
|
| 311 | (
|
| 312 | &os_time4=v.value(g_os_ddr_softirq_end_statistic->statistics[&os_softirq_end_next].data2)
|
| 313 | )
|
| 314 | )
|
| 315 | else if &index==5
|
| 316 | (
|
| 317 | local &func
|
| 318 | &time=v.value(g_os_ddr_timer_start_statistic->statistics[&os_timer_start_next].data2)
|
| 319 | &func=v.value(g_os_ddr_timer_start_statistic->statistics[&os_timer_start_next].data1)
|
| 320 | &str="TIMERS: "+symbol.function(P:&func)+" S"
|
| 321 | &line_index=&os_timer_start_next
|
| 322 | &time=&os_time5
|
| 323 | gosub GetNextIndex &os_timer_start_cnt &os_timer_start_last &os_timer_start_next
|
| 324 | ENTRY &os_timer_start_next
|
| 325 | if &os_timer_start_next==-1
|
| 326 | (
|
| 327 | &os_time5=-1
|
| 328 | )
|
| 329 | else
|
| 330 | (
|
| 331 | &os_time5=v.value(g_os_ddr_timer_start_statistic->statistics[&os_timer_start_next].data2)
|
| 332 | )
|
| 333 | )
|
| 334 | else if &index==6
|
| 335 | (
|
| 336 | local &func
|
| 337 | &time=v.value(g_os_ddr_timer_end_statistic->statistics[&os_timer_end_next].data2)
|
| 338 | &func=v.value(g_os_ddr_timer_end_statistic->statistics[&os_timer_end_next].data1)
|
| 339 | &str="TIMERE: "+symbol.function(P:&func)+" E"
|
| 340 | &line_index=&os_timer_end_next
|
| 341 | &time=&os_time6
|
| 342 | gosub GetNextIndex &os_timer_end_cnt &os_timer_end_last &os_timer_end_next
|
| 343 | ENTRY &os_timer_end_next
|
| 344 | if &os_timer_end_next==-1
|
| 345 | (
|
| 346 | &os_time6=-1
|
| 347 | )
|
| 348 | else
|
| 349 | (
|
| 350 | &os_time6=v.value(g_os_ddr_timer_end_statistic->statistics[&os_timer_end_next].data2)
|
| 351 | )
|
| 352 | )
|
| 353 | else
|
| 354 | (
|
| 355 | print "Unknown Type"
|
| 356 | )
|
| 357 |
|
| 358 | gosub GetMinTime &os_time_cnt
|
| 359 | ENTRY &os_next_time
|
| 360 |
|
| 361 | print format.string("&str",32,' ')+" "+format.DecimalU(8,&line_index)+" "+format.DecimalU(1,&time)+" "+format.DecimalU(1,&os_next_time-&time)
|
| 362 |
|
| 363 | RETURN
|
| 364 |
|
| 365 | ; ---------------------------------------------------------
|
| 366 | GetNextIndex:
|
| 367 | ENTRY &cnt &last_index &cur_index
|
| 368 | local &index
|
| 369 |
|
| 370 | if !((&cur_index>=0.)&&(&cur_index<&cnt))
|
| 371 | (
|
| 372 | RETURN -1
|
| 373 | )
|
| 374 |
|
| 375 | &index=&cur_index+1
|
| 376 | if &index>=&cnt
|
| 377 | (
|
| 378 | &index=0
|
| 379 | )
|
| 380 | if &index==&last_index
|
| 381 | (
|
| 382 | &index=-1
|
| 383 | )
|
| 384 | RETURN &index
|
| 385 |
|
| 386 | ; ---------------------------------------------------------
|
| 387 | GetMinTimeIndex:
|
| 388 | ENTRY &cnt
|
| 389 | local &i &min_index &min_val
|
| 390 | local &value &index
|
| 391 |
|
| 392 | &i=0.
|
| 393 | &min_index=0.
|
| 394 | &min_val=0xFFFFFFFF
|
| 395 |
|
| 396 | while &i<&cnt
|
| 397 | (
|
| 398 | &index=string.cut("&i",-1)
|
| 399 | &&value=&os_time&index
|
| 400 | if (&value!=-1)&&(&min_val>=&value)
|
| 401 | (
|
| 402 | &min_val=&value
|
| 403 | &min_index=&i
|
| 404 | )
|
| 405 | &i=&i+1
|
| 406 | )
|
| 407 |
|
| 408 | RETURN &min_index
|
| 409 |
|
| 410 | ; ---------------------------------------------------------
|
| 411 | GetMinTime:
|
| 412 | ENTRY &cnt
|
| 413 | local &i &min_index &min_val
|
| 414 | local &value &index
|
| 415 |
|
| 416 | &i=0.
|
| 417 | &min_index=0.
|
| 418 | &min_val=0xFFFFFFFF
|
| 419 |
|
| 420 | while &i<&cnt
|
| 421 | (
|
| 422 | &index=string.cut("&i",-1)
|
| 423 | &&value=&os_time&index
|
| 424 | if (&value!=-1)&&(&min_val>=&value)
|
| 425 | (
|
| 426 | &min_val=&value
|
| 427 | &min_index=&i
|
| 428 | )
|
| 429 | &i=&i+1
|
| 430 | )
|
| 431 |
|
| 432 | RETURN &min_val
|
| 433 |
|
| 434 | ; ---------------------------------------------------------
|
| 435 | TosPrintNextLine:
|
| 436 | local &time &str &line_index
|
| 437 |
|
| 438 |
|
| 439 | gosub GetMinTimeIndex &os_time_cnt
|
| 440 | ENTRY &index
|
| 441 |
|
| 442 | if &index==0
|
| 443 | (
|
| 444 | local &task &addr
|
| 445 | &task=v.value(g_os_ddr_swapin_statistic->statistics[&os_swap_next].data1)
|
| 446 | &addr=v.value(&((Cyg_Thread*)&task)->thread_name)
|
| 447 | &str="THREAD: "+data.string(D:&addr)
|
| 448 | &line_index=&os_swap_next
|
| 449 | &time=&os_time0
|
| 450 | gosub GetNextIndex &os_swap_cnt &os_swap_last &os_swap_next
|
| 451 | ENTRY &os_swap_next
|
| 452 | if &os_swap_next==-1
|
| 453 | (
|
| 454 | &os_time0=-1
|
| 455 | )
|
| 456 | else
|
| 457 | (
|
| 458 | &os_time0=v.value(g_os_ddr_swapin_statistic->statistics[&os_swap_next].data2)
|
| 459 | )
|
| 460 | )
|
| 461 | else if &index==1
|
| 462 | (
|
| 463 | local &irq &addr
|
| 464 | &irq=v.value(g_os_ddr_irq_start_statistic->statistics[&os_irq_start_next].data1)
|
| 465 | &str="IRQSTA: "+format.DecimalU(1,&irq)+" S"
|
| 466 | &line_index=&os_irq_start_next
|
| 467 | &time=&os_time1
|
| 468 | gosub GetNextIndex &os_irq_start_cnt &os_irq_start_last &os_irq_start_next
|
| 469 | ENTRY &os_irq_start_next
|
| 470 | if &os_irq_start_next==-1
|
| 471 | (
|
| 472 | &os_time1=-1
|
| 473 | )
|
| 474 | else
|
| 475 | (
|
| 476 | &os_time1=v.value(g_os_ddr_irq_start_statistic->statistics[&os_irq_start_next].data2)
|
| 477 | )
|
| 478 | )
|
| 479 | else if &index==2
|
| 480 | (
|
| 481 | local &irq &addr
|
| 482 | &irq=v.value(g_os_ddr_irq_end_statistic->statistics[&os_irq_end_next].data1)
|
| 483 | &str="IRQEND: "+format.DecimalU(1,&irq)+" E"
|
| 484 | &line_index=&os_irq_end_next
|
| 485 | &time=&os_time2
|
| 486 | gosub GetNextIndex &os_irq_end_cnt &os_irq_end_last &os_irq_end_next
|
| 487 | ENTRY &os_irq_end_next
|
| 488 | if &os_irq_end_next==-1
|
| 489 | (
|
| 490 | &os_time2=-1
|
| 491 | )
|
| 492 | else
|
| 493 | (
|
| 494 | &os_time2=v.value(g_os_ddr_irq_end_statistic->statistics[&os_irq_end_next].data2)
|
| 495 | )
|
| 496 | )
|
| 497 | else if &index==3
|
| 498 | (
|
| 499 | local &dsr &addr
|
| 500 | &dsr=v.value(g_os_ddr_dsr_start_statistic->statistics[&os_dsr_start_next].data1)
|
| 501 | &str="DSRSTA: "+format.DecimalU(1,&dsr)+" S"
|
| 502 | &line_index=&os_dsr_start_next
|
| 503 | &time=&os_time3
|
| 504 | gosub GetNextIndex &os_dsr_start_cnt &os_dsr_start_last &os_dsr_start_next
|
| 505 | ENTRY &os_dsr_start_next
|
| 506 | if &os_dsr_start_next==-1
|
| 507 | (
|
| 508 | &os_time3=-1
|
| 509 | )
|
| 510 | else
|
| 511 | (
|
| 512 | &os_time3=v.value(g_os_ddr_dsr_start_statistic->statistics[&os_dsr_start_next].data2)
|
| 513 | )
|
| 514 | )
|
| 515 | else if &index==4
|
| 516 | (
|
| 517 | local &dsr &addr
|
| 518 | &dsr=v.value(g_os_ddr_dsr_end_statistic->statistics[&os_dsr_end_next].data1)
|
| 519 | &str="DSREND: "+format.DecimalU(1,&dsr)+" E"
|
| 520 | &line_index=&os_dsr_end_next
|
| 521 | &time=&os_time4
|
| 522 | gosub GetNextIndex &os_dsr_end_cnt &os_dsr_end_last &os_dsr_end_next
|
| 523 | ENTRY &os_dsr_end_next
|
| 524 | if &os_dsr_end_next==-1
|
| 525 | (
|
| 526 | &os_time4=-1
|
| 527 | )
|
| 528 | else
|
| 529 | (
|
| 530 | &os_time4=v.value(g_os_ddr_dsr_end_statistic->statistics[&os_dsr_end_next].data2)
|
| 531 | )
|
| 532 | )
|
| 533 | else
|
| 534 | (
|
| 535 | print "Unknown Type"
|
| 536 | )
|
| 537 |
|
| 538 | gosub GetMinTime &os_time_cnt
|
| 539 | ENTRY &os_next_time
|
| 540 |
|
| 541 | print format.string("&str",32,' ')+" "+format.DecimalU(8,&line_index)+" "+format.DecimalU(1,&time)+" "+format.DecimalU(1,&os_next_time-&time)
|
| 542 |
|
| 543 | RETURN
|
| 544 |
|
| 545 | ; ---------------------------------------------------------
|
| 546 | TosTrace:
|
| 547 | local &result
|
| 548 |
|
| 549 | if v.value(g_os_ddr_swapin_statistic)==0
|
| 550 | (
|
| 551 | RETURN
|
| 552 | )
|
| 553 |
|
| 554 | &os_swap_last=v.value(g_os_ddr_swapin_statistic->index)
|
| 555 | &os_swap_cnt=v.value(sizeof(g_os_ddr_swapin_statistic->statistics)/sizeof(g_os_ddr_swapin_statistic->statistics[0]))
|
| 556 | &os_swap_next=&os_swap_last
|
| 557 |
|
| 558 | if &os_irq_enable==1
|
| 559 | (
|
| 560 | &os_irq_start_last=v.value(g_os_ddr_irq_start_statistic->index)
|
| 561 | &os_irq_start_cnt=v.value(sizeof(g_os_ddr_irq_start_statistic->statistics)/sizeof(g_os_ddr_irq_start_statistic->statistics[0]))
|
| 562 | &os_irq_start_next=&os_irq_start_last
|
| 563 | &os_irq_end_last=v.value(g_os_ddr_irq_end_statistic->index)
|
| 564 | &os_irq_end_cnt=v.value(sizeof(g_os_ddr_irq_end_statistic->statistics)/sizeof(g_os_ddr_irq_end_statistic->statistics[0]))
|
| 565 | &os_irq_end_next=&os_irq_end_last
|
| 566 | )
|
| 567 | else
|
| 568 | (
|
| 569 | &os_irq_start_next=-1
|
| 570 | &os_irq_end_next=-1
|
| 571 | )
|
| 572 |
|
| 573 | if &os_dsr_enable==1
|
| 574 | (
|
| 575 | &os_dsr_start_last=v.value(g_os_ddr_dsr_start_statistic->index)
|
| 576 | &os_dsr_start_cnt=v.value(sizeof(g_os_ddr_dsr_start_statistic->statistics)/sizeof(g_os_ddr_dsr_start_statistic->statistics[0]))
|
| 577 | &os_dsr_start_next=&os_dsr_start_last
|
| 578 | &os_dsr_end_last=v.value(g_os_ddr_dsr_end_statistic->index)
|
| 579 | &os_dsr_end_cnt=v.value(sizeof(g_os_ddr_dsr_end_statistic->statistics)/sizeof(g_os_ddr_dsr_end_statistic->statistics[0]))
|
| 580 | &os_dsr_end_next=&os_dsr_end_last
|
| 581 | )
|
| 582 | else
|
| 583 | (
|
| 584 | &os_dsr_start_next=-1
|
| 585 | &os_dsr_end_next=-1
|
| 586 | )
|
| 587 |
|
| 588 | if &os_swap_next==-1
|
| 589 | (
|
| 590 | &os_time0=-1
|
| 591 | )
|
| 592 | else
|
| 593 | (
|
| 594 | &os_time0=v.value(g_os_ddr_swapin_statistic->statistics[&os_swap_next].data2)
|
| 595 | )
|
| 596 | if &os_irq_start_next==-1
|
| 597 | (
|
| 598 | &os_time1=-1
|
| 599 | )
|
| 600 | else
|
| 601 | (
|
| 602 | &os_time1=v.value(g_os_ddr_irq_start_statistic->statistics[&os_irq_start_next].data2)
|
| 603 | )
|
| 604 | if &os_irq_end_next==-1
|
| 605 | (
|
| 606 | &os_time2=-1
|
| 607 | )
|
| 608 | else
|
| 609 | (
|
| 610 | &os_time2=v.value(g_os_ddr_irq_end_statistic->statistics[&os_irq_end_next].data2)
|
| 611 | )
|
| 612 |
|
| 613 | if &os_dsr_start_next==-1
|
| 614 | (
|
| 615 | &os_time3=-1
|
| 616 | )
|
| 617 | else
|
| 618 | (
|
| 619 | &os_time3=v.value(g_os_ddr_dsr_start_statistic->statistics[&os_dsr_start_next].data2)
|
| 620 | )
|
| 621 | if &os_dsr_end_next==-1
|
| 622 | (
|
| 623 | &os_time4=-1
|
| 624 | )
|
| 625 | else
|
| 626 | (
|
| 627 | &os_time4=v.value(g_os_ddr_dsr_end_statistic->statistics[&os_dsr_end_next].data2)
|
| 628 | )
|
| 629 |
|
| 630 | &os_time_cnt=5.
|
| 631 | &os_next_time=0.
|
| 632 |
|
| 633 | print format.string("Name",32,' ')+" "+"Index"+" "+"Time"+" "+"Exce"
|
| 634 |
|
| 635 | &result=0
|
| 636 | while &result==0
|
| 637 | (
|
| 638 | gosub TosPrintNextLine
|
| 639 | if ((&os_swap_next==-1)&&(&os_irq_start_next==-1)&&(&os_irq_end_next==-1)&&(&os_dsr_start_next==-1)&&(&os_dsr_end_next==-1))
|
| 640 | (
|
| 641 | print "END"
|
| 642 | &result=-1
|
| 643 | )
|
| 644 | )
|
| 645 |
|
| 646 | RETURN
|