Temporarily unable to get the current thread running on which CPU, pending investigation ...
int omask = 0;int Nmask = 0xf0;static void affinity () { int err; int syscallres = Syscall (__nr_sched_getaffinity, Gettid (), sizeof (Omask), &omask); if (syscallres) { err = errno; LOGE ("Error in the Syscall getaffinity:omask=%d=0x%x err=%d=0x%x", Omask, Omask, err, err); } LOGE ("Before-get affinity success, Tid =%d, mask =", Gettid (), omask); Syscallres = Syscall (__nr_sched_setaffinity, Gettid (), sizeof (Nmask), &nmask); if (syscallres) { err = errno; LOGE ("Error in the Syscall setaffinity:nmask=%d=0x%x err=%d=0x%x", Nmask, Nmask, err, err); } Syscallres = Syscall (__nr_sched_getaffinity, Gettid (), sizeof (Omask), &omask); if (syscallres) { err = errno; LOGE ("Error in the Syscall getaffinity:omask=%d=0x%x err=%d=0x%x", Omask, Omask, err, err); } LOGE ("After-get affinity success, Tid =%d, mask =", Gettid (), omask);}
Android CPU Affinity