1 /*****************************************************************************
4 * LTT userspace tracing header
6 * Mathieu Desnoyers, March 2006
9 #ifndef _LTT_USERTRACE_H
10 #define _LTT_USERTRACE_H
16 #include <sys/types.h>
17 #include <linux/unistd.h>
20 #define min(a,b) ((a)<(b)?(a):(b))
24 #define __NR_ltt_trace_generic 311
25 #define __NR_ltt_register_generic 312
27 #define NR_syscalls 313
31 #define __NR_ltt_trace_generic 283
32 #define __NR_ltt_register_generic 284
34 #define NR_syscalls 285
37 //FIXME : setup for ARM
38 //FIXME : setup for MIPS
41 // Put in bits/syscall.h
42 #define SYS_ltt_trace_generic __NR_ltt_trace_generic
43 #define SYS_ltt_register_generic __NR_ltt_register_generic
46 #define FACNAME_LEN 32
48 /* LTT userspace tracing is non blocking by default when buffers are full */
50 #define LTT_BLOCKING 0
53 typedef unsigned int ltt_facility_t
;
55 struct user_facility_info
{
56 char name
[FACNAME_LEN
];
57 unsigned int num_events
;
66 static inline __attribute__((no_instrument_function
))
67 _syscall5(int, ltt_trace_generic
, unsigned int, facility_id
,
68 unsigned int, event_id
, void *, data
, size_t, data_size
, int, blocking
)
69 static inline __attribute__((no_instrument_function
))
70 _syscall2(int, ltt_register_generic
, unsigned int *, facility_id
,
71 const struct user_facility_info
*, info
)
74 /* Calculate the offset needed to align the type */
75 static inline unsigned int __attribute__((no_instrument_function
))
76 ltt_align(size_t align_drift
,
79 size_t alignment
= min(sizeof(void*), size_of_type
);
81 return ((alignment
- align_drift
) & (alignment
-1));
85 static inline unsigned int __attribute__((no_instrument_function
))
86 ltt_align(size_t align_drift
,
91 #define LTT_ALIGN __attribute__((packed))
95 #include <ltt/ltt-usertrace-fast.h>
96 #endif //LTT_TRACE_FAST
98 #endif //_LTT_USERTRACE_H
This page took 0.033312 seconds and 5 git commands to generate.