Changeset 641 for trunk/kernel/kern/thread.c
- Timestamp:
- Oct 10, 2019, 1:42:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/thread.c
r640 r641 183 183 dqdt_increment_threads(); 184 184 185 #if CONFIG_INSTRUMENTATION_PGFAULTS 186 thread->info.false_pgfault_nr = 0; 187 thread->info.false_pgfault_cost = 0; 188 thread->info.false_pgfault_max = 0; 189 thread->info.local_pgfault_nr = 0; 190 thread->info.local_pgfault_cost = 0; 191 thread->info.local_pgfault_max = 0; 192 thread->info.global_pgfault_nr = 0; 193 thread->info.global_pgfault_cost = 0; 194 thread->info.global_pgfault_max = 0; 195 #endif 196 185 197 #if DEBUG_THREAD_INIT 186 198 cycle = (uint32_t)hal_get_cycles(); … … 890 902 core_t * core = thread->core; 891 903 892 893 #if DEBUG_THREAD_DESTROY || CONFIG_INSTRUMENTATION_PGFAULTS 904 #if DEBUG_THREAD_DESTROY 894 905 uint32_t cycle; 895 906 thread_t * this = CURRENT_THREAD; … … 908 919 #if CONFIG_INSTRUMENTATION_PGFAULTS 909 920 process->vmm.false_pgfault_nr += thread->info.false_pgfault_nr; 921 process->vmm.false_pgfault_cost += thread->info.false_pgfault_cost; 910 922 process->vmm.local_pgfault_nr += thread->info.local_pgfault_nr; 923 process->vmm.local_pgfault_cost += thread->info.local_pgfault_cost; 911 924 process->vmm.global_pgfault_nr += thread->info.global_pgfault_nr; 912 process->vmm.false_pgfault_cost += thread->info.false_pgfault_cost;913 process->vmm.local_pgfault_cost += thread->info.local_pgfault_cost;914 925 process->vmm.global_pgfault_cost += thread->info.global_pgfault_cost; 915 926 #endif … … 917 928 #if (CONFIG_INSTRUMENTATION_PGFAULTS & 1) 918 929 uint32_t false_nr = thread->info.false_pgfault_nr; 930 uint32_t false_cost = thread->info.false_pgfault_cost; 931 uint32_t false_max = thread->info.false_pgfault_max; 932 uint32_t false_one = false_nr ? (false_cost / false_nr ) : 0; 933 919 934 uint32_t local_nr = thread->info.local_pgfault_nr; 935 uint32_t local_cost = thread->info.local_pgfault_cost; 936 uint32_t local_max = thread->info.local_pgfault_max; 937 uint32_t local_one = local_nr ? (local_cost / local_nr ) : 0; 938 920 939 uint32_t global_nr = thread->info.global_pgfault_nr; 921 uint32_t false_cost = thread->info.false_pgfault_cost;922 uint32_t local_cost = thread->info.local_pgfault_cost;923 940 uint32_t global_cost = thread->info.global_pgfault_cost; 924 printk("***** thread[%x,%x] page-faults\n" 925 " - false %d ( %d cycles )\n" 926 " - local %d ( %d cycles )\n" 927 " - global %d ( %d cycles )\n", 928 this->process->pid, this->trdid, 929 false_nr , false_cost / false_nr, 930 local_nr , local_cost / local_nr, 931 global_nr, global_cost / global_nr ); 941 uint32_t global_max = thread->info.global_pgfault_max; 942 uint32_t global_one = global_nr ? (global_cost / global_nr) : 0; 943 944 printk("\n***** thread[%x,%x] page-faults\n" 945 " - false : %d events / cost %d cycles / max %d cycles\n" 946 " - local : %d events / cost %d cycles / max %d cycles\n" 947 " - global : %d events / cost %d cycles / max %d cycles\n", 948 thread->process->pid, thread->trdid, 949 false_nr , false_one , false_max, 950 local_nr , local_one , local_max, 951 global_nr, global_one, global_max ); 932 952 #endif 933 953
Note: See TracChangeset
for help on using the changeset viewer.