vitalyvch / strace.ebpf

This repository contains a tool which traces syscalls in a fast way using eBPF linux kernel feature
https://github.com/vitalyvch/strace.ebpf
Other
16 stars 6 forks source link

Replace sysconf() with sched_getaffinity() #72

Open vitalyvch opened 7 years ago

vitalyvch commented 7 years ago

replace sysconf() with sched_getaffinity(). It allows to ignore non-actual CPUs.

example:

//...
cpu_set_t set;

sched_getaffinity(0, sizeof(cpu_set_t), &set)

long cpu_qty = CPU_COUNT(&set);
//...

Existing solution will have problems with off-line CPUs, and CPUs in PWR-OFF C-state.