Subversion Repositories shark

Rev

Rev 710 | Rev 1063 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 * Project: S.Ha.R.K.
 *
 * Coordinators:
 *   Giorgio Buttazzo    <giorgio@sssup.it>
 *   Paolo Gai           <pj@gandalf.sssup.it>
 *
 * Authors     :
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
 *
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
 *
 * http://www.sssup.it
 * http://retis.sssup.it
 * http://shark.sssup.it
 */


#ifndef __TRACER_H__
#define __TRACER_H__

#ifdef __OLD_TRACER__

#include <ll/sys/types.h>
#include "types.h"
#include "trace.h"
#include "FTrace.h"

#define TRACER_LOGEVENT oldtrace

extern int (*trc_register_eventclass)
     (int class,int num,int(*func)(trc_event_t *, int event, void *ptr));

extern void (*trc_logevent)(int event, void *ptr);

extern int (*trc_resume)(void);
extern int (*trc_suspend)(void);

#define NOT_DEFINED 0xFF

extern __inline__ void oldtrace(WORD type, WORD par1, DWORD par2)
{

  static int oldtype;
  static int oldpar;
  extern BYTE conv[256]; // Conversion table: ctable.c
  BYTE ttype = 0;
 
  ttype = type & 0x000F;
  type = (type >> 4) & 0x000F;
  type |= (ttype << 4);

  oldtype = conv[type];

  oldpar = par1;

  if (oldtype != NOT_DEFINED) trc_logevent(oldtype,&oldpar);

}


#else
#ifdef __NEW_TRACER__

#include <ll/sys/types.h>
#include <ll/i386/hw-instr.h>
#include "FTrace.h"
#include "FTrace_chunk.h"
#include "FTrace_OSD.h"
#include "FTrace_udp.h"

#define TRACER_NO_OUTPUT  0x00
#define TRACER_UDP_OUTPUT 0x01

#define TRACER_LOGEVENT FTrace_safe_ipoint
#define FAST_TRACER_LOGEVENT FTrace_unsafe_ipoint

void FTrace_unsafe_ipoint(WORD type, WORD par1, DWORD par2);
void FTrace_safe_ipoint(WORD type, WORD par1, DWORD par2);

#else

#include "FTrace.h"

#define TRACER_LOGEVENT(a,b,c)

#endif

#endif

#endif