Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1027 → Rev 927

/shark/trunk/tracer/newtrace/FTrace_disk.c
File deleted
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: newtrace/FTrace_udp.c
===================================================================
--- newtrace/FTrace_udp.c (revision 1027)
+++ newtrace/FTrace_udp.c (revision 927)
@@ -7,7 +7,6 @@
*
* Authors :
* Giacomo Guidi <giacomo@gandalf.sssup.it>
- * Tullio Facchinetti <tullio.facchinetti@unipv.it>
* (see the web pages for full authors list)
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
@@ -15,9 +14,6 @@
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
- *
- * Robotib Lab (University of Pavia)
- * http://robot.unipv.it
*/
/*
@@ -76,19 +72,10 @@
unsigned int total_size;
};
-/**
- * Initialize the Tracer chunk sender through the network using the UDP
- * protocol supported by S.Ha.R.K.
- * If flag = 1 initializes the network driver, otherwise it considers
- * that the network layer has already been initialized.
- * It also sets the internal chunk sender to the function that initializes
- * the task for sending the chunk.
- */
+//Init UDP, if flag = 1 init the network driver
int FTrace_OSD_init_udp(int flag, char *l_ip, char *t_ip) {
struct net_model m = net_base;
-
- FTrace_set_internal_chunk_sender(FTrace_OSD_create_udp_task); // Tool
strcpy(local_ip,l_ip);
strcpy(target_ip,t_ip);
@@ -204,9 +191,9 @@
// Flush the buffer out
send_udp_event(NULL, 0);
-
- FTrace_chunck_output_end(); // Tool
+ sending_flag = 0;
+
#ifdef TRACER_UDP_DEBUG
cprintf("\nTotal Chunk Event Sent: %d\n",(int)count);
#endif
@@ -220,7 +207,7 @@
NRT_TASK_MODEL st;
- FTrace_chunck_output_start(); // Tool
+ sending_flag = 1;
nrt_task_default_model(st);
nrt_task_def_arg(st,(void *)c);
/shark/trunk/tracer/newtrace/FTrace_OSD_ll.c
1,6 → 1,5
#include <FTrace_types.h>
#include <FTrace_OSD.h>
#include <FTrace.h>
 
#include <ll/i386/hw-instr.h>
 
16,11 → 15,6
 
*/
 
extern WORD FTrace_filter_mask;
 
/**
* This is the function that actually store the event into the selected chunk.
*/
void FTrace_safe_ipoint(WORD type, WORD par1, DWORD par2)
{
 
38,12 → 32,7
f = ll_fsave();
 
if (FTraceEnable) {
/** Tool: do not filter the "filter" event family. */
if ((type & 0xF0) != 0xF0)
if (FTrace_filter_mask & (0x01 << (type & FTrace_family_mask)))
return;
 
current = *(DWORD *)(OSD_current_pointer);
start = *(DWORD *)(OSD_current_pointer + 4);
size = *(DWORD *)(OSD_current_pointer + 8);
61,7 → 50,7
return;
}
/** Cyclical Buffer */
/* Cyclical Buffer */
if (current + 16 >= (start + size)) {
if ((flags & 0x0C) == FTRACE_CHUNK_FLAG_CYC) {
current = start;
/shark/trunk/tracer/newtrace/FTrace.c
1,13 → 1,9
#include <FTrace_chunk.h>
#include <FTrace_types.h>
#include <FTrace_OSD.h>
#include <FTrace.h>
#include <tracer.h>
 
#define FTRACE_DEBUG
//#define FTRACE_DEBUG
 
WORD FTrace_filter_mask = 0;
 
/* Globals */
 
FTrace_Chunk_Ptr ChunkTable[MAX_CHUNK]; /* Chunk array */
34,23 → 30,6
 
}
 
/**
* Set the filter for a specific family of events.
* Store the choice into the filter mask.
* If status is 1 then enable the filter.
* If status is 0 then disable the filter.
*/
void FTrace_set_filter(BYTE filter, int status) {
if (status) FTrace_filter_mask |= (0x01 << (filter & FTrace_family_mask));
if (!status) FTrace_filter_mask &= ~(0x01 << (filter & FTrace_family_mask));
#ifdef FTRACE_DEBUG
printk("FTrace_set_filter: %x\n", FTrace_filter_mask);
#endif
TRACER_LOGEVENT(filter, status, 0);
}
 
/* Find a free slot in ChunkTable */
static int FTrace_find_free_slot()
{
/shark/trunk/tracer/newtrace/FTrace_OSD.c
12,40 → 12,6
extern FTrace_Chunk_Ptr ActualChunk;
extern void *OSD_current_pointer;
 
/**
* This flag keeps track of the current chunk sending action.
* It is 1 if the output is still ongoing.
* It is reset to 0 if the output is finished.
*/
int chunk_sending = 0;
 
/**
* Pointer to the function that actually perform the chunk send.
*/
void (*FTrace_internal_send_chunk)(FTrace_Chunk_Ptr) = NULL;
 
/**
* Initializes the poiter to the function for actually sending the chunk.
*/
void FTrace_set_internal_chunk_sender(void (*ptr)(FTrace_Chunk_Ptr)) {
FTrace_internal_send_chunk = ptr;
}
 
/**
* This function is called before starting the chunck sending.
*/
void FTrace_chunck_output_start() {
chunk_sending = 1;
}
 
/**
* This function is called after the chunck has been entirely sent.
*/
void FTrace_chunck_output_end() {
chunk_sending = 0;
}
 
 
void FTrace_fsave()
{
 
144,24 → 110,17
 
}
 
int FTrace_OSD_send_chunk(FTrace_Chunk_Ptr c, int osd_flag) {
int FTrace_OSD_send_chunk(FTrace_Chunk_Ptr c, int osd_flag)
{
 
// Tool: send the chunk using the selected method
if (FTrace_internal_send_chunk != NULL)
FTrace_internal_send_chunk(c);
extern volatile int sending_flag;
 
struct timespec t;
t.tv_sec = 2;
t.tv_nsec = 0;
//cprintf("Chunk sending"); // Tool: DEBUG
while(chunk_sending) {
//cprintf("."); // Tool: DEBUG
nanosleep(&t,NULL);
}
//cprintf("\n"); // Tool: DEBUG
FTrace_OSD_create_udp_task(c);
 
while(sending_flag);
 
return 0;
 
}
 
int FTrace_OSD_chunk_dump(FTrace_Chunk_Ptr c)
/shark/trunk/tracer/include/FTrace_disk.h
File deleted
Property changes:
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: include/FTrace.h
===================================================================
--- include/FTrace.h (revision 1027)
+++ include/FTrace.h (revision 927)
@@ -14,9 +14,6 @@
// the high 4 bits indicate the type of event in the class.
// (This allows an easy mechanisms for filtering events)
-/* Tool : used for the filter masking*/
-#define FTrace_family_mask 0x0F
-
// general trace events
#define FTrace_EVT_empty 0x00
#define FTrace_EVT_cycles_per_msec 0x10 // Par1 [empty] Par2 [clk/msec]
@@ -98,7 +95,7 @@
#define FTrace_EVT_user_event_12 0xC9
#define FTrace_EVT_user_event_13 0xD9
#define FTrace_EVT_user_event_14 0xE9
-//#define FTrace_EVT_user_event_15 0xF9 // Tool: removed
+#define FTrace_EVT_user_event_15 0xF9
// Timer Events
#define FTrace_EVT_timer_post 0x0B // Par 1 [empty] Par2 [empty]
/shark/trunk/tracer/makefile
17,7 → 17,7
 
ifeq ($(findstring NEW,$(TRACER)) , NEW)
OBJS = newtrace/FTrace.o newtrace/FTrace_OSD.o newtrace/FTrace_OSD_ll.o\
newtrace/FTrace_udp.o newtrace/FTrace_disk.o
newtrace/FTrace_udp.o
CFG_OPT += -D__NEW_TRACER__
endif
ifeq ($(findstring OLD,$(TRACER)) , OLD)