Ignore:
Timestamp:
Jul 7, 2021, 6:24:22 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c86ee4c
Parents:
943bfad
Message:

Now tracking cpu migrations using push_stat.
Some minor fixes to the ready-queue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.cfa

    r943bfad r1f45c7d  
    394394        __builtin_prefetch( thrd_dst->context.SP );
    395395
     396        int curr = __kernel_getcpu();
     397        if(thrd_dst->last_cpu != curr) {
     398                int64_t l = thrd_dst->last_cpu;
     399                int64_t c = curr;
     400                int64_t v = (l << 32) | c;
     401                __push_stat( __tls_stats(), v, false, "Processor", this );
     402        }
     403
     404        thrd_dst->last_cpu = curr;
     405
    396406        __cfadbg_print_safe(runtime_core, "Kernel : core %p running thread %p (%s)\n", this, thrd_dst, thrd_dst->self_cor.name);
    397407
     
    470480                                #if !defined(__CFA_NO_STATISTICS__)
    471481                                        __tls_stats()->ready.threads.threads++;
    472                                         __push_stat( __tls_stats(), __tls_stats()->ready.threads.threads, false, "Processor", this );
    473482                                #endif
    474483                                // This is case 2, the racy case, someone tried to run this thread before it finished blocking
     
    488497        #if !defined(__CFA_NO_STATISTICS__)
    489498                __tls_stats()->ready.threads.threads--;
    490                 __push_stat( __tls_stats(), __tls_stats()->ready.threads.threads, false, "Processor", this );
    491499        #endif
    492500
     
    570578                                __tls_stats()->ready.threads.extunpark++;
    571579                        }
    572                         __push_stat( __tls_stats(), __tls_stats()->ready.threads.threads, false, "Processor", kernelTLS().this_processor );
    573580                }
    574581                else {
    575582                        __atomic_fetch_add(&cl->stats->ready.threads.threads, 1, __ATOMIC_RELAXED);
    576583                        __atomic_fetch_add(&cl->stats->ready.threads.extunpark, 1, __ATOMIC_RELAXED);
    577                         __push_stat( cl->stats, cl->stats->ready.threads.threads, true, "Cluster", cl );
    578584                }
    579585        #endif
Note: See TracChangeset for help on using the changeset viewer.