Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 949 → Rev 950

/shark/trunk/ports/first/fsf_include/tests/shark_glue/initfile.c
76,8 → 76,8
 
int device_drivers_close() {
 
KEYB26_close();
INPUT26_close();
//KEYB26_close();
//INPUT26_close();
return 0;
88,11 → 88,11
LINUXC26_register_module();
PCI26_init();
INPUT26_init();
//INPUT26_init();
 
/*keyb_def_map(kparms, KEYMAP_IT);*/
keyb_def_ctrlC(kparms, NULL);
KEYB26_init(&kparms);
//keyb_def_ctrlC(kparms, NULL);
//KEYB26_init(&kparms);
 
 
return 0;
/shark/trunk/ports/first/fsf_include/tests/common/fsf_os_compatibility.h
11,8 → 11,10
{ \
fsf_init(); \
calibrate_cycle(); \
init_network(); \
}
 
#define fsf_printf udp_print
#define printf cprintf
/*
double
/shark/trunk/ports/first/fsf_include/tests/fsf_negotiation_test/makefile
15,5 → 15,15
endif
 
$(OS)_$(WL)_negotiation_test:
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=fsf_negotiation_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=fsf_negotiation_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o ../$(OSNAME)/net_print.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
 
ifeq ($(OS), M)
 
HERE=$(shell /bin/pwd)
export HERE
 
$(PROGS):
cd /home/marte/fsf ; make $(PROGS)
 
endif
 
/shark/trunk/ports/first/fsf_include/tests/fsf_negotiation_test/fsf_negotiation_test.c
207,7 → 207,7
 
if ((terror=fsf_initialize_contract(&contract)))
{
printf(" Initialize fail for server A\n");
fsf_printf(" Initialize fail for server A\n");
ERROR(terror,"fsf_initialize_contract failed");
}
 
216,7 → 216,7
&period_max,
workload)))
{
printf("Set_Basic_Parameters failed for server A\n");
fsf_printf("Set_Basic_Parameters failed for server A\n");
ERROR(terror,"set_contract_basic_parameters failed");
}
 
228,7 → 228,7
deadline_miss_sig_notify,
deadline_miss_sig_value)))
{
printf("Set_Timing_Requirements failed for server A\n");
fsf_printf("Set_Timing_Requirements failed for server A\n");
ERROR(terror,"fsf_set_contract_timing_requirements failed");
}
 
240,7 → 240,7
quality,
importance)))
{
printf("Set_Reclamation_Parameters failed for server A\n");
fsf_printf("Set_Reclamation_Parameters failed for server A\n");
ERROR(terror,"fsf_set_contract_reclamation_parameters failed");
}
 
248,7 → 248,7
if ((terror=fsf_set_contract_synchronization_parameters (&contract,
critical_sections)))
{
printf("Set_Synchronization_Parameters failed for server A\n");
fsf_printf("Set_Synchronization_Parameters failed for server A\n");
ERROR(terror,"fsf_set_contract_synchronization_parameters failed");
}
 
257,7 → 257,7
end = put_time(NULL, " end first server contract negotiation");
if (terror)
{
printf("Negotiate_Contract failed for server 0\n");
fsf_printf("Negotiate_Contract failed for server 0\n");
ERROR(terror,"fsf_negotiate_contract_for_myself failed");
}
269,7 → 269,7
end = put_time(NULL, " end first server contract renegotiation");
if (terror)
{
printf("ReNegotiate_Contract failed for server 0\n");
fsf_printf("ReNegotiate_Contract failed for server 0\n");
ERROR(terror,"fsf_renegotiate_contract failed");
}
281,7 → 281,7
end = put_time(NULL, " end first server change quality and importance");
if (terror)
{
printf("Change quality and importancet failed for server 0\n");
fsf_printf("Change quality and importancet failed for server 0\n");
ERROR(terror,"fsf_renegotiate_contract failed");
}
301,7 → 301,7
terror = fsf_get_budget_and_period (server[0], &budget, &period);
if (terror)
{
printf("fsf_get_budget_and_period failed for server 0\n");
fsf_printf("fsf_get_budget_and_period failed for server 0\n");
ERROR(terror,"fsf_get_budget_and_period failed");
}
// put_time(&budget,"the budget gotten is: ");
329,7 → 329,7
if ((terror=fsf_set_contract_synchronization_parameters (&contract,
critical_sections)))
{
printf("Set_Synchronization_Parameters failed for server %d\n", n_servers);
fsf_printf("Set_Synchronization_Parameters failed for server %d\n", n_servers);
ERROR(terror,"fsf_set_contract_synchronization_parameters failed");
}
339,12 → 339,12
end = put_time(NULL, " end server contract negotiation");
if (terror)
{
printf("Negotiate_Contract failed for server %d\n", n_servers);
fsf_printf("Negotiate_Contract failed for server %d\n", n_servers);
ERROR(terror,"fsf_negotiate_contract failed");
}
if (!server[n_servers]) {
printf("The negotiation for the server number %d was not succesful!! (n_servers=%d)\n",n_servers+1, n_servers);
fsf_printf("The negotiation for the server number %d was not succesful!! (n_servers=%d)\n",n_servers+1, n_servers);
break;
}
370,7 → 370,7
end = put_time(NULL, " end first server change quality and importance");
if (terror)
{
printf("Change quality and importancet failed for server %d\n", n_servers);
fsf_printf("Change quality and importancet failed for server %d\n", n_servers);
ERROR(terror,"fsf_request_change_quality_and_importance failed");
}
390,11 → 390,11
terror = fsf_get_budget_and_period (server[0], &budget, &period);
if (terror)
{
printf("fsf_get_budget_and_period failed for server 0\n");
fsf_printf("fsf_get_budget_and_period failed for server 0\n");
ERROR(terror,"fsf_get_budget_and_period failed");
}
if (period.tv_sec==0 && period.tv_nsec==0) {
printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, 0);
fsf_printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, 0);
exit(-1);
}
u = t2d(budget) / t2d(period);
406,11 → 406,11
terror = fsf_get_budget_and_period (server[i], &budget, &period);
if (terror)
{
printf("fsf_get_budget_and_period failed for server %d\n", n_servers);
fsf_printf("fsf_get_budget_and_period failed for server %d\n", n_servers);
ERROR(terror,"fsf_get_budget_and_period failed");
}
if (period.tv_sec==0 && period.tv_nsec==0) {
printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, i);
fsf_printf("while processing server %d, the period gotten for server %d is cero!!\n", n_servers, i);
exit(-1);
}
u = t2d(budget) / t2d(period);
430,7 → 430,7
end = put_time(NULL, " end server contract cancellation");
if (terror)
{
printf("Cancel_Contract failed for server %d\n", i);
fsf_printf("Cancel_Contract failed for server %d\n", i);
ERROR(terror,"fsf_cancel_contract failed");
}
438,45 → 438,45
server_res[i].cancellation = end;
}
printf("\n");
printf("The number of accepted servers was: %d \n", n_servers);
printf("==================================\n\n");
fsf_printf("\n");
fsf_printf("The number of accepted servers was: %d \n", n_servers);
fsf_printf("==================================\n\n");
printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n");
fsf_printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n");
for (i=0;i<n_servers;i++){
printf(" %2d ", i+1);
printf(" %13.9f ", t2d(server_res[i].negotiation));
printf(" %13.9f ", t2d(server_res[i].renegotiation));
printf(" %13.9f ", t2d(server_res[i].change_q_and_i));
printf(" %13.9f ", t2d(server_res[i].cancellation));
printf(" %13.9f ", server_res[i].max_u);
printf(" %13.9f ", server_res[i].min_u);
printf(" %13.9f ", server_res[i].tot_u);
printf("\n");
fsf_printf(" %2d ", i+1);
fsf_printf(" %13.9f ", t2d(server_res[i].negotiation));
fsf_printf(" %13.9f ", t2d(server_res[i].renegotiation));
fsf_printf(" %13.9f ", t2d(server_res[i].change_q_and_i));
fsf_printf(" %13.9f ", t2d(server_res[i].cancellation));
fsf_printf(" %13.9f ", server_res[i].max_u);
fsf_printf(" %13.9f ", server_res[i].min_u);
fsf_printf(" %13.9f ", server_res[i].tot_u);
fsf_printf("\n");
}
STANDARD_CONSOLE_INIT; //marte1.26i+
printf("\n");
printf("The number of accepted servers was: %d \n", n_servers);
printf("==================================\n\n");
fsf_printf("\n");
fsf_printf("The number of accepted servers was: %d \n", n_servers);
fsf_printf("==================================\n\n");
printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n");
fsf_printf("server negotiation renegotiation qualityChange cancellation max_utilizati min_utilizati total_utilization\n\n");
for (i=0;i<n_servers;i++){
printf(" %2d ", i+1);
printf(" %13.9f ", t2d(server_res[i].negotiation));
printf(" %13.9f ", t2d(server_res[i].renegotiation));
printf(" %13.9f ", t2d(server_res[i].change_q_and_i));
printf(" %13.9f ", t2d(server_res[i].cancellation));
printf(" %13.9f ", server_res[i].max_u);
printf(" %13.9f ", server_res[i].min_u);
printf(" %13.9f ", server_res[i].tot_u);
printf("\n");
fsf_printf(" %2d ", i+1);
fsf_printf(" %13.9f ", t2d(server_res[i].negotiation));
fsf_printf(" %13.9f ", t2d(server_res[i].renegotiation));
fsf_printf(" %13.9f ", t2d(server_res[i].change_q_and_i));
fsf_printf(" %13.9f ", t2d(server_res[i].cancellation));
fsf_printf(" %13.9f ", server_res[i].max_u);
fsf_printf(" %13.9f ", server_res[i].min_u);
fsf_printf(" %13.9f ", server_res[i].tot_u);
fsf_printf("\n");
}
printf("\nThe end.\n");
fsf_printf("\nThe end.\n");
//....
exit(-1);
/shark/trunk/ports/first/fsf_include/tests/synch_obj_test/fsf_synch_obj_test.c
97,7 → 97,7
char *s = NULL;
int i;
 
printf("\n");
fsf_printf("\n");
for (i=0;i<res_index;i++)
{
now = res[i].t;
106,10 → 106,10
diff = now;
decr_timespec(&diff, &last_time);
last_time = now;
printf("(%2d)", i+1);
printf("%-60s", s);
printf(" %2d %9d", now.tv_sec,now.tv_nsec);
printf(" [diff=%13.9f]\n", (double)diff.tv_sec+((double)diff.tv_nsec/(double)1000000000));
fsf_printf("(%2d)", i+1);
fsf_printf("%-60s", s);
fsf_printf(" %2d %9d", now.tv_sec,now.tv_nsec);
fsf_printf(" [diff=%13.9f]\n", (double)diff.tv_sec+((double)diff.tv_nsec/(double)1000000000));
}
 
return 0;
221,8 → 221,7
 
pthread_t task_in_b;
 
calibrate_cycle();
fsf_init();
INITIALIZATION_CODE
SERIAL_CONSOLE_INIT;
param.sched_priority = main_priority;
242,7 → 241,7
 
if ((terror=fsf_initialize_contract(&contract)))
{
printf(" Initialize fail for server A\n");
fsf_printf(" Initialize fail for server A\n");
ERROR(terror,"fsf_initialize_contract failed");
}
 
251,7 → 250,7
&period_max,
workload)))
{
printf("Set_Basic_Parameters failed for server A\n");
fsf_printf("Set_Basic_Parameters failed for server A\n");
ERROR(terror,"set_contract_basic_parameters failed");
}
 
263,7 → 262,7
deadline_miss_sig_notify,
deadline_miss_sig_value)))
{
printf("Set_Timing_Requirements failed for server A\n");
fsf_printf("Set_Timing_Requirements failed for server A\n");
ERROR(terror,"fsf_set_contract_timing_requirements failed");
}
 
275,7 → 274,7
quality,
importance)))
{
printf("Set_Reclamation_Parameters failed for server A\n");
fsf_printf("Set_Reclamation_Parameters failed for server A\n");
ERROR(terror,"fsf_set_contract_reclamation_parameters failed");
}
 
283,7 → 282,7
if ((terror=fsf_set_contract_synchronization_parameters (&contract,
critical_sections)))
{
printf("Set_Synchronization_Parameters failed for server A\n");
fsf_printf("Set_Synchronization_Parameters failed for server A\n");
ERROR(terror,"fsf_set_contract_synchronization_parameters failed");
}
 
293,7 → 292,7
put_time(NULL, "A end first server contract negotiation");
if (terror)
{
printf("Negotiate_Contract failed for server A\n");
fsf_printf("Negotiate_Contract failed for server A\n");
ERROR(terror,"fsf_negotiate_contract_for_myself failed");
}
 
317,7 → 316,7
&period_max,
workload)))
{
printf("Set_Basic_Parameters failed for server B\n");
fsf_printf("Set_Basic_Parameters failed for server B\n");
ERROR(terror,"set_contract_basic_parameters failed");
}
 
329,7 → 328,7
deadline_miss_sig_notify,
deadline_miss_sig_value)))
{
printf("Set_Timing_Requirements failed for server B\n");
fsf_printf("Set_Timing_Requirements failed for server B\n");
ERROR(terror,"fsf_set_contract_timing_requirements failed");
}
 
337,7 → 336,7
if ((terror=fsf_set_contract_synchronization_parameters (&contract,
critical_sections)))
{
printf("Set_Synchronization_Parameters failed for server B\n");
fsf_printf("Set_Synchronization_Parameters failed for server B\n");
ERROR(terror,"fsf_set_contract_synchronization_parameters failed");
}
 
346,7 → 345,7
put_time(NULL, "A ends server B contract negotiation");
if (terror)
{
printf("Negotiate_Contract failed for server B\n");
fsf_printf("Negotiate_Contract failed for server B\n");
ERROR(terror,"fsf_negotiate_contract_for_new_thread failed");
}
 
401,7 → 400,7
 
//print_time_results();
 
printf("\nThe End.\n");
fsf_printf("\nThe End.\n");
 
//stop_scheduler = 1;
 
/shark/trunk/ports/first/fsf_include/tests/synch_obj_test/makefile
15,5 → 15,5
endif
 
$(OS)_$(WL)_synch_test:
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=fsf_synch_obj_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=fsf_synch_obj_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o ../$(OSNAME)/net_print.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
 
/shark/trunk/ports/first/fsf_include/tests/fsf_jitter_test/jitter_test.c
92,8 → 92,8
bool was_budget_overran = 0;
*/
//pthread_t task_in_b;
calibrate_cycle();
fsf_init();
INITIALIZATION_CODE
SERIAL_CONSOLE_INIT; //marte1.26i+
 
param.sched_priority = main_priority;
196,11 → 196,11
}
//printf("\ndebug: now es-> (%d,%d)\n", now.tv_sec, now.tv_nsec);
//printf("\ndebug: ONE-> \n");
if ((terror=clock_gettime(CLOCK_REALTIME,&ahora)))
LOCAL_ERROR(terror,"ahora clock_gettime failed");
//printf("\ndebug: y ahora es-> (%d,%d)\n", ahora.tv_sec, ahora.tv_nsec);
//printf("\ndebug: TWO\n");
decr_timespec(&ahora, &at_absolute_time);
 
if ( smaller_timespec(&ahora, &min_jitter) )
222,9 → 222,9
STANDARD_CONSOLE_INIT; //marte1.26i+
 
printf("\n\n minimum jitter is: %8d\n", min_jitter.tv_nsec+ min_jitter.tv_sec*1000000000);
printf(" maximum jitter is: %8d\n", max_jitter.tv_nsec+ max_jitter.tv_sec*1000000000);
printf(" average jitter is: %8d\n\n", (avg_jitter.tv_nsec+ avg_jitter.tv_sec*1000000000)/my_counter);
fsf_printf("\n\n minimum jitter is: %8d\n", min_jitter.tv_nsec+ min_jitter.tv_sec*1000000000);
fsf_printf(" maximum jitter is: %8d\n", max_jitter.tv_nsec+ max_jitter.tv_sec*1000000000);
fsf_printf(" average jitter is: %8d\n\n", (avg_jitter.tv_nsec+ avg_jitter.tv_sec*1000000000)/my_counter);
 
//printf("\nThe end.\n");
 
/shark/trunk/ports/first/fsf_include/tests/fsf_jitter_test/makefile
15,5 → 15,5
endif
 
$(OS)_$(WL)_jitter_test:
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=jitter_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"
make -f $(SUBMAKE) APPNAME=$(PROGS) APP=jitter_test INIT= OTHEROBJS="../$(OSNAME)/initfile.o ../$(OSNAME)/shark.o ../$(OSNAME)/net_print.o" OTHERINCL="-I../common" SHARKOPT="__INPUT__ __FIRST__ __NEW_TRACER__ __LINUXC26__ __PCI__ __NET__ __GRX__"