dbd48c34a176fd6a61f0073c83c5cc309e356312
1 /*****************************************************************************
4 * LTT userspace tracing header
6 * Mathieu Desnoyers, March 2006
9 #ifndef _LTT_USERTRACE_H
10 #define _LTT_USERTRACE_H
14 #include <linux/unistd.h>
15 #include <asm/atomic.h>
17 #include <sys/types.h>
21 #include <ltt/ltt-usertrace-fast.h>
22 #endif //LTT_TRACE_FAST
25 #define min(a,b) ((a)<(b)?(a):(b))
28 //Put in asm-i486/unistd.h
29 #define __NR_ltt_trace_generic 294
30 #define __NR_ltt_register_generic 295
33 #define NR_syscalls 296
35 //FIXME : setup for ARM
36 //FIXME : setup for MIPS
39 // Put in bits/syscall.h
40 #define SYS_ltt_trace_generic __NR_ltt_trace_generic
41 #define SYS_ltt_register_generic __NR_ltt_register_generic
44 #define FACNAME_LEN 32
46 /* LTT userspace tracing is non blocking by default when buffers are full */
48 #define LTT_BLOCKING 0
51 typedef unsigned int ltt_facility_t
;
53 struct user_facility_info
{
54 char name
[FACNAME_LEN
];
55 unsigned int num_events
;
64 static inline __attribute__((no_instrument_function
))
65 _syscall5(int, ltt_trace_generic
, unsigned int, facility_id
,
66 unsigned int, event_id
, void *, data
, size_t, data_size
, int, blocking
)
67 static inline __attribute__((no_instrument_function
))
68 _syscall2(int, ltt_register_generic
, unsigned int *, facility_id
,
69 const struct user_facility_info
*, info
)
72 /* Calculate the offset needed to align the type */
73 static inline unsigned int __attribute__((no_instrument_function
))
74 ltt_align(size_t align_drift
,
77 size_t alignment
= min(sizeof(void*), size_of_type
);
79 return ((alignment
- align_drift
) & (alignment
-1));
83 static inline unsigned int __attribute__((no_instrument_function
))
84 ltt_align(size_t align_drift
,
89 #define LTT_ALIGN __attribute__((packed))
92 #endif //_LTT_USERTRACE_H
This page took 0.030109 seconds and 3 git commands to generate.