Changeset a2a00e8 in mainline for kernel/generic/src/proc/task.c
- Timestamp:
- 2010-03-28T23:05:18Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 07640dfd
- Parents:
- 34bba0e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
r34bba0e ra2a00e8 185 185 ta->capabilities = 0; 186 186 ta->cycles = 0; 187 ta->ucycles = 0; 188 ta->kcycles = 0; 187 189 188 190 #ifdef CONFIG_UDEBUG … … 317 319 * 318 320 * @param t Pointer to thread. 319 * 320 * @return Number of cycles used by the task and all its threads 321 * so far. 322 */ 323 uint64_t task_get_accounting(task_t *t) 324 { 325 /* Accumulated value of task */ 321 * @param ucycles Out pointer to sum of all user cycles. 322 * @param kcycles Out pointer to sum of all kernel cycles. 323 */ 324 uint64_t task_get_accounting(task_t *t, uint64_t *ucycles, uint64_t *kcycles) 325 { 326 /* Accumulated values of task */ 326 327 uint64_t ret = t->cycles; 328 uint64_t uret = t->ucycles; 329 uint64_t kret = t->kcycles; 327 330 328 331 /* Current values of threads */ … … 336 339 if (thr == THREAD) { 337 340 /* Update accounting of current thread */ 338 thread_update_accounting( );341 thread_update_accounting(false); 339 342 } 343 uret += thr->ucycles; 344 kret += thr->kcycles; 340 345 ret += thr->cycles; 341 346 } … … 343 348 } 344 349 350 *ucycles = uret; 351 *kcycles = kret; 352 345 353 return ret; 346 354 } … … 410 418 411 419 uint64_t cycles; 412 char suffix; 413 order(task_get_accounting(t), &cycles, &suffix); 420 uint64_t ucycles; 421 uint64_t kcycles; 422 char suffix, usuffix, ksuffix; 423 cycles = task_get_accounting(t, &ucycles, &kcycles); 424 order(cycles, &cycles, &suffix); 425 order(ucycles, &ucycles, &usuffix); 426 order(kcycles, &kcycles, &ksuffix); 414 427 415 428 #ifdef __32_BITS__ 416 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64 417 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles, 418 suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls)); 429 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64 "%c %9" PRIu64 "%c %9" 430 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles, suffix, 431 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount), 432 atomic_get(&t->active_calls)); 419 433 #endif 420 434 421 435 #ifdef __64_BITS__ 422 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64 423 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles, 424 suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls)); 436 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64 "%c %9" PRIu64 "%c %9" 437 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles, suffix, 438 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount), 439 atomic_get(&t->active_calls)); 425 440 #endif 426 441 … … 445 460 446 461 #ifdef __32_BITS__ 447 printf("taskid name ctx address as 448 " cyclesthreads calls callee\n");449 printf("------ ------------ --- ---------- ---------- 450 " ---------- ------- ------ ------>\n");462 printf("taskid name ctx address as " 463 " cycles ucycles kcycles threads calls callee\n"); 464 printf("------ ------------ --- ---------- ----------" 465 " ---------- ---------- ---------- ------- ------ ------>\n"); 451 466 #endif 452 467 453 468 #ifdef __64_BITS__ 454 printf("taskid name ctx address as 455 " cyclesthreads calls callee\n");456 printf("------ ------------ --- ------------------ ------------------ 457 " ---------- ------- ------ ------>\n");469 printf("taskid name ctx address as " 470 " cycles ucycles kcycles threads calls callee\n"); 471 printf("------ ------------ --- ------------------ ------------------" 472 " ---------- ---------- ---------- ---------- ------- ------ ------>\n"); 458 473 #endif 459 474
Note:
See TracChangeset
for help on using the changeset viewer.