2 * Copyright (C) 2005,2006 Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca)
4 * This contains the core definitions for the Linux Trace Toolkit.
11 #include "kernelcompat.h"
12 //ust// #include <linux/percpu.h>
14 /* ltt's root dir in debugfs */
15 #define LTT_ROOT "ltt"
18 * All modifications of ltt_traces must be done by ltt-tracer.c, while holding
19 * the semaphore. Only reading of this information can be done elsewhere, with
20 * the RCU mechanism : the preemption must be disabled while reading the
24 struct list_head setup_head
; /* Pre-allocated traces list */
25 struct list_head head
; /* Allocated Traces list */
26 unsigned int num_active_traces
; /* Number of active traces */
27 } ____cacheline_aligned
;
29 extern struct ltt_traces ltt_traces
;
32 * get dentry of ltt's root dir
34 struct dentry
*get_ltt_root(void);
36 /* Keep track of trap nesting inside LTT */
37 //ust// DECLARE_PER_CPU(unsigned int, ltt_nesting);
39 typedef int (*ltt_run_filter_functor
)(void *trace
, uint16_t eID
);
41 extern ltt_run_filter_functor ltt_run_filter
;
43 extern void ltt_filter_register(ltt_run_filter_functor func
);
44 extern void ltt_filter_unregister(void);
46 #if defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT)
49 * Calculate the offset needed to align the type.
50 * size_of_type must be non-zero.
52 static inline unsigned int ltt_align(size_t align_drift
, size_t size_of_type
)
54 size_t alignment
= min(sizeof(void *), size_of_type
);
55 return (alignment
- align_drift
) & (alignment
- 1);
57 /* Default arch alignment */
60 static inline int ltt_get_alignment(void)
62 return sizeof(void *);
67 static inline unsigned int ltt_align(size_t align_drift
,
73 #define LTT_ALIGN __attribute__((packed))
75 static inline int ltt_get_alignment(void)
79 #endif /* defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT) */
81 #endif /* LTT_CORE_H */