update compat
[lttv.git] / tags / LinuxTraceToolkitViewer-0.10.0-pre-115102007 / ltt / convert-old / LinuxEvents.h
CommitLineData
0bc7c2cd 1/*
2 * LinuxEvents.h
3 *
4 * Copyright (C) 2000, 2001, 2002 Karim Yaghmour (karym@opersys.com).
5 *
6 * This header is distributed under GPL.
7 *
8 * Linux events being traced.
9 *
10 * History :
11 * K.Y., 31/05/1999, Initial typing.
12 *
13 */
14
15#ifndef __TRACE_TOOLKIT_LINUX_HEADER__
16#define __TRACE_TOOLKIT_LINUX_HEADER__
17
18#include "LTTTypes.h"
19
20/* Traced events */
21#define TRACE_START 0 /* This is to mark the trace's start */
22#define TRACE_SYSCALL_ENTRY 1 /* Entry in a given system call */
23#define TRACE_SYSCALL_EXIT 2 /* Exit from a given system call */
24#define TRACE_TRAP_ENTRY 3 /* Entry in a trap */
25#define TRACE_TRAP_EXIT 4 /* Exit from a trap */
26#define TRACE_IRQ_ENTRY 5 /* Entry in an irq */
27#define TRACE_IRQ_EXIT 6 /* Exit from an irq */
28#define TRACE_SCHEDCHANGE 7 /* Scheduling change */
29#define TRACE_KERNEL_TIMER 8 /* The kernel timer routine has been called */
30#define TRACE_SOFT_IRQ 9 /* Hit key part of soft-irq management */
31#define TRACE_PROCESS 10 /* Hit key part of process management */
32#define TRACE_FILE_SYSTEM 11 /* Hit key part of file system */
33#define TRACE_TIMER 12 /* Hit key part of timer management */
34#define TRACE_MEMORY 13 /* Hit key part of memory management */
35#define TRACE_SOCKET 14 /* Hit key part of socket communication */
36#define TRACE_IPC 15 /* Hit key part of inter-process communication */
37#define TRACE_NETWORK 16 /* Hit key part of network communication */
38
39#define TRACE_BUFFER_START 17 /* Mark the begining of a trace buffer */
40#define TRACE_BUFFER_END 18 /* Mark the ending of a trace buffer */
41#define TRACE_NEW_EVENT 19 /* New event type */
42#define TRACE_CUSTOM 20 /* Custom event */
43
44#define TRACE_CHANGE_MASK 21 /* Change in event mask */
45#define TRACE_HEARTBEAT 22 /* Heartbeat event */
46
47/* Number of traced events */
48#define TRACE_MAX TRACE_HEARTBEAT
49
50/* Architecture types */
51#define TRACE_ARCH_TYPE_I386 1 /* i386 system */
52#define TRACE_ARCH_TYPE_PPC 2 /* PPC system */
53#define TRACE_ARCH_TYPE_SH 3 /* SH system */
54#define TRACE_ARCH_TYPE_S390 4 /* S/390 system */
55#define TRACE_ARCH_TYPE_MIPS 5 /* MIPS system */
56#define TRACE_ARCH_TYPE_ARM 6 /* ARM system */
57
58/* Standard definitions for variants */
59#define TRACE_ARCH_VARIANT_NONE 0 /* Main architecture implementation */
60
61/* PowerPC variants */
62#define TRACE_ARCH_VARIANT_PPC_4xx 1 /* 4xx systems (IBM embedded series) */
63#define TRACE_ARCH_VARIANT_PPC_6xx 2 /* 6xx/7xx/74xx/8260/POWER3 systems (desktop flavor) */
64#define TRACE_ARCH_VARIANT_PPC_8xx 3 /* 8xx system (Motoral embedded series) */
65#define TRACE_ARCH_VARIANT_PPC_ISERIES 4 /* 8xx system (iSeries) */
66
67/* System types */
68#define TRACE_SYS_TYPE_VANILLA_LINUX 1 /* Vanilla linux kernel */
69#define TRACE_SYS_TYPE_RTAI_LINUX 2 /* RTAI patched linux kernel */
70
71/* The information logged when the tracing is started */
72#define TRACER_MAGIC_NUMBER 0x00D6B7ED /* That day marks an important historical event ... */
73#define TRACER_SUP_VERSION_MAJOR 2 /* Major version number */
74
75/* Minimum information contained in any trace start event */
76typedef struct _trace_start_any
77{
78 uint32_t MagicNumber; /* Magic number to identify a trace */
79 uint32_t ArchType; /* Type of architecture */
80 uint32_t ArchVariant; /* Variant of the given type of architecture */
81 uint32_t SystemType; /* Operating system type */
82 uint8_t MajorVersion; /* Major version of trace */
83 uint8_t MinorVersion; /* Minor version of trace */
84
85} LTT_PACKED_STRUCT trace_start_any;
86
87typedef struct _trace_start_2_2
88{
89 uint32_t MagicNumber; /* Magic number to identify a trace */
90 uint32_t ArchType; /* Type of architecture */
91 uint32_t ArchVariant; /* Variant of the given type of architecture */
92 uint32_t SystemType; /* Operating system type */
93 uint8_t MajorVersion; /* Major version of trace */
94 uint8_t MinorVersion; /* Minor version of trace */
95
96 uint32_t BufferSize; /* Size of buffers */
97 trace_event_mask EventMask; /* The event mask */
98 trace_event_mask DetailsMask; /* Are the event details logged */
99 uint8_t LogCPUID; /* Is the CPUID logged */
100 uint8_t UseTSC; /* Are we using TSCs or time deltas */
101
102} LTT_PACKED_STRUCT trace_start_2_2;
103
104typedef struct _trace_start_2_3
105{
106 uint32_t MagicNumber; /* Magic number to identify a trace */
107 uint32_t ArchType; /* Type of architecture */
108 uint32_t ArchVariant; /* Variant of the given type of architecture */
109 uint32_t SystemType; /* Operating system type */
110 uint8_t MajorVersion; /* Major version of trace */
111 uint8_t MinorVersion; /* Minor version of trace */
112
113 uint32_t BufferSize; /* Size of buffers */
114 trace_event_mask EventMask; /* The event mask */
115 trace_event_mask DetailsMask; /* Are the event details logged */
116 uint8_t LogCPUID; /* Is the CPUID logged */
117 uint8_t UseTSC; /* Are we using TSCs or time deltas */
118
119 uint8_t FlightRecorder; /* Is this a flight recorder trace ? */
120} LTT_PACKED_STRUCT trace_start_2_3;
121
122/* TRACE_SYSCALL_ENTRY */
123typedef struct _trace_syscall_entry
124{
125 uint8_t syscall_id; /* Syscall entry number in entry.S */
126 uint32_t address; /* Address from which call was made */
127} LTT_PACKED_STRUCT trace_syscall_entry;
128#define SYSCALL_EVENT(X) ((trace_syscall_entry*)X)
129
130/* TRACE_TRAP_ENTRY */
131typedef struct _trace_trap_entry
132{
133 uint16_t trap_id; /* Trap number */
134 uint32_t address; /* Address where trap occured */
135} LTT_PACKED_STRUCT trace_trap_entry;
136typedef struct _trace_trap_entry_s390
137{
138 uint64_t trap_id; /* Trap number */
139 uint32_t address; /* Address where trap occured */
140} LTT_PACKED_STRUCT trace_trap_entry_s390;
141#define TRAP_EVENT(X) ((trace_trap_entry*)X)
142#define TRAP_EVENT_S390(X) ((trace_trap_entry_s390*)X)
143
144/* TRACE_IRQ_ENTRY */
145typedef struct _trace_irq_entry
146{
147 uint8_t irq_id; /* IRQ number */
148 uint8_t kernel; /* Are we executing kernel code */
149} LTT_PACKED_STRUCT trace_irq_entry;
150#define IRQ_EVENT(X) ((trace_irq_entry*)X)
151
152/* TRACE_SCHEDCHANGE */
153typedef struct _trace_schedchange
154{
155 uint32_t out; /* Outgoing process */
156 uint32_t in; /* Incoming process */
157 uint32_t out_state; /* Outgoing process' state */
158} LTT_PACKED_STRUCT trace_schedchange;
159#define SCHED_EVENT(X) ((trace_schedchange*)X)
160
161/* TRACE_SOFT_IRQ */
162#define TRACE_SOFT_IRQ_BOTTOM_HALF 1 /* Conventional bottom-half */
163#define TRACE_SOFT_IRQ_SOFT_IRQ 2 /* Real soft-irq */
164#define TRACE_SOFT_IRQ_TASKLET_ACTION 3 /* Tasklet action */
165#define TRACE_SOFT_IRQ_TASKLET_HI_ACTION 4 /* Tasklet hi-action */
166typedef struct _trace_soft_irq
167{
168 uint8_t event_sub_id; /* Soft-irq event Id */
169 uint32_t event_data; /* Data associated with event */
170} LTT_PACKED_STRUCT trace_soft_irq;
171#define SOFT_IRQ_EVENT(X) ((trace_soft_irq*)X)
172
173/* TRACE_PROCESS */
174#define TRACE_PROCESS_KTHREAD 1 /* Creation of a kernel thread */
175#define TRACE_PROCESS_FORK 2 /* A fork or clone occured */
176#define TRACE_PROCESS_EXIT 3 /* An exit occured */
177#define TRACE_PROCESS_WAIT 4 /* A wait occured */
178#define TRACE_PROCESS_SIGNAL 5 /* A signal has been sent */
179#define TRACE_PROCESS_WAKEUP 6 /* Wake up a process */
180#define TRACE_PROCESS_RELEASE 7 /* A task struct has been released */
181
182typedef struct _trace_process
183{
184 uint8_t event_sub_id; /* Process event ID */
185 uint32_t event_data1; /* Data associated with event */
186 uint32_t event_data2;
187} LTT_PACKED_STRUCT trace_process;
188#define PROC_EVENT(X) ((trace_process*)X)
189
190/* TRACE_FILE_SYSTEM */
191#define TRACE_FILE_SYSTEM_BUF_WAIT_START 1 /* Starting to wait for a data buffer */
192#define TRACE_FILE_SYSTEM_BUF_WAIT_END 2 /* End to wait for a data buffer */
193#define TRACE_FILE_SYSTEM_EXEC 3 /* An exec occured */
194#define TRACE_FILE_SYSTEM_OPEN 4 /* An open occured */
195#define TRACE_FILE_SYSTEM_CLOSE 5 /* A close occured */
196#define TRACE_FILE_SYSTEM_READ 6 /* A read occured */
197#define TRACE_FILE_SYSTEM_WRITE 7 /* A write occured */
198#define TRACE_FILE_SYSTEM_SEEK 8 /* A seek occured */
199#define TRACE_FILE_SYSTEM_IOCTL 9 /* An ioctl occured */
200#define TRACE_FILE_SYSTEM_SELECT 10 /* A select occured */
201#define TRACE_FILE_SYSTEM_POLL 11 /* A poll occured */
202typedef struct _trace_file_system
203{
204 uint8_t event_sub_id; /* File system event ID */
205 uint32_t event_data1; /* Event data */
206 uint32_t event_data2; /* Event data 2 */
207 char* file_name; /* Name of file operated on */
208} LTT_PACKED_STRUCT trace_file_system;
209#define FS_EVENT(X) ((trace_file_system*)X)
210#define FS_EVENT_FILENAME(X) ((char*) ((X) + sizeof(trace_file_system)))
211
212/* TRACE_TIMER */
213#define TRACE_TIMER_EXPIRED 1 /* Timer expired */
214#define TRACE_TIMER_SETITIMER 2 /* Setting itimer occurred */
215#define TRACE_TIMER_SETTIMEOUT 3 /* Setting sched timeout occurred */
216typedef struct _trace_timer
217{
218 uint8_t event_sub_id; /* Timer event ID */
219 uint8_t event_sdata; /* Short data */
220 uint32_t event_data1; /* Data associated with event */
221 uint32_t event_data2;
222} LTT_PACKED_STRUCT trace_timer;
223#define TIMER_EVENT(X) ((trace_timer*)X)
224
225/* TRACE_MEMORY */
226#define TRACE_MEMORY_PAGE_ALLOC 1 /* Allocating pages */
227#define TRACE_MEMORY_PAGE_FREE 2 /* Freing pages */
228#define TRACE_MEMORY_SWAP_IN 3 /* Swaping pages in */
229#define TRACE_MEMORY_SWAP_OUT 4 /* Swaping pages out */
230#define TRACE_MEMORY_PAGE_WAIT_START 5 /* Start to wait for page */
231#define TRACE_MEMORY_PAGE_WAIT_END 6 /* End to wait for page */
232typedef struct _trace_memory
233{
234 uint8_t event_sub_id; /* Memory event ID */
235 unsigned long event_data; /* Data associated with event */
236} LTT_PACKED_STRUCT trace_memory;
237#define MEM_EVENT(X) ((trace_memory*)X)
238
239/* TRACE_SOCKET */
240#define TRACE_SOCKET_CALL 1 /* A socket call occured */
241#define TRACE_SOCKET_CREATE 2 /* A socket has been created */
242#define TRACE_SOCKET_SEND 3 /* Data was sent to a socket */
243#define TRACE_SOCKET_RECEIVE 4 /* Data was read from a socket */
244typedef struct _trace_socket
245{
246 uint8_t event_sub_id; /* Socket event ID */
247 uint32_t event_data1; /* Data associated with event */
248 uint32_t event_data2; /* Data associated with event */
249} LTT_PACKED_STRUCT trace_socket;
250#define SOCKET_EVENT(X) ((trace_socket*)X)
251
252/* TRACE_IPC */
253#define TRACE_IPC_CALL 1 /* A System V IPC call occured */
254#define TRACE_IPC_MSG_CREATE 2 /* A message queue has been created */
255#define TRACE_IPC_SEM_CREATE 3 /* A semaphore was created */
256#define TRACE_IPC_SHM_CREATE 4 /* A shared memory segment has been created */
257typedef struct _trace_ipc
258{
259 uint8_t event_sub_id; /* IPC event ID */
260 uint32_t event_data1; /* Data associated with event */
261 uint32_t event_data2; /* Data associated with event */
262} LTT_PACKED_STRUCT trace_ipc;
263#define IPC_EVENT(X) ((trace_ipc*)X)
264
265/* TRACE_NETWORK */
266#define TRACE_NETWORK_PACKET_IN 1 /* A packet came in */
267#define TRACE_NETWORK_PACKET_OUT 2 /* A packet was sent */
268typedef struct _trace_network
269{
270 uint8_t event_sub_id; /* Network event ID */
271 uint32_t event_data; /* Event data */
272} LTT_PACKED_STRUCT trace_network;
273#define NET_EVENT(X) ((trace_network*)X)
274
275/* Start of trace buffer information */
276typedef struct _trace_buffer_start
277{
278 struct timeval Time; /* Time stamp of this buffer */
279 uint32_t TSC; /* TSC of this buffer, if applicable */
280 uint32_t ID; /* Unique buffer ID */
281} LTT_PACKED_STRUCT trace_buffer_start;
282
283/* End of trace buffer information */
284typedef struct _trace_buffer_end
285{
286 struct timeval Time; /* Time stamp of this buffer */
287 uint32_t TSC; /* TSC of this buffer, if applicable */
288} LTT_PACKED_STRUCT trace_buffer_end;
289
290/* Maximal size a custom event can have */
291#define CUSTOM_EVENT_MAX_SIZE 8192
292
293/* String length limits for custom events creation */
294#define CUSTOM_EVENT_TYPE_STR_LEN 20
295#define CUSTOM_EVENT_DESC_STR_LEN 100
296#define CUSTOM_EVENT_FORM_STR_LEN 256
297
298/* Type of custom event formats */
299#define CUSTOM_EVENT_FORMAT_TYPE_NONE 0
300#define CUSTOM_EVENT_FORMAT_TYPE_STR 1
301#define CUSTOM_EVENT_FORMAT_TYPE_HEX 2
302#define CUSTOM_EVENT_FORMAT_TYPE_XML 3
303#define CUSTOM_EVENT_FORMAT_TYPE_IBM 4
304
305typedef struct _trace_new_event
306{
307 /* Basics */
308 uint32_t id; /* Custom event ID */
309 char type[CUSTOM_EVENT_TYPE_STR_LEN]; /* Event type description */
310 char desc[CUSTOM_EVENT_DESC_STR_LEN]; /* Detailed event description */
311
312 /* Custom formatting */
313 uint32_t format_type; /* Type of formatting */
314 char form[CUSTOM_EVENT_FORM_STR_LEN]; /* Data specific to format */
315} LTT_PACKED_STRUCT trace_new_event;
316#define NEW_EVENT(X) ((trace_new_event*) X)
317
318typedef struct _trace_custom
319{
320 uint32_t id; /* Event ID */
321 uint32_t data_size; /* Size of data recorded by event */
322 void* data; /* Data recorded by event */
323} LTT_PACKED_STRUCT trace_custom;
324#define CUSTOM_EVENT(X) ((trace_custom*) X)
325
326/* TRACE_CHANGE_MASK */
327typedef struct _trace_change_mask
328{
329 trace_event_mask mask; /* Event mask */
330} LTT_PACKED_STRUCT trace_change_mask;
331#define CHMASK_EVENT(X) ((trace_change_mask*) X)
332
333#endif /* __TRACE_TOOLKIT_LINUX_HEADER__ */
This page took 0.039084 seconds and 4 git commands to generate.