rres_hooks.c File Reference

#include "rres_config.h"
#include "qos_debug.h"
#include "qos_prof.h"
#include "qos_list.h"
#include "qos_func.h"
#include "kal_generic.h"
#include "rres_interface.h"
#include "rres_kpi_protected.h"
#include "rres.h"
#include "rres_dispatch.h"
#include "rres_time.h"
#include <asm/param.h>
#include <linux/version.h>
#include "kal_timer.h"
#include <sys/time.h>
#include <time.h>

Go to the source code of this file.

Defines

#define QOS_DEBUG_LEVEL   RRES_MOD_DEBUG_LEVEL

Functions

void rres_unblock_hook (kal_task_t *t, long old_state)
 Handler of unblock_hook.
void rres_block_hook (kal_task_t *t)
 Handler of block_hook.
void rres_stop_hook (kal_task_t *t)
 Handler of stop_hook.
void rres_continue_hook (kal_task_t *t, long old_state)
 Handler of continue_hook.
void rres_fork_hook (kal_task_t *t, kal_task_t *prev)
 Handler of fork_hook.
void rres_cleanup_hook (kal_task_t *t)
 Handler of cleanup_hook.
void set_gensched_hooks (void)
 Set scheduler hooks.
int check_gensched_hooks (void)
 Return true if hooks are not initialised.
void unset_gensched_hooks (void)
 Unset scheduler hooks.

Detailed Description

Definition in file rres_hooks.c.


Define Documentation

#define QOS_DEBUG_LEVEL   RRES_MOD_DEBUG_LEVEL

Definition at line 11 of file rres_hooks.c.


Function Documentation

void rres_block_hook ( kal_task_t t  ) 

Handler of block_hook.

Called when a task blocks.

Note:
While a task is executing kernel-space code that is going to block it, if kernel is preemptive, the RRES enforcement timer may fire, causing the task to be stopped through task_stop(), but the task will be descheduled only at return from kernel-space, i.e. it may continue execution of the code needed to block. In such case, the block hook finds a stopped task, thus it dispatches it back, in order to preserve the KAL invariant that a blocked task was in dispatched mode before blocking.

Definition at line 64 of file rres_hooks.c.

References prof_end, prof_func, prof_vars, rres_get_spinlock(), and rres_on_task_block().

Referenced by rres_stop_hook(), and set_gensched_hooks().

void rres_cleanup_hook ( kal_task_t t  ) 

Handler of cleanup_hook.

Called when a task exits.

This handler may be overridden by other modules.

Definition at line 138 of file rres_hooks.c.

References prof_end, prof_func, prof_vars, qos_chk_do, qos_chk_ok_do, rres_check_destroy(), rres_detach_task_nosched(), rres_empty(), rres_find_by_task(), rres_get_spinlock(), rres_has_ready_tasks(), rres_running(), rres_sample_time(), rres_schedule(), and srv.

Referenced by set_gensched_hooks().

void rres_continue_hook ( kal_task_t t,
long  old_state 
)

Handler of continue_hook.

Called when a task is resumed through SIGCONT

Definition at line 86 of file rres_hooks.c.

References qos_log_debug, and rres_unblock_hook().

Referenced by set_gensched_hooks().

void rres_fork_hook ( kal_task_t t,
kal_task_t prev 
)

Handler of fork_hook.

Called when a task forks

Definition at line 116 of file rres_hooks.c.

References kal_task_get_data(), kal_task_get_id(), prof_end, prof_func, prof_vars, qos_chk_ok, qos_log_debug, rres_attach_task(), rres_find_by_task(), rres_get_spinlock(), and srv.

Referenced by set_gensched_hooks().

void rres_stop_hook ( kal_task_t t  ) 

Handler of stop_hook.

Called when a task is suspended through SIGSTOP

Definition at line 76 of file rres_hooks.c.

References qos_log_debug, and rres_block_hook().

Referenced by set_gensched_hooks().

void rres_unblock_hook ( kal_task_t t,
long  old_state 
)

Handler of unblock_hook.

Called when a task unblocks.

Note:
When the task blocked, it was dispatched, thus we need to stop it if the server is stopped.

Definition at line 41 of file rres_hooks.c.

References prof_end, prof_func, prof_vars, qos_chk_ok, rres_get_spinlock(), and rres_on_task_unblock().

Referenced by rres_continue_hook(), and set_gensched_hooks().

Generated on Mon Aug 2 22:39:17 2010 for qosres by  doxygen 1.6.3