sef: GCOV cleanup.

Change-Id: I2e5a6ae10f45108a2c112f78e5a0af4f93e0bed1
This commit is contained in:
Cristiano Giuffrida 2014-09-26 16:05:32 +02:00 committed by David van Moolenbroek
parent 65b4b95259
commit dd09614042
3 changed files with 21 additions and 6 deletions

View file

@ -230,12 +230,10 @@ int sef_cb_lu_response_rs_reply(message *m_ptr);
/* Callback type definitions. */
typedef void(*sef_cb_signal_handler_t)(int signo);
typedef int(*sef_cb_signal_manager_t)(endpoint_t target, int signo);
typedef int(*sef_cb_gcov_t)(message *msg);
/* Callback registration helpers. */
void sef_setcb_signal_handler(sef_cb_signal_handler_t cb);
void sef_setcb_signal_manager(sef_cb_signal_manager_t cb);
void sef_setcb_gcov(sef_cb_gcov_t cb);
/* Predefined callback implementations. */
void sef_cb_signal_handler_null(int signo);
@ -262,6 +260,24 @@ void sef_cb_signal_handler_posix_default(int signo);
#define sef_signal_debug_begin sef_debug_begin
#define sef_signal_debug_end sef_debug_end
/*===========================================================================*
* SEF GCOV *
*===========================================================================*/
/* What to intercept. */
#define INTERCEPT_SEF_GCOV_REQUESTS 1
#define SEF_GCOV_REQUEST_TYPE COMMON_REQ_GCOV_DATA
#define IS_SEF_GCOV_REQUEST(mp, status) \
((mp)->m_type == COMMON_REQ_GCOV_DATA && (mp)->m_source == VFS_PROC_NR)
/* Callback type definitions. */
typedef int(*sef_cb_gcov_t)(message *msg);
/* Callback registration helpers. */
void sef_setcb_gcov(sef_cb_gcov_t cb);
/* Macros for predefined callback implementations. */
#define SEF_CB_GCOV_FLUSH_DEFAULT do_gcov_flush_impl
/*===========================================================================*
* SEF Fault Injection *
*===========================================================================*/

View file

@ -178,10 +178,9 @@ int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr)
}
#endif
#ifdef USE_COVERAGE
#if INTERCEPT_SEF_GCOV_REQUESTS && USE_COVERAGE
/* Intercept GCOV data requests (sent by VFS in vfs/gcov.c). */
if(m_ptr->m_type == COMMON_REQ_GCOV_DATA &&
m_ptr->m_source == VFS_PROC_NR) {
if(IS_SEF_GCOV_REQUEST(m_ptr, status)) {
if(do_sef_gcov_request(m_ptr) == OK) {
continue;
}

View file

@ -4,7 +4,7 @@
#include <minix/sysutil.h>
#include <minix/gcov.h>
static sef_cb_gcov_t sef_cb_gcov = do_gcov_flush_impl;
static sef_cb_gcov_t sef_cb_gcov = SEF_CB_GCOV_FLUSH_DEFAULT;
/*===========================================================================*
* do_sef_gcov_request *