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 #define min(a,b) ((a)<(b)?(a):(b))
24 //Put in asm-i486/unistd.h
25 #define __NR_ltt_trace_generic 294
26 #define __NR_ltt_register_generic 295
29 #define NR_syscalls 296
31 //FIXME : setup for ARM
32 //FIXME : setup for MIPS
35 // Put in bits/syscall.h
36 #define SYS_ltt_trace_generic __NR_ltt_trace_generic
37 #define SYS_ltt_register_generic __NR_ltt_register_generic
40 #define FACNAME_LEN 32
42 /* LTT userspace tracing is non blocking by default when buffers are full */
44 #define LTT_BLOCKING 0
47 typedef unsigned int ltt_facility_t
;
49 struct user_facility_info
{
50 char name
[FACNAME_LEN
];
51 unsigned int num_events
;
60 static inline __attribute__((no_instrument_function
))
61 _syscall5(int, ltt_trace_generic
, unsigned int, facility_id
,
62 unsigned int, event_id
, void *, data
, size_t, data_size
, int, blocking
)
63 static inline __attribute__((no_instrument_function
))
64 _syscall2(int, ltt_register_generic
, unsigned int *, facility_id
,
65 const struct user_facility_info
*, info
)
68 /* Calculate the offset needed to align the type */
69 static inline unsigned int __attribute__((no_instrument_function
))
70 ltt_align(size_t align_drift
,
73 size_t alignment
= min(sizeof(void*), size_of_type
);
75 return ((alignment
- align_drift
) & (alignment
-1));
79 static inline unsigned int __attribute__((no_instrument_function
))
80 ltt_align(size_t align_drift
,
85 #define LTT_ALIGN __attribute__((packed))
89 #include <ltt/ltt-usertrace-fast.h>
90 #endif //LTT_TRACE_FAST
92 #endif //_LTT_USERTRACE_H
This page took 0.030562 seconds and 4 git commands to generate.