Subversion Repositories shark

Rev

Rev 527 | Rev 907 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
352 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Giacomo Guidi       <giacomo@gandalf.sssup.it>
10
 *
11
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
12
 *
13
 * http://www.sssup.it
14
 * http://retis.sssup.it
15
 * http://shark.sssup.it
16
 */
17
 
18
#ifndef __TRACER_H__
19
#define __TRACER_H__
20
 
21
#ifdef __OLD_TRACER__
22
 
23
#include <ll/sys/types.h>
24
#include "types.h"
25
#include "trace.h"
355 giacomo 26
#include "FTrace.h"
352 giacomo 27
 
28
#define TRACER_LOGEVENT oldtrace
29
 
30
extern int (*trc_register_eventclass)
31
     (int class,int num,int(*func)(trc_event_t *, int event, void *ptr));
32
 
33
extern void (*trc_logevent)(int event, void *ptr);
34
 
35
extern int (*trc_resume)(void);
36
extern int (*trc_suspend)(void);
37
 
38
#define NOT_DEFINED 0xFF
39
 
710 giacomo 40
extern __inline__ void oldtrace(WORD type, WORD par1, DWORD par2)
352 giacomo 41
{
42
 
43
  static int oldtype;
44
  static int oldpar;
45
  extern BYTE conv[256]; // Conversion table: ctable.c
46
  BYTE ttype = 0;
47
 
710 giacomo 48
  ttype = type & 0x000F;
49
  type = (type >> 4) & 0x000F;
352 giacomo 50
  type |= (ttype << 4);
51
 
52
  oldtype = conv[type];
53
 
710 giacomo 54
  oldpar = par1;
55
 
352 giacomo 56
  if (oldtype != NOT_DEFINED) trc_logevent(oldtype,&oldpar);
57
 
58
}
59
 
60
 
61
#else
62
#ifdef __NEW_TRACER__
63
 
64
#include <ll/sys/types.h>
65
#include <ll/i386/hw-instr.h>
66
#include "FTrace.h"
497 giacomo 67
#include "FTrace_chunk.h"
68
#include "FTrace_OSD.h"
352 giacomo 69
 
497 giacomo 70
#define TRACER_NO_OUTPUT  0x00
71
#define TRACER_UDP_OUTPUT 0x01
364 giacomo 72
 
497 giacomo 73
#define TRACER_LOGEVENT FTrace_safe_ipoint
74
#define FAST_TRACER_LOGEVENT FTrace_unsafe_ipoint
352 giacomo 75
 
502 giacomo 76
void FTrace_unsafe_ipoint(WORD type, WORD par1, DWORD par2);
77
void FTrace_safe_ipoint(WORD type, WORD par1, DWORD par2);
362 giacomo 78
 
352 giacomo 79
#else
80
 
399 giacomo 81
#include "FTrace.h"
82
 
527 giacomo 83
#define TRACER_LOGEVENT(a,b,c)
352 giacomo 84
 
85
#endif
86
 
87
#endif
88
 
89
#endif