Ignore:
Timestamp:
Oct 10, 2019, 1:42:04 PM (5 years ago)
Author:
alain
Message:
  • Fix several bugs.
  • Introduce the "stat" command in KSH.

This almos-mkh version sucessfully executed the FFT application
(65536 complex points) on the TSAR architecture from 1 to 64 cores.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/thread.c

    r640 r641  
    183183    dqdt_increment_threads();
    184184
     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
    185197#if DEBUG_THREAD_INIT
    186198cycle = (uint32_t)hal_get_cycles();
     
    890902    core_t        * core    = thread->core;
    891903
    892 
    893 #if DEBUG_THREAD_DESTROY || CONFIG_INSTRUMENTATION_PGFAULTS
     904#if DEBUG_THREAD_DESTROY
    894905uint32_t   cycle;
    895906thread_t * this  = CURRENT_THREAD;
     
    908919#if CONFIG_INSTRUMENTATION_PGFAULTS
    909920process->vmm.false_pgfault_nr    += thread->info.false_pgfault_nr;
     921process->vmm.false_pgfault_cost  += thread->info.false_pgfault_cost;
    910922process->vmm.local_pgfault_nr    += thread->info.local_pgfault_nr;
     923process->vmm.local_pgfault_cost  += thread->info.local_pgfault_cost;
    911924process->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;
    914925process->vmm.global_pgfault_cost += thread->info.global_pgfault_cost;
    915926#endif
     
    917928#if (CONFIG_INSTRUMENTATION_PGFAULTS & 1)
    918929uint32_t false_nr    = thread->info.false_pgfault_nr;
     930uint32_t false_cost  = thread->info.false_pgfault_cost;
     931uint32_t false_max   = thread->info.false_pgfault_max;
     932uint32_t false_one   = false_nr  ? (false_cost  / false_nr ) : 0;
     933
    919934uint32_t local_nr    = thread->info.local_pgfault_nr;
     935uint32_t local_cost  = thread->info.local_pgfault_cost;
     936uint32_t local_max   = thread->info.local_pgfault_max;
     937uint32_t local_one   = local_nr  ? (local_cost  / local_nr ) : 0;
     938
    920939uint32_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;
    923940uint32_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 );
     941uint32_t global_max  = thread->info.global_pgfault_max;
     942uint32_t global_one  = global_nr ? (global_cost / global_nr) : 0;
     943
     944printk("\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 );
    932952#endif
    933953
Note: See TracChangeset for help on using the changeset viewer.