Changeset 07640dfd in mainline
- Timestamp:
- 2010-03-29T16:21:29Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ea55bc4
- Parents:
- a2a00e8
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ps/taskinfo.h
ra2a00e8 r07640dfd 50 50 int thread_count; 51 51 uint64_t cycles; 52 uint64_t ucycles; 53 uint64_t kcycles; 52 54 } task_info_t; 53 55 … … 75 77 int priority; 76 78 uint64_t cycles; 79 uint64_t ucycles; 80 uint64_t kcycles; 77 81 unsigned int cpu; 78 82 } thread_info_t; -
kernel/generic/src/interrupt/interrupt.c
ra2a00e8 r07640dfd 109 109 if (THREAD && THREAD->interrupted && istate_from_uspace(istate)) 110 110 thread_exit(); 111 112 if (THREAD) 113 thread_update_accounting(false); 111 114 } 112 115 -
kernel/generic/src/proc/task.c
ra2a00e8 r07640dfd 427 427 428 428 #ifdef __32_BITS__ 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,429 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %10p %10p %9" PRIu64 "%c %9" 430 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, 431 431 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount), 432 432 atomic_get(&t->active_calls)); … … 434 434 435 435 #ifdef __64_BITS__ 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,436 printf("%-6" PRIu64 " %-12s %-3" PRIu32 " %18p %18p %9" PRIu64 "%c %9" 437 PRIu64 "%c %7ld %6ld", t->taskid, t->name, t->context, t, t->as, 438 438 ucycles, usuffix, kcycles, ksuffix, atomic_get(&t->refcount), 439 439 atomic_get(&t->active_calls)); … … 461 461 #ifdef __32_BITS__ 462 462 printf("taskid name ctx address as " 463 " cyclesucycles kcycles threads calls callee\n");463 " ucycles kcycles threads calls callee\n"); 464 464 printf("------ ------------ --- ---------- ----------" 465 " ---------- ---------- ------- --- ------------- ------>\n");465 " ---------- ---------- ------- ------ ------>\n"); 466 466 #endif 467 467 468 468 #ifdef __64_BITS__ 469 469 printf("taskid name ctx address as " 470 " cyclesucycles kcycles threads calls callee\n");470 " ucycles kcycles threads calls callee\n"); 471 471 printf("------ ------------ --- ------------------ ------------------" 472 " ---------- ---------- ---------- ------- --- ------------- ------>\n");472 " ---------- ---------- ---------- ------- ------ ------>\n"); 473 473 #endif 474 474 -
kernel/generic/src/proc/thread.c
ra2a00e8 r07640dfd 630 630 631 631 #ifdef __32_BITS__ 632 printf("%-6" PRIu64" %-10s %10p %-8s %10p %-3" PRIu32 " %10p %10p %9" PRIu64 "%c %9" PRIu64 "%c %9" PRIu64 "%c ", 633 t->tid, t->name, t, thread_states[t->state], t->task, 634 t->task->context, t->thread_code, t->kstack, cycles, suffix, ucycles, usuffix, kcycles, ksuffix); 632 printf("%-6" PRIu64" %-10s %10p %-8s %10p %-3" PRIu32 " %10p %10p %9" 633 PRIu64 "%c %9" PRIu64 "%c ", t->tid, t->name, t, 634 thread_states[t->state], t->task, t->task->context, t->thread_code, 635 t->kstack, ucycles, usuffix, kcycles, ksuffix); 635 636 #endif 636 637 637 638 #ifdef __64_BITS__ 638 printf("%-6" PRIu64" %-10s %18p %-8s %18p %-3" PRIu32 " %18p %18p %9" PRIu64 "%c %9" PRIu64 "%c %9" PRIu64 "%c ", 639 t->tid, t->name, t, thread_states[t->state], t->task, 640 t->task->context, t->thread_code, t->kstack, cycles, suffix, ucycles, usuffix, kcycles, ksuffix); 639 printf("%-6" PRIu64" %-10s %18p %-8s %18p %-3" PRIu32 " %18p %18p %9" 640 PRIu64 "%c %9" PRIu64 "%c ", t->tid, t->name, t, 641 thread_states[t->state], t->task, t->task->context, t->thread_code, 642 t->kstack, ucycles, usuffix, kcycles, ksuffix); 641 643 #endif 642 644 … … 672 674 #ifdef __32_BITS__ 673 675 printf("tid name address state task " 674 "ctx code stack cyclesucycles kcycles cpu "676 "ctx code stack ucycles kcycles cpu " 675 677 "waitqueue\n"); 676 678 printf("------ ---------- ---------- -------- ---------- " 677 "--- ---------- ---------- ---------- ---------- ---- ------ ----"679 "--- ---------- ---------- ---------- ---------- ---- " 678 680 "----------\n"); 679 681 #endif … … 681 683 #ifdef __64_BITS__ 682 684 printf("tid name address state task " 683 "ctx code stack cyclesucycles kcycles cpu "685 "ctx code stack ucycles kcycles cpu " 684 686 "waitqueue\n"); 685 687 printf("------ ---------- ------------------ -------- ------------------ " 686 "--- ------------------ ------------------ ---------- ---------- ---- ------ ----"688 "--- ------------------ ------------------ ---------- ---------- ---- " 687 689 "------------------\n"); 688 690 #endif -
kernel/generic/src/ps/ps.c
ra2a00e8 r07640dfd 136 136 uint64_t cycles = task_get_accounting(t, &ucycles, &kcycles); 137 137 copy_to_uspace(&uspace_info->cycles, &cycles, sizeof(cycles)); 138 copy_to_uspace(&uspace_info->ucycles, &ucycles, sizeof(cycles)); 139 copy_to_uspace(&uspace_info->kcycles, &kcycles, sizeof(cycles)); 138 140 139 141 size_t pages = get_pages_count(t->as); … … 171 173 result.priority = t->priority; 172 174 result.cycles = t->cycles; 175 result.ucycles = t->ucycles; 176 result.kcycles = t->kcycles; 173 177 174 178 if (t->cpu) -
kernel/generic/src/syscall/syscall.c
ra2a00e8 r07640dfd 62 62 unative_t rc; 63 63 64 /* Do userpace accounting */ 65 thread_update_accounting(true); 66 64 67 #ifdef CONFIG_UDEBUG 65 68 /* … … 96 99 } 97 100 #endif 101 102 /* Do kernel accounting */ 103 thread_update_accounting(false); 98 104 99 105 return rc; -
uspace/app/ps/ps.c
ra2a00e8 r07640dfd 70 70 } 71 71 72 printf(" ID Threads Pages [k]CyclesName\n");72 printf(" ID Threads Pages [k]uCycles [k]kCycles Cycle fault Name\n"); 73 73 74 74 int i; … … 76 76 task_info_t taskinfo; 77 77 get_task_info(tasks[i], &taskinfo); 78 printf("%8llu %8u %8u %12llu %s\n", tasks[i], taskinfo.thread_count, 79 taskinfo.pages, taskinfo.cycles / 1000, taskinfo.name); 78 printf("%8llu %8u %8u %12llu %12llu %12llu %s\n", tasks[i], 79 taskinfo.thread_count, taskinfo.pages, taskinfo.ucycles / 1000, 80 taskinfo.kcycles / 1000, (taskinfo.ucycles + taskinfo.kcycles) - 81 taskinfo.cycles, taskinfo.name); 80 82 } 81 83 } … … 99 101 100 102 int i; 101 printf(" ID State CPU Prio [k]Cycles\n");103 printf(" ID State CPU Prio [k]uCycles [k]kcycles Cycle fault\n"); 102 104 for (i = 0; i < result; ++i) { 103 printf("%6llu %-8s %4u %6d %12llu\n", threads[i].tid, thread_states[threads[i].state], 104 threads[i].cpu, threads[i].priority, threads[i].cycles / 1000); 105 printf("%6llu %-8s %4u %6d %12llu %12llu %12llu\n", threads[i].tid, 106 thread_states[threads[i].state], threads[i].cpu, 107 threads[i].priority, threads[i].ucycles / 1000, 108 threads[i].kcycles / 1000, 109 threads[i].ucycles + threads[i].kcycles - threads[i].cycles); 105 110 } 106 111 }
Note:
See TracChangeset
for help on using the changeset viewer.