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>
19 #define inline inline __attribute__((always_inline))
21 #if defined(__powerpc__) || defined(__powerpc64__)
23 #include <ltt/atomic-ppc64.h>
24 #include <ltt/system-ppc64.h>
25 #include <asm/timex.h>
27 #include <ltt/ppc_asm-ppc.h>
28 #include <ltt/atomic-ppc.h>
29 #include <ltt/system-ppc.h>
30 #include <ltt/timex-ppc.h>
33 #include <asm/timex.h>
34 #include <asm/atomic.h>
38 #define min(a,b) ((a)<(b)?(a):(b))
42 #define __NR_ltt_trace_generic 311
43 #define __NR_ltt_register_generic 312
45 #define NR_syscalls 313
49 #define __NR_ltt_trace_generic 283
50 #define __NR_ltt_register_generic 284
52 #define NR_syscalls 285
56 #define __NR_ltt_trace_generic 283
57 #define __NR_ltt_register_generic 284
59 #define NR_syscalls 285
64 //FIXME : setup for ARM
65 //FIXME : setup for MIPS
68 // Put in bits/syscall.h
69 #define SYS_ltt_trace_generic __NR_ltt_trace_generic
70 #define SYS_ltt_register_generic __NR_ltt_register_generic
73 #define FACNAME_LEN 32
75 /* LTT userspace tracing is non blocking by default when buffers are full */
77 #define LTT_BLOCKING 0
80 typedef unsigned int ltt_facility_t
;
82 struct user_facility_info
{
83 char name
[FACNAME_LEN
];
84 unsigned int num_events
;
93 static inline __attribute__((no_instrument_function
))
94 _syscall5(int, ltt_trace_generic
, unsigned int, facility_id
,
95 unsigned int, event_id
, void *, data
, size_t, data_size
, int, blocking
)
96 static inline __attribute__((no_instrument_function
))
97 _syscall2(int, ltt_register_generic
, unsigned int *, facility_id
,
98 const struct user_facility_info
*, info
)
101 /* Calculate the offset needed to align the type */
102 static inline unsigned int __attribute__((no_instrument_function
))
103 ltt_align(size_t align_drift
,
106 size_t alignment
= min(sizeof(void*), size_of_type
);
108 return ((alignment
- align_drift
) & (alignment
-1));
112 static inline unsigned int __attribute__((no_instrument_function
))
113 ltt_align(size_t align_drift
,
118 #define LTT_ALIGN __attribute__((packed))
121 #ifdef LTT_TRACE_FAST
122 #include <ltt/ltt-usertrace-fast.h>
123 #endif //LTT_TRACE_FAST
125 #endif //_LTT_USERTRACE_H
This page took 0.031163 seconds and 4 git commands to generate.