What library function can I call to get mapping of processes to cores or given a process id tell me what core it's running on, it ran last time, or scheduled to run. So something like this:
core 1: 14232,42323
core 2: 42213,63434,434
core 3: 34232,34314
core 4: 42325,6353,1434,4342
core 5: 43432,64535,14345,34233
core 6: 23242,53422,4231,34242
core 7: 78789
core 8: 23423,23124,5663
I sched_getcpu
returns the core number of calling process. If there was a function that given a process id, would return the core number that would be good too but I have not found one. sched_getaffinity
is not useful either; It just tells you given a process what cores it can run on which is not what I'm interested in.