Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1341 → Rev 1353

/demos/trunk/newtrace/dumper/dumper
File deleted
\ No newline at end of file
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: dumper/dumper.c
===================================================================
--- dumper/dumper.c (revision 1341)
+++ dumper/dumper.c (nonexistent)
@@ -1,99 +0,0 @@
-#include <tracer.h>
-
-#include <kernel/kern.h>
-#include <drivers/udpip.h>
-#include <unistd.h>
-
-
-TASK finish_task() {
-
- #ifdef __NEW_TRACER__
-
- extern __volatile__ unsigned int TracerEventsPresent;
- unsigned int k;
-
- SYS_FLAGS f;
-
- sleep(1);
-
- tracer_init_udp(0,"192.168.118.4","192.168.118.2");
-
- sleep(1);
-
- tracer_create_udp_task(NULL,80);
-
- sleep(1);
-
- f = kern_fsave();
- k = TracerEventsPresent;
- kern_frestore(f);
- while(k > 0) {
- f = kern_fsave();
- printf_xy(0,5,WHITE,"REM = %08d",k);
- k = TracerEventsPresent;
- kern_frestore(f);
- }
-
- tracer_flush_sent_events();
-
- #endif
-
- sys_end();
-
- return NULL;
-
-}
-
-extern void *StartTracerBuffer; // Buffer Start 0
-extern void *EndTracerBuffer; // Buffer End 4
-extern void *LastBeforeEndTracerBuffer; //8
-extern void *CurrentTracerBuffer; //The Actual Write Point For The Next Event 12
-extern void *FirstTracerBuffer; //The First Valid Event 16
-
-extern int TracerActive; //20
-extern int TracerOutputType; //24
-extern unsigned long long TracerEventsRecorded; //28
-extern unsigned int TracerEventsPresent; //36
-
-int main() {
-
- NRT_TASK_MODEL nrt;
-
- void *save_tracer_pointer = (void *)(40270428UL);
- struct net_model m = net_base;
-
- #ifdef __NEW_TRACER__
-
- StartTracerBuffer = *(void **)(save_tracer_pointer); // Buffer Start 0
- EndTracerBuffer = *(void **)(save_tracer_pointer+4); // Buffer End 4
- LastBeforeEndTracerBuffer = *(void **)(save_tracer_pointer+8); //8
- CurrentTracerBuffer = *(void **)(save_tracer_pointer+12); //The Actual Write Point For The Next Event 12
- FirstTracerBuffer = *(void **)(save_tracer_pointer+16); //The First Valid Event 16
-
- TracerActive = 0;
-
- TracerEventsRecorded = *(unsigned long long *)(save_tracer_pointer+28); //28
- TracerEventsPresent = *(unsigned int *)(save_tracer_pointer+36); //36
-
- cprintf("Total Events Present %d\n",TracerEventsPresent);
-
- net_setudpip(m, "192.168.118.4", "255.255.255.255");
-
- if (net_init(&m) != 1) {
- return -1;
- }
-
- nrt_task_default_model(nrt);
-
- task_activate(task_create("Finish",finish_task,&nrt,NULL));
-
- #else
-
- sys_end();
-
- #endif
-
- return 0;
-
-}
-
Index: dumper/makefile
===================================================================
--- dumper/makefile (revision 1341)
+++ dumper/makefile (nonexistent)
@@ -1,21 +0,0 @@
-#
-#
-#
-
-ifndef BASE
-BASE=../../..
-endif
-include $(BASE)/config/config.mk
-
-PROGS= dumper testdump
-
-include $(BASE)/config/example.mk
-
-OBJS= "initfile.o"
-
-dumper:
- make -f $(SUBMAKE) BASE=$(BASE) APP=dumper INIT= OTHEROBJS=$(OBJS) SHARKOPT="__OLDCHAR__"
-
-testdump:
- make -f $(SUBMAKE) BASE=$(BASE) APP=testdump INIT= OTHEROBJS=$(OBJS) SHARKOPT="__OLDCHAR__"
-
Index: dumper/initfile.c
===================================================================
--- dumper/initfile.c (revision 1341)
+++ dumper/initfile.c (nonexistent)
@@ -1,79 +0,0 @@
-/*
- * Project: S.Ha.R.K.
- *
- * Coordinators:
- * Giorgio Buttazzo <giorgio@sssup.it>
- * Paolo Gai <pj@gandalf.sssup.it>
- *
- * Authors :
- * Giacomo Guidi <giacomo@gandalf.sssup.it>
- * (see the web pages for full authors list)
- *
- * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
- *
- * http://www.sssup.it
- * http://retis.sssup.it
- * http://shark.sssup.it
- */
-
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
-#include "kernel/kern.h"
-#include "modules/edf.h"
-#include "modules/cbs.h"
-#include "modules/rr.h"
-#include "modules/sem.h"
-#include "modules/dummy.h"
-#include "modules/hartport.h"
-
-#include "modules/pi.h"
-
-#define TICK 0
-
-#define RRTICK 10000
-
-TIME __kernel_register_levels__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- EDF_register_level(EDF_ENABLE_ALL);
- CBS_register_level(CBS_ENABLE_ALL,0);
- RR_register_level(RRTICK, RR_MAIN_YES, mb);
- dummy_register_level();
-
- SEM_register_module();
-
- PI_register_module();
-
- return TICK;
-
-}
-
-TASK __init__(void *arg)
-{
- struct multiboot_info *mb = (struct multiboot_info *)arg;
-
- HARTPORT_init();
-
- __call_main__(mb);
-
- return (void *)0;
-}
-
Index: dumper/testdump.c
===================================================================
--- dumper/testdump.c (revision 1341)
+++ dumper/testdump.c (nonexistent)
@@ -1,55 +0,0 @@
-#include <kernel/kern.h>
-#include <tracer.h>
-#include <stdlib.h>
-
-TASK hard_task(void *arg)
-{
-
- static int count = 0;
- int i;
-
- while(1) {
-
- count++;
- printf_xy(1,1,WHITE,"Exec %6d",count);
-
- if (count == 200) while(1);
-
- for (i=0;i<100000;i++);
-
- task_endcycle();
-
- }
-
- return 0;
-
-}
-
-int main() {
-
- HARD_TASK_MODEL ht;
- PID p;
- void *delta;
-
- delta = malloc(10000000);
- tracer_initialize(1000000);
-
- tracer_enable();
-
- hard_task_default_model(ht);
- hard_task_def_mit(ht,100000);
- hard_task_def_wcet(ht,10000);
-
- p = task_create("Test",hard_task,&ht,NULL);
- if (p == NIL) {
- cprintf("Error Creating Task\n");
- sys_end();
- }
-
- task_activate(p);
-
- while(1);
-
- return 0;
-
-}
Index: udp/initfile.c
===================================================================
--- udp/initfile.c (revision 1341)
+++ udp/initfile.c (revision 1353)
@@ -6,7 +6,7 @@
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
- * Paolo Gai <pj@gandalf.sssup.it>
+ * Giacomo Guidi <giacomo@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
@@ -16,25 +16,6 @@
* http://shark.sssup.it
*/
-/*
- * Copyright (C) 2000 Paolo Gai
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-
#include "kernel/kern.h"
#include "modules/edf.h"
#include "modules/cbs.h"
/demos/trunk/newtrace/udp/udptrace.c
15,24 → 15,6
* http://shark.sssup.it
*/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
#include <kernel/kern.h>
#include <tracer.h>
 
40,27 → 22,31
{
 
long long i;
int err;
 
int a,b,c;
struct timespec start,end,diff;
 
//Initialize Tracer
tracer_initialize(1000000);
FTrace_init();
 
//Set UDP output
err = tracer_init_udp(1,"192.168.82.46","192.168.82.20");
if (err != 0) {
cprintf("Network Open Fail !\n");
sys_end();
}
a = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
b = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_JTN);
c = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
 
FTrace_chunk_link(a,b);
FTrace_chunk_link(b,c);
 
FTrace_actual_chunk_select(a);
 
kern_gettime(&start);
tracer_enable();
FTrace_enable();
 
for (i=0;i<1000000000;i++);
TRACER_LOGEVENT(FTrace_EVT_next_chunk,0,0);
 
tracer_disable();
for (i=0;i<1000000000;i++);
 
FTrace_disable();
kern_gettime(&end);
 
SUBTIMESPEC(&end,&start,&diff);
67,15 → 53,10
 
cprintf("Logged Time %d s %d us\n",(int)diff.tv_sec,(int)diff.tv_nsec/1000);
 
tracer_print_statistics();
FTrace_chunk_dump(a);
FTrace_chunk_dump(b);
FTrace_chunk_dump(c);
 
//Send the events
tracer_send_logged_events(-1);
tracer_flush_sent_events();
 
// Ctrl-C to exit
while(1);
 
return 0;
 
}
/demos/trunk/newtrace/nosave/initfile.c
6,7 → 6,7
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Paolo Gai <pj@gandalf.sssup.it>
* Giacomo Guidi <giacomo@gandalf.sssup.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
16,25 → 16,6
* http://shark.sssup.it
*/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
#include "kernel/kern.h"
#include "modules/edf.h"
#include "modules/cbs.h"
/demos/trunk/newtrace/nosave/nosave.c
15,24 → 15,6
* http://shark.sssup.it
*/
 
/*
* Copyright (C) 2000 Paolo Gai
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
 
#include <kernel/kern.h>
#include <tracer.h>
 
41,14 → 23,20
 
long long i;
 
int a,b,c;
struct timespec start,end,diff;
 
FTrace_chunk_create(3, 1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
FTrace_set_chunk_flags(1, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_JTN);
FTrace_chunk_link(0,1,FTRACE_OSD_NEXT1);
FTrace_chunk_link(0,2,FTRACE_OSD_NEXT2);
FTrace_actual_chunk_select(0);
FTrace_init();
 
a = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
b = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_JTN);
c = FTrace_chunk_create(1000000, 1000000, FTRACE_CHUNK_FLAG_FREE | FTRACE_CHUNK_FLAG_CYC);
 
FTrace_chunk_link(a,b);
FTrace_chunk_link(b,c);
 
FTrace_actual_chunk_select(a);
 
kern_gettime(&start);
FTrace_enable();
 
65,8 → 53,9
 
cprintf("Logged Time %d s %d us\n",(int)diff.tv_sec,(int)diff.tv_nsec/1000);
 
FTrace_OSD_dump();
FTrace_chunk_dump(0);
FTrace_chunk_dump(a);
FTrace_chunk_dump(b);
FTrace_chunk_dump(c);
 
return 0;