60a6aabc9682e5e098ef5991f79828ea4e942e25
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>
32 #elif defined(__x86_64__)
33 #include <asm/timex.h>
34 #include <asm/bitops.h>
35 #include <asm/atomic.h>
36 #include <asm/system.h>
38 #include <asm/timex.h>
39 #include <asm/atomic.h>
43 #define min(a,b) ((a)<(b)?(a):(b))
47 #define __NR_ltt_trace_generic 317
48 #define __NR_ltt_register_generic 318
50 #define NR_syscalls 319
54 #define __NR_ltt_trace_generic 279
55 #define __NR_ltt_register_generic 280
57 #define NR_syscalls 281
61 #define __NR_ltt_trace_generic 301
62 #define __NR_ltt_register_generic 302
64 #define NR_syscalls 303
68 #define __NR_ltt_trace_generic 301
69 #define __NR_ltt_register_generic 302
71 #define NR_syscalls 303
76 //FIXME : setup for ARM
77 //FIXME : setup for MIPS
80 // Put in bits/syscall.h
81 #define SYS_ltt_trace_generic __NR_ltt_trace_generic
82 #define SYS_ltt_register_generic __NR_ltt_register_generic
85 #define FACNAME_LEN 32
87 /* LTT userspace tracing is non blocking by default when buffers are full */
89 #define LTT_BLOCKING 0
92 typedef unsigned int ltt_facility_t
;
94 struct user_facility_info
{
95 char name
[FACNAME_LEN
];
96 unsigned int num_events
;
105 static inline __attribute__((no_instrument_function
))
106 _syscall5(int, ltt_trace_generic
, unsigned int, facility_id
,
107 unsigned int, event_id
, void *, data
, size_t, data_size
, int, blocking
)
108 static inline __attribute__((no_instrument_function
))
109 _syscall2(int, ltt_register_generic
, unsigned int *, facility_id
,
110 const struct user_facility_info
*, info
)
113 /* Calculate the offset needed to align the type */
114 static inline unsigned int __attribute__((no_instrument_function
))
115 ltt_align(size_t align_drift
,
118 size_t alignment
= min(sizeof(void*), size_of_type
);
120 return ((alignment
- align_drift
) & (alignment
-1));
124 static inline unsigned int __attribute__((no_instrument_function
))
125 ltt_align(size_t align_drift
,
130 #define LTT_ALIGN __attribute__((packed))
133 #ifdef LTT_TRACE_FAST
134 #include <ltt/ltt-usertrace-fast.h>
135 #endif //LTT_TRACE_FAST
137 #endif //_LTT_USERTRACE_H
This page took 0.066358 seconds and 4 git commands to generate.