Changeset 88dea9d in mainline for kernel/generic/src/proc/task.c
- Timestamp:
- 2010-04-17T16:28:49Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30a5470
- Parents:
- 5ba201d (diff), 95319bd (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
r5ba201d r88dea9d 186 186 ta->context = CONTEXT; 187 187 ta->capabilities = 0; 188 ta->cycles = 0; 189 188 ta->ucycles = 0; 189 ta->kcycles = 0; 190 191 ta->ipc_info.call_sent = 0; 192 ta->ipc_info.call_recieved = 0; 193 ta->ipc_info.answer_sent = 0; 194 ta->ipc_info.answer_recieved = 0; 195 ta->ipc_info.irq_notif_recieved = 0; 196 ta->ipc_info.forwarded = 0; 197 190 198 #ifdef CONFIG_UDEBUG 191 199 /* Init debugging stuff */ … … 324 332 * already disabled. 325 333 * 326 * @param t Pointer to task.327 * 328 * @ return Number of cycles used by the task and all its threads329 * so far.330 * 331 */ 332 uint64_t task_get_accounting(task_t *t) 333 { 334 /* Accumulated value of task */335 uint64_t ret = t->cycles;334 * @param t Pointer to thread. 335 * @param ucycles Out pointer to sum of all user cycles. 336 * @param kcycles Out pointer to sum of all kernel cycles. 337 * 338 */ 339 void task_get_accounting(task_t *t, uint64_t *ucycles, uint64_t *kcycles) 340 { 341 /* Accumulated values of task */ 342 uint64_t uret = t->ucycles; 343 uint64_t kret = t->kcycles; 336 344 337 345 /* Current values of threads */ … … 345 353 if (thr == THREAD) { 346 354 /* Update accounting of current thread */ 347 thread_update_accounting( );355 thread_update_accounting(false); 348 356 } 349 ret += thr->cycles; 357 uret += thr->ucycles; 358 kret += thr->kcycles; 350 359 } 351 360 spinlock_unlock(&thr->lock); 352 361 } 353 362 354 return ret; 363 *ucycles = uret; 364 *kcycles = kret; 355 365 } 356 366 … … 419 429 spinlock_lock(&t->lock); 420 430 421 uint64_t cycles; 422 char suffix; 423 order(task_get_accounting(t), &cycles, &suffix); 424 425 #ifdef __32_BITS__ 426 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64 427 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles, 428 suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls)); 431 uint64_t ucycles; 432 uint64_t kcycles; 433 char usuffix, ksuffix; 434 task_get_accounting(t, &ucycles, &kcycles); 435 order(ucycles, &ucycles, &usuffix); 436 order(kcycles, &kcycles, &ksuffix); 437 438 #ifdef __32_BITS__ 439 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64 "%c %9" 440 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, 441 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount), 442 atomic_get(&t->active_calls)); 429 443 #endif 430 444 431 445 #ifdef __64_BITS__ 432 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64 433 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, cycles, 434 suffix, atomic_get(&t->refcount), atomic_get(&t->active_calls)); 446 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64 "%c %9" 447 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, 448 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount), 449 atomic_get(&t->active_calls)); 435 450 #endif 436 451 … … 455 470 456 471 #ifdef __32_BITS__ 457 printf("taskid name ctx address as 458 " cyclesthreads calls callee\n");459 printf("------ ------------ --- ---------- ---------- 460 " ---------- ------- ------ ------>\n");472 printf("taskid name ctx address as " 473 " ucycles kcycles threads calls callee\n"); 474 printf("------ ------------ --- ---------- ----------" 475 " ---------- ---------- ------- ------ ------>\n"); 461 476 #endif 462 477 463 478 #ifdef __64_BITS__ 464 printf("taskid name ctx address as 465 " cyclesthreads calls callee\n");466 printf("------ ------------ --- ------------------ ------------------ 467 " ---------- ------- ------ ------>\n");479 printf("taskid name ctx address as " 480 " ucycles kcycles threads calls callee\n"); 481 printf("------ ------------ --- ------------------ ------------------" 482 " ---------- ---------- ---------- ------- ------ ------>\n"); 468 483 #endif 469 484
Note:
See TracChangeset
for help on using the changeset viewer.