90729c679f6e964fc2f1208d18e9046b14b0bfc4
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>
18 #if defined(__powerpc__) || defined(__powerpc64__)
19 #include "ltt/ltt-usertrace-ppc.h"
21 #include <asm/atomic.h>
25 #define min(a,b) ((a)<(b)?(a):(b))
29 #define __NR_ltt_trace_generic 311
30 #define __NR_ltt_register_generic 312
32 #define NR_syscalls 313
36 #define __NR_ltt_trace_generic 283
37 #define __NR_ltt_register_generic 284
39 #define NR_syscalls 285
42 //FIXME : setup for ARM
43 //FIXME : setup for MIPS
46 // Put in bits/syscall.h
47 #define SYS_ltt_trace_generic __NR_ltt_trace_generic
48 #define SYS_ltt_register_generic __NR_ltt_register_generic
51 #define FACNAME_LEN 32
53 /* LTT userspace tracing is non blocking by default when buffers are full */
55 #define LTT_BLOCKING 0
58 typedef unsigned int ltt_facility_t
;
60 struct user_facility_info
{
61 char name
[FACNAME_LEN
];
62 unsigned int num_events
;
71 static inline __attribute__((no_instrument_function
))
72 _syscall5(int, ltt_trace_generic
, unsigned int, facility_id
,
73 unsigned int, event_id
, void *, data
, size_t, data_size
, int, blocking
)
74 static inline __attribute__((no_instrument_function
))
75 _syscall2(int, ltt_register_generic
, unsigned int *, facility_id
,
76 const struct user_facility_info
*, info
)
79 /* Calculate the offset needed to align the type */
80 static inline unsigned int __attribute__((no_instrument_function
))
81 ltt_align(size_t align_drift
,
84 size_t alignment
= min(sizeof(void*), size_of_type
);
86 return ((alignment
- align_drift
) & (alignment
-1));
90 static inline unsigned int __attribute__((no_instrument_function
))
91 ltt_align(size_t align_drift
,
96 #define LTT_ALIGN __attribute__((packed))
100 #include <ltt/ltt-usertrace-fast.h>
101 #endif //LTT_TRACE_FAST
103 #endif //_LTT_USERTRACE_H
This page took 0.054393 seconds and 4 git commands to generate.