line |
true |
false |
branch |
102
|
0 |
50 |
if(debug_flag) diag(); |
103
|
0 |
50 |
if(debug_flag) fprintf(stderr,"getaffinity0\n"); |
105
|
0 |
50 |
if(debug_flag) { |
117
|
0 |
50 |
if(debug_flag) fprintf(stderr,"getaffinity2 ncpus=%d\n", ncpus); |
118
|
6 |
44 |
if (z) { |
119
|
0 |
6 |
if(debug_flag) fprintf(stderr,"getaffinity3 z=%d err=%d\n", z, errno); |
126
|
0 |
44 |
if(debug_flag) fprintf(stderr,"getaffinity5\n"); |
130
|
2816 |
44 |
for (i = 0, r = 0; i < nn; i++) { |
131
|
0 |
2816 |
if(debug_flag) fprintf(stderr,"getaffinity6 i=%d r=%d\n", i, r); |
132
|
2816 |
0 |
if (CPU_ISSET(i, &_set2)) { |
|
2416 |
400 |
if (CPU_ISSET(i, &_set2)) { |
|
400 |
2416 |
if (CPU_ISSET(i, &_set2)) { |
135
|
0 |
400 |
if(debug_flag) fprintf(stderr,"getaffinity8 add %d to mask\n", i); |
138
|
0 |
44 |
if(debug_flag) fprintf(stderr,"getaffinitya r=%d\n",r); |
158
|
152 |
16 |
for (i=0; i <= av_len(mask); i++) { |
159
|
152 |
0 |
int c = SvIV(*av_fetch(mask,i,0)); |
160
|
0 |
152 |
if (debug_flag) fprintf(stderr,"sched_setaffinity%d = %d\n", i, c); |
161
|
152 |
0 |
CPU_SET(c, &cpumask); |
164
|
0 |
16 |
if (debug_flag) fprintf(stderr,"sched_setaffinity(%d,%d,...) = %d\n", pid, sizeof(cpu_set_t), r); |
165
|
4 |
12 |
if (r != 0) { |
166
|
4 |
0 |
fprintf(stderr,"result: %d %d %s\n", r, errno, |
173
|
4 |
0 |
: errno==EPERM ? "EPERM" /* the calling process does not have |
180
|
4 |
0 |
: errno==ESRCH ? "ESRCH" /* the process whose ID is _pid_ could not |
182
|
0 |
4 |
:"E_WTF"); |