Subversion Repositories shark

Rev

Rev 399 | Rev 502 | 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
 
40
extern __inline__ void oldtrace(BYTE type, BYTE flag, DWORD par1, DWORD par2)
41
{
42
 
43
  static int oldtype;
44
  static int oldpar;
45
  extern BYTE conv[256]; // Conversion table: ctable.c
46
  BYTE ttype = 0;
47
 
48
  ttype = type & 0x0F;
49
  type = type >> 4;
50
  type |= (ttype << 4);
51
 
52
  oldtype = conv[type];
53
 
54
  if (oldtype != NOT_DEFINED) trc_logevent(oldtype,&oldpar);
55
 
56
}
57
 
58
 
59
#else
60
#ifdef __NEW_TRACER__
61
 
62
#include <ll/sys/types.h>
63
#include <ll/i386/hw-instr.h>
64
#include "FTrace.h"
497 giacomo 65
#include "FTrace_chunk.h"
66
#include "FTrace_OSD.h"
352 giacomo 67
 
497 giacomo 68
#define TRACER_NO_OUTPUT  0x00
69
#define TRACER_UDP_OUTPUT 0x01
364 giacomo 70
 
497 giacomo 71
#define TRACER_LOGEVENT FTrace_safe_ipoint
72
#define FAST_TRACER_LOGEVENT FTrace_unsafe_ipoint
352 giacomo 73
 
497 giacomo 74
void FTrace_unsafe_ipoint(BYTE type, BYTE flags, DWORD par1, DWORD par2);
75
void FTrace_safe_ipoint(BYTE type, BYTE flags, DWORD par1, DWORD par2);
362 giacomo 76
 
352 giacomo 77
#else
78
 
399 giacomo 79
#include "FTrace.h"
80
 
352 giacomo 81
#define TRACER_LOGEVENT(a,b,c,d)
82
 
83
#endif
84
 
85
#endif
86
 
87
#endif