mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-11 09:56:22 +00:00
tests/gem_persisten_relocs: Update like gem_reloc_vs_pug
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
5dc424f70d
commit
1978aecf1d
@ -284,10 +284,9 @@ static void do_test(int fd, bool faulting_reloc)
|
|||||||
static void do_forked_test(int fd, unsigned flags)
|
static void do_forked_test(int fd, unsigned flags)
|
||||||
{
|
{
|
||||||
int num_threads = sysconf(_SC_NPROCESSORS_ONLN);
|
int num_threads = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
pid_t pid = -1;
|
struct igt_helper_process thrasher = {};
|
||||||
|
|
||||||
if (flags & (THRASH | THRASH_INACTIVE)) {
|
if (flags & (THRASH | THRASH_INACTIVE)) {
|
||||||
sighandler_t oldsig;
|
|
||||||
char fname[FILENAME_MAX];
|
char fname[FILENAME_MAX];
|
||||||
int drop_caches_fd;
|
int drop_caches_fd;
|
||||||
const char *data = THRASH_INACTIVE ? "0xf" : "0x7";
|
const char *data = THRASH_INACTIVE ? "0xf" : "0x7";
|
||||||
@ -299,10 +298,7 @@ static void do_forked_test(int fd, unsigned flags)
|
|||||||
drop_caches_fd = open(fname, O_WRONLY);
|
drop_caches_fd = open(fname, O_WRONLY);
|
||||||
igt_require(drop_caches_fd >= 0);
|
igt_require(drop_caches_fd >= 0);
|
||||||
|
|
||||||
oldsig = signal(SIGQUIT, SIG_DFL);
|
igt_fork_helper(&thrasher) {
|
||||||
pid = fork();
|
|
||||||
signal(SIGQUIT, oldsig);
|
|
||||||
if (pid == 0) {
|
|
||||||
while (1) {
|
while (1) {
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
igt_assert(write(drop_caches_fd, data, strlen(data) + 1) == strlen(data) + 1);
|
igt_assert(write(drop_caches_fd, data, strlen(data) + 1) == strlen(data) + 1);
|
||||||
@ -325,13 +321,8 @@ static void do_forked_test(int fd, unsigned flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
igt_waitchildren();
|
igt_waitchildren();
|
||||||
|
if (flags & (THRASH | THRASH_INACTIVE))
|
||||||
if (pid != -1) {
|
igt_stop_helper(&thrasher);
|
||||||
int exitcode;
|
|
||||||
|
|
||||||
kill(pid, SIGQUIT);
|
|
||||||
wait(&exitcode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
@ -370,7 +361,7 @@ int main(int argc, char **argv)
|
|||||||
flags & INTERRUPT ? "-interruptible" : "",
|
flags & INTERRUPT ? "-interruptible" : "",
|
||||||
flags & FAULTING ? "-faulting-reloc" : "",
|
flags & FAULTING ? "-faulting-reloc" : "",
|
||||||
flags & THRASH ? "-thrashing" : "",
|
flags & THRASH ? "-thrashing" : "",
|
||||||
flags & THRASH ? "-thrash-inactive" : "")
|
flags & THRASH_INACTIVE ? "-thrash-inactive" : "")
|
||||||
do_forked_test(fd, flags);
|
do_forked_test(fd, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user