Subversion Repositories shark

Rev

Rev 352 | 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
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
/*
22
 * Copyright (C) 1999 Massimiliano Giorgi
23
 *
24
 * This program is free software; you can redistribute it and/or modify
25
 * it under the terms of the GNU General Public License as published by
26
 * the Free Software Foundation; either version 2 of the License, or
27
 * (at your option) any later version.
28
 *
29
 * This program is distributed in the hope that it will be useful,
30
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32
 * GNU General Public License for more details.
33
 *
34
 * You should have received a copy of the GNU General Public License
35
 * along with this program; if not, write to the Free Software
36
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
37
 *
38
 */
39
 
40
/*
41
 * CVS :        $Id: types.h,v 1.1 2003-12-10 16:48:47 giacomo Exp $
42
 *
43
 * File:        $File$
44
 * Revision:    $Revision: 1.1 $
45
 * Last update: $Date: 2003-12-10 16:48:47 $
46
 */
47
 
48
#ifndef __TRACE_TYPES_H
49
#define __TRACE_TYPES_H
50
 
51
/*
52
 * EVENTS
53
 */
54
 
55
/* tracer class */
56
#define TRC_RESERVED      0x00
57
#define TRC_HOOPS         0x01
58
 
59
/* system class */
60
#define TRC_CREATE        0x02
61
#define TRC_ACTIVATE      0x03
62
#define TRC_SCHEDULE      0x04
63
#define TRC_DELAY         0x05
64
#define TRC_SLEEP         0x06
65
#define TRC_ENDCYCLE      0x07
66
#define TRC_DESTROY       0x08
67
#define TRC_INTACTIVATION 0x09
68
#define TRC_DISABLE       0x0a
69
 
70
/* user class */
71
#define TRC_USER0         0x0b
72
#define TRC_USER1         0x0c 
73
#define TRC_USER2         0x0d
74
#define TRC_USER3         0x0e
75
#define TRC_USER4         0x0f
76
#define TRC_USER5         0x10
77
#define TRC_USER6         0x11
78
#define TRC_USER7         0x12
79
 
80
/* low level class */
81
#define TRC_INTR          0x13
82
 
83
/* semaphore class */
84
#define TRC_SEM_WAIT      0x14
85
#define TRC_SEM_WAITNB    0x15
86
#define TRC_SEM_SIGNAL    0x16
87
 
88
/* used internal by the tracer (the first event of a class) */
89
#define TRC_F_TRACER  TRC_RESERVED
90
#define TRC_F_SYSTEM  TRC_CREATE
91
#define TRC_F_USER    TRC_USER0
92
#define TRC_F_LL      TRC_INTR
93
#define TRC_F_SEM     TRC_SEM_WAIT
94
#define TRC_F_LAST    (TRC_SEM_SIGNAL+1)
95
 
96
/* classes */
97
#define TRC_CLASS_TRACER  0
98
#define TRC_CLASS_SYSTEM  1
99
#define TRC_CLASS_USER    2
100
#define TRC_CLASS_LL      3
101
#define TRC_CLASS_SEM     4
102
 
103
/* max values */
104
#define TRC_NUMCLASSES    5
105
#define TRC_NUMEVENTS     TRC_F_LAST
106
 
107
/*
108
 * STRUCTURES
109
 */
110
 
111
/* tracer class */
112
typedef struct TAGtrc_tracer_event_t {
113
  u_int32_t n;
114
} trc_tracer_event_t __attribute__ ((packed));
115
 
116
/* system class */
117
typedef struct TAGtrc_system_event_t {
118
  u_int16_t task;
119
} trc_system_event_t __attribute__ ((packed));
120
 
121
/* user class */
122
typedef struct TAGtrc_user_event_t {
123
#define TRC_MAXUSERINFO sizeof(long)
124
  long n;
125
} trc_user_event_t __attribute__ ((packed));
126
 
127
/* low level class */
128
typedef struct TAGtrc_ll_event_t {
129
  int n;
130
} trc_ll_event_t __attribute__ ((packed));
131
 
132
/* semaphore class */
133
typedef struct TAGtrc_sem_event_t {
134
  u_int16_t task;
135
  u_int16_t id;
136
} trc_sem_event_t __attribute__ ((packed));
137
 
138
/* generics event */
139
typedef union TAGtrc_allevents {
140
  trc_tracer_event_t trc;
141
  trc_system_event_t sys;
142
  trc_user_event_t   usr;
143
  trc_ll_event_t     ll;
144
  trc_sem_event_t    sem;
145
} trc_allevents_t __attribute__ ((packed));;
146
 
147
/* event struct */
148
typedef struct TAGtrc_event_t {
149
  u_int32_t       time;
150
  u_int16_t       event;
151
  trc_allevents_t x;
152
} trc_event_t __attribute__ ((packed));
153
 
154
 
155
#endif