Branch Coverage

lib/Sys/CpuAffinity.xs
Criterion Covered Total %
branch 34 56 60.7


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) {
113 0 50 if (debug_flag) fprintf(stderr,"getaffinity2a ncpus=%d\n", ncpus);
118 0 50 if (debug_flag) fprintf(stderr,"getaffinity2b ncpus=%d\n", ncpus);
120 0 50 if (debug_flag) fprintf(stderr,"getaffinity2c ncpus=%d\n", ncpus);
122 0 50 if(debug_flag) fprintf(stderr,"getaffinity2d ncpus=%d\n", ncpus);
124 6 44 if (z) {
125 0 6 if(debug_flag) fprintf(stderr,"getaffinity3 z=%d err=%d\n", z, errno);
129 0 44 if(debug_flag) fprintf(stderr,"getaffinity4\n");
133 704 44 for (i = 0, r = 0; i < ncpus; i++) {
134 0 704 if(debug_flag) fprintf(stderr,"getaffinity5 i=%d r=%d\n", i, r);
135 704 0 if (CPU_ISSET(i, &_set2)) {
264 440 if (CPU_ISSET(i, &_set2)) {
440 264 if (CPU_ISSET(i, &_set2)) {
138 0 440 if(debug_flag) fprintf(stderr,"getaffinity6 add %d to mask\n", i);
139 0 264 } else if(debug_flag) {
143 0 44 if(debug_flag) fprintf(stderr,"getaffinity7 r=%d\n",r);
162 148 16 for (i=0; i <= av_len(mask); i++) {
163 148 0 int c = SvIV(*av_fetch(mask,i,0));
164 0 148 if (debug_flag) fprintf(stderr,"sched_setaffinity%d = %d\n", i, c);
165 148 0 CPU_SET(c, &cpumask);
168 0 16 if (debug_flag) fprintf(stderr,"sched_setaffinity(%d,%ld,...) = %d\n", pid, (long unsigned int) sizeof(cpu_set_t), r);
169 4 12 if (r != 0) {
170 4 0 fprintf(stderr,"result: %d %d %s\n", r, errno,
177 4 0 : errno==EPERM ? "EPERM" /* the calling process does not have
184 4 0 : errno==ESRCH ? "ESRCH" /* the process whose ID is _pid_ could not
186 0 4 :"E_WTF");