From d930b6493d93a6e6c2ca9a5ed468d360a9183586 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 9 Feb 2017 10:42:01 +0100 Subject: lib: Add basic support for valgrind annotations. SIGRTMAX appears to be used by valgrind now for its internal tracking, so avoid it in the helpers. Also add some valgrind annotations in gem_mmap, to make sure that its accesses are tracked correctly. I've also added gem_munmap, but there are a lot of places that don't use it yet in tests/. Signed-off-by: Maarten Lankhorst --- lib/igt_dummyload.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/igt_dummyload.c') diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c index 7ceb370b..019c1fbc 100644 --- a/lib/igt_dummyload.c +++ b/lib/igt_dummyload.c @@ -220,7 +220,8 @@ void igt_spin_batch_set_timeout(igt_spin_t *spin, int64_t ns) igt_assert(!spin->timer); - if (spin_signo == SIGRTMAX) + /* SIGRTMAX is used by valgrind, SIGRTMAX - 1 by igt_fork_hang_detector */ + if (spin_signo >= SIGRTMAX - 2) spin_signo = SIGRTMIN; spin->signo = ++spin_signo; @@ -283,7 +284,7 @@ void igt_spin_batch_free(int fd, igt_spin_t *spin) timer_delete(spin->timer); igt_spin_batch_end(spin); - munmap(spin->batch, BATCH_SIZE); + gem_munmap(spin->batch, BATCH_SIZE); gem_close(fd, spin->handle); free(spin); -- cgit v1.2.3