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>
16 #include <sys/types.h>
19 #define __KERNEL__ /* Ugly hack : atomic.h is broken */
21 #include <asm/atomic.h>
22 #include "ltt/ltt-usertrace-ppc.h"
24 #undef __KERNEL__ /* Ugly hack : atomic.h is broken */
28 #define min(a,b) ((a)<(b)?(a):(b))
32 #define __NR_ltt_trace_generic 311
33 #define __NR_ltt_register_generic 312
35 #define NR_syscalls 313
39 #define __NR_ltt_trace_generic 283
40 #define __NR_ltt_register_generic 284
42 #define NR_syscalls 285
45 //FIXME : setup for ARM
46 //FIXME : setup for MIPS
49 // Put in bits/syscall.h
50 #define SYS_ltt_trace_generic __NR_ltt_trace_generic
51 #define SYS_ltt_register_generic __NR_ltt_register_generic
54 #define FACNAME_LEN 32
56 /* LTT userspace tracing is non blocking by default when buffers are full */
58 #define LTT_BLOCKING 0
61 typedef unsigned int ltt_facility_t
;
63 struct user_facility_info
{
64 char name
[FACNAME_LEN
];
65 unsigned int num_events
;
74 static inline __attribute__((no_instrument_function
))
75 _syscall5(int, ltt_trace_generic
, unsigned int, facility_id
,
76 unsigned int, event_id
, void *, data
, size_t, data_size
, int, blocking
)
77 static inline __attribute__((no_instrument_function
))
78 _syscall2(int, ltt_register_generic
, unsigned int *, facility_id
,
79 const struct user_facility_info
*, info
)
82 /* Calculate the offset needed to align the type */
83 static inline unsigned int __attribute__((no_instrument_function
))
84 ltt_align(size_t align_drift
,
87 size_t alignment
= min(sizeof(void*), size_of_type
);
89 return ((alignment
- align_drift
) & (alignment
-1));
93 static inline unsigned int __attribute__((no_instrument_function
))
94 ltt_align(size_t align_drift
,
99 #define LTT_ALIGN __attribute__((packed))
102 #ifdef LTT_TRACE_FAST
103 #include <ltt/ltt-usertrace-fast.h>
104 #endif //LTT_TRACE_FAST
106 #endif //_LTT_USERTRACE_H
This page took 0.03065 seconds and 4 git commands to generate.