Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 321 → Rev 353

/shark/trunk/kernel/modules/edf.c
20,11 → 20,11
 
/**
------------
CVS : $Id: edf.c,v 1.8 2003-09-29 16:24:36 giacomo Exp $
CVS : $Id: edf.c,v 1.9 2003-12-10 16:55:00 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.8 $
Last update: $Date: 2003-09-29 16:24:36 $
Revision: $Revision: 1.9 $
Last update: $Date: 2003-12-10 16:55:00 $
------------
 
This file contains the scheduling module EDF (Earliest Deadline First)
60,8 → 60,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
//#define EDF_DEBUG
#define edf_printf kern_printf
 
122,7 → 123,7
 
case EDF_IDLE:
/* tracer stuff */
trc_logevent(TRC_INTACTIVATION,&p);
TRACER_LOGEVENT(FTrace_EVT_task_timer,3,p,proc_table[p].task_level);
/* similar to EDF_task_activate */
temp = iq_query_timespec(p,&lev->ready);
ADDUSEC2TIMESPEC(lev->period[p], temp);
371,7 → 372,7
proc_table[p].avail_time = proc_table[p].wcet;
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&p); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
break;
 
390,7 → 391,7
if (proc_table[p].status == EDF_IDLE)
proc_table[p].status = EDF_WAIT;
 
trc_logevent(TRC_DISABLE,&p);
TRACER_LOGEVENT(FTrace_EVT_task_disable,3,p,l);
 
break;
 
/shark/trunk/kernel/modules/posix.c
20,11 → 20,11
 
/**
------------
CVS : $Id: posix.c,v 1.5 2003-10-07 09:25:33 giacomo Exp $
CVS : $Id: posix.c,v 1.6 2003-12-10 16:55:00 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-10-07 09:25:33 $
Revision: $Revision: 1.6 $
Last update: $Date: 2003-12-10 16:55:00 $
------------
 
This file contains the scheduling module compatible with POSIX
63,8 → 63,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ Status used in the level +*/
#define POSIX_READY MODULE_STATUS_BASE
 
264,7 → 265,7
proc_table[p].status = SLEEP;
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
return 0;
}
/shark/trunk/kernel/modules/hardcbs.c
45,8 → 45,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ Status used in the level +*/
#define HCBS_IDLE APER_STATUS_BASE /*+ waiting the activation +*/
#define HCBS_ZOMBIE APER_STATUS_BASE+1 /*+ waiting the period end +*/
190,7 → 191,7
}
/* tracer stuff */
trc_logevent(TRC_INTACTIVATION,&p);
TRACER_LOGEVENT(FTrace_EVT_task_timer,3,p,proc_table[p].task_level);
 
}
 
449,7 → 450,7
}
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&p); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
break;
 
456,7 → 457,7
case 1:
 
lev->flag[p] |= HCBS_SLEEP;
trc_logevent(TRC_DISABLE,&p);
TRACER_LOGEVENT(FTrace_EVT_task_disable,3,p,l);
 
break;
 
/shark/trunk/kernel/modules/cbs.c
20,11 → 20,11
 
/**
------------
CVS : $Id: cbs.c,v 1.7 2003-07-24 12:24:51 giacomo Exp $
CVS : $Id: cbs.c,v 1.8 2003-12-10 16:54:59 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.7 $
Last update: $Date: 2003-07-24 12:24:51 $
Revision: $Revision: 1.8 $
Last update: $Date: 2003-12-10 16:54:59 $
------------
 
This file contains the aperiodic server CBS (Total Bandwidth Server)
60,8 → 60,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ 4 debug purposes +*/
#undef CBS_TEST
#undef CBS_COUNTER
239,7 → 240,7
if (p==5) cbs_counter2++;
#endif
/* tracer stuff */
trc_logevent(TRC_INTACTIVATION,&p);
TRACER_LOGEVENT(FTrace_EVT_task_timer,3,p,proc_table[p].task_level);
 
}
 
492,7 → 493,7
}
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&p); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
break;
 
499,7 → 500,7
case 1:
 
lev->flag[p] |= CBS_SLEEP;
trc_logevent(TRC_DISABLE,&p);
TRACER_LOGEVENT(FTrace_EVT_task_disable,3,p,l);
 
break;
 
/shark/trunk/kernel/modules/rrsoft.c
20,11 → 20,11
 
/**
------------
CVS : $Id: rrsoft.c,v 1.5 2003-05-01 19:39:35 pj Exp $
CVS : $Id: rrsoft.c,v 1.6 2003-12-10 16:55:01 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-05-01 19:39:35 $
Revision: $Revision: 1.6 $
Last update: $Date: 2003-12-10 16:55:01 $
------------
 
This file contains the scheduling module RRSOFT (Round Robin)
60,8 → 60,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ Status used in the level +*/
#define RRSOFT_READY MODULE_STATUS_BASE
#define RRSOFT_IDLE MODULE_STATUS_BASE+2
121,8 → 122,6
lev->reactivation_timer[p] = kern_event_post(&lev->reactivation_time[p],
RRSOFT_timer_reactivate,
(void *)p);
/* tracer stuff */
// trc_logevent(TRC_INTACTIVATION,&p);
}
 
/* This is not efficient but very fair :-)
324,7 → 323,7
proc_table[p].status = RRSOFT_IDLE;
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
return 0;
}
/shark/trunk/kernel/modules/ss.c
20,11 → 20,11
 
/**
------------
CVS : $Id: ss.c,v 1.4 2003-01-07 17:07:51 pj Exp $
CVS : $Id: ss.c,v 1.5 2003-12-10 16:55:01 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-01-07 17:07:51 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-12-10 16:55:01 $
------------
 
This file contains the aperiodic Sporadic Server (SS).
125,8 → 125,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/* For debugging purpose */
//#define DEBUG 1
 
884,7 → 885,7
}
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
return 0;
}
/shark/trunk/kernel/modules/tbs.c
20,11 → 20,11
 
/**
------------
CVS : $Id: tbs.c,v 1.4 2003-01-07 17:07:51 pj Exp $
CVS : $Id: tbs.c,v 1.5 2003-12-10 16:55:01 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-01-07 17:07:51 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-12-10 16:55:01 $
------------
 
This file contains the aperiodic server TBS (Total Bandwidth Server)
60,8 → 60,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ 4 debug purposes +*/
#undef TBS_TEST
 
328,7 → 329,7
TBS_activation(lev);
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
return 0;
}
/shark/trunk/kernel/modules/rr2.c
20,11 → 20,11
 
/**
------------
CVS : $Id: rr2.c,v 1.4 2003-01-07 17:07:50 pj Exp $
CVS : $Id: rr2.c,v 1.5 2003-12-10 16:55:01 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-01-07 17:07:50 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-12-10 16:55:01 $
------------
 
This file contains the scheduling module RR2 (Round Robin) version 2
60,8 → 60,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ Status used in the level +*/
#define RR2_READY MODULE_STATUS_BASE
 
221,7 → 222,7
proc_table[p].status = SLEEP;
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
return 0;
}
/shark/trunk/kernel/modules/ds.c
20,11 → 20,11
 
/**
------------
CVS : $Id: ds.c,v 1.4 2003-01-07 17:07:50 pj Exp $
CVS : $Id: ds.c,v 1.5 2003-12-10 16:54:59 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-01-07 17:07:50 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-12-10 16:54:59 $
------------
 
This file contains the aperiodic server DS (Deferrable Server)
64,8 → 64,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ Status used in the level +*/
#define DS_WAIT APER_STATUS_BASE /*+ waiting the service +*/
 
365,7 → 366,7
DS_activation(lev);
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
return 0;
}
/shark/trunk/kernel/modules/rm.c
20,11 → 20,11
 
/**
------------
CVS : $Id: rm.c,v 1.5 2003-05-05 07:31:44 pj Exp $
CVS : $Id: rm.c,v 1.6 2003-12-10 16:55:00 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-05-05 07:31:44 $
Revision: $Revision: 1.6 $
Last update: $Date: 2003-12-10 16:55:00 $
------------
 
This file contains the scheduling module RM (Rate Monotonic)
67,8 → 67,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ Status used in the level +*/
#define RM_READY MODULE_STATUS_BASE /*+ - Ready status +*/
#define RM_WCET_VIOLATED MODULE_STATUS_BASE+2 /*+ when wcet is finished +*/
121,7 → 122,7
 
case RM_IDLE:
/* tracer stuff */
trc_logevent(TRC_INTACTIVATION,&p);
TRACER_LOGEVENT(FTrace_EVT_task_timer,3,p,proc_table[p].task_level);
/* similar to RM_task_activate */
temp = iq_query_timespec(p, &lev->ready);
ADDUSEC2TIMESPEC(lev->period[p], temp);
335,8 → 336,8
proc_table[p].avail_time = proc_table[p].wcet;
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
 
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
/* when the deadline timer fire, it recognize the situation and set
correctly all the stuffs (like reactivation, sleep, etc... ) */
 
/shark/trunk/kernel/modules/ps.c
20,11 → 20,11
 
/**
------------
CVS : $Id: ps.c,v 1.4 2003-01-07 17:07:50 pj Exp $
CVS : $Id: ps.c,v 1.5 2003-12-10 16:55:00 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-01-07 17:07:50 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-12-10 16:55:00 $
------------
 
This file contains the aperiodic server PS (Polling Server)
103,8 → 103,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
/*+ Status used in the level +*/
#define PS_WAIT APER_STATUS_BASE /*+ waiting the service +*/
 
407,7 → 408,7
PS_activation(lev);
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l);
 
return 0;
}
/shark/trunk/kernel/modules/rr.c
20,11 → 20,11
 
/**
------------
CVS : $Id: rr.c,v 1.5 2003-04-28 11:52:05 giacomo Exp $
CVS : $Id: rr.c,v 1.6 2003-12-10 16:55:00 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-04-28 11:52:05 $
Revision: $Revision: 1.6 $
Last update: $Date: 2003-12-10 16:55:00 $
------------
 
This file contains the scheduling module RR (Round Robin)
60,8 → 60,9
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
 
#include <tracer.h>
 
//#define RRDEBUG
 
#define rr_printf kern_printf
245,7 → 246,7
proc_table[p].status = SLEEP;
 
jet_update_endcycle(); /* Update the Jet data... */
trc_logevent(TRC_ENDCYCLE,&exec_shadow); /* tracer stuff */
TRACER_LOGEVENT(FTrace_EVT_task_end_cycle,3,p,l); /* tracer stuff */
 
#ifdef RRDEBUG
rr_printf("(msg%d)",p);
/shark/trunk/kernel/modules/sem.c
20,11 → 20,11
 
/**
------------
CVS : $Id: sem.c,v 1.5 2003-11-06 09:42:23 giacomo Exp $
CVS : $Id: sem.c,v 1.6 2003-12-10 16:55:01 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-06 09:42:23 $
Revision: $Revision: 1.6 $
Last update: $Date: 2003-12-10 16:55:01 $
------------
 
This file contains the Hartik 3.3.1 Semaphore functions
69,10 → 69,10
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
#include <limits.h>
#include <fcntl.h>
 
#include <tracer.h>
 
/* Semaphores descriptor tables */
static struct sem_des {
360,7 → 360,7
LEVEL l; /* for readableness only */
 
/* tracer stuff */
trc_logevent(TRC_SEM_WAIT,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
 
kern_epilogue_macro();
 
388,7 → 388,7
else {
s1->count--;
/* tracer stuff */
trc_logevent(TRC_SEM_WAIT,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
kern_context_load(proc_table[exec_shadow].context);
}
 
412,9 → 412,6
 
s1 = &sem_table[*s];
 
/* tracer stuff */
//trc_logevent(TRC_SEM_WAITNB,s);
 
if (s1->blocked.first != NIL || s1->count == 0) {
errno = EAGAIN;
kern_frestore(f);
452,9 → 449,6
/* The non blocking wait is really simple! */
/* We do not suspend or schedule anything */
if (wait == NON_BLOCK) {
/* tracer */
//trc_logevent(TRC_SEM_WAITNB,s);
 
if (s1->blocked.first != NIL || s1->count < n) {
errno = EAGAIN;
kern_sti();
476,7 → 470,7
LEVEL l; /* for readableness only */
 
/* tracer */
trc_logevent(TRC_SEM_WAIT,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
kern_epilogue_macro();
504,8 → 498,8
else {
s1->count -= n;
/* tracer */
trc_logevent(TRC_SEM_WAIT,s);
kern_context_load(proc_table[exec_shadow].context);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
kern_context_load(proc_table[exec_shadow].context);
}
}
 
551,7 → 545,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,1,*s,exec_shadow);
kern_frestore(f);
}
else {
576,7 → 570,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,3,*s,exec_shadow);
kern_context_load(proc_table[exec_shadow].context);
}
626,7 → 620,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,3,*s,exec_shadow);
/* Preempt if necessary */
if (fl) event_need_reschedule();
656,7 → 650,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,3,*s,exec_shadow);
/* Preempt if necessary */
if (fl) scheduler();
/shark/trunk/kernel/modules/makefile
9,6 → 9,7
LIBRARY = mod
 
OBJS_PATH = $(BASE)/kernel/modules
INCL += -I$(BASE)/tracer/include
 
#
# Object files
41,14 → 42,7
bd_edf.o \
bd_pscan.o
 
TRC_OBJ = trace.o \
trcdummy.o \
trcfixed.o \
trccirc.o \
trcdfix.o \
trcudp.o
OBJS = $(SCHED_OBJ) $(APER_OBJ) $(RES_OBJ)
 
OBJS = $(SCHED_OBJ) $(APER_OBJ) $(RES_OBJ) $(TRC_OBJ)
 
include $(BASE)/config/lib.mk