Commit 3cdad2b0 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

lib/init: do not look for vDSO support on Valgrind



There is no vDSO support with Valgrind. Detect when running on top of
such virtual machine using the Valgrind API, picking the fallback
clock_gettime() implementation if so.

This is not a problem since the EVL core does intercept and honor this
syscall directly from the out-of-band stage as needed. The incurred
overhead is negligible compared to what Valgrind already adds anyway.

Also, provide a placeholder for valgrind/valgrind.h which should be
picked when Valgrind is not installed on the build system.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent 2dcda22d
/* A placeholder for valgrind/valgrind.h if uninstalled. */
#define RUNNING_ON_VALGRIND 0
......@@ -15,6 +15,7 @@
#include <string.h>
#include <stdio.h>
#include <linux/types.h>
#include <valgrind/valgrind.h>
#include <evl/evl.h>
#include <evl/syscall.h>
#include <evl/thread.h>
......@@ -182,6 +183,13 @@ void evl_sigdebug_handler(int sig, siginfo_t *si, void *ctxt)
static void resolve_vdso_calls(void)
{
/*
* We have no vDSO if running Valgrind, always use fallback
* calls.
*/
if (RUNNING_ON_VALGRIND)
return;
evl_init_vdso();
__evl_clock_gettime = evl_request_vdso(__EVL_VDSO_KVERSION,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment