mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-11 09:56:22 +00:00
igt/gem_gtt_hog: Convert opencoded fork()/wait() over to igt_fork()
No reason not to use the common infrastructure here. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
a54faca987
commit
3309f54e8f
@ -150,7 +150,6 @@ static void run(data_t *data, int child)
|
|||||||
munmap(ptr, size);
|
munmap(ptr, size);
|
||||||
|
|
||||||
igt_assert(x == canary);
|
igt_assert(x == canary);
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
igt_simple_main
|
igt_simple_main
|
||||||
@ -158,7 +157,6 @@ igt_simple_main
|
|||||||
struct timeval start, end;
|
struct timeval start, end;
|
||||||
pid_t children[64];
|
pid_t children[64];
|
||||||
data_t data = {};
|
data_t data = {};
|
||||||
int n;
|
|
||||||
|
|
||||||
/* check for an intel gpu before goint nuts. */
|
/* check for an intel gpu before goint nuts. */
|
||||||
int fd = drm_open_any();
|
int fd = drm_open_any();
|
||||||
@ -171,22 +169,11 @@ igt_simple_main
|
|||||||
data.intel_gen = intel_gen(data.devid);
|
data.intel_gen = intel_gen(data.devid);
|
||||||
|
|
||||||
gettimeofday(&start, NULL);
|
gettimeofday(&start, NULL);
|
||||||
for (n = 0; n < ARRAY_SIZE(children); n++) {
|
igt_fork(child, ARRAY_SIZE(children))
|
||||||
switch ((children[n] = fork())) {
|
run(&data, child);
|
||||||
case -1: igt_assert(0);
|
igt_waitchildren();
|
||||||
case 0: run(&data, n); break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (n = 0; n < ARRAY_SIZE(children); n++) {
|
|
||||||
int status = -1;
|
|
||||||
while (waitpid(children[n], &status, 0) == -1 &&
|
|
||||||
errno == -EINTR)
|
|
||||||
;
|
|
||||||
igt_assert(status == 0);
|
|
||||||
}
|
|
||||||
gettimeofday(&end, NULL);
|
gettimeofday(&end, NULL);
|
||||||
|
|
||||||
igt_info("Time to execute %lu children: %7.3fms\n",
|
igt_info("Time to execute %lu children: %7.3fms\n",
|
||||||
ARRAY_SIZE(children), elapsed(&start, &end) / 1000);
|
ARRAY_SIZE(children), elapsed(&start, &end) / 1000);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user