2 * Copyright (C) 2005,2006 Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca)
4 * This contains the core definitions for the Linux Trace Toolkit.
10 #include "kernelcompat.h"
11 //ust// #include <linux/percpu.h>
13 /* ltt's root dir in debugfs */
14 #define LTT_ROOT "ltt"
17 * All modifications of ltt_traces must be done by ltt-tracer.c, while holding
18 * the semaphore. Only reading of this information can be done elsewhere, with
19 * the RCU mechanism : the preemption must be disabled while reading the
23 struct list_head setup_head
; /* Pre-allocated traces list */
24 struct list_head head
; /* Allocated Traces list */
25 unsigned int num_active_traces
; /* Number of active traces */
26 } ____cacheline_aligned
;
28 extern struct ltt_traces ltt_traces
;
31 * get dentry of ltt's root dir
33 struct dentry
*get_ltt_root(void);
35 /* Keep track of trap nesting inside LTT */
36 //ust// DECLARE_PER_CPU(unsigned int, ltt_nesting);
37 extern unsigned int ltt_nesting
;
39 typedef int (*ltt_run_filter_functor
)(void *trace
, uint16_t eID
);
40 //typedef int (*ltt_run_filter_functor)(void *, __u16);
42 extern ltt_run_filter_functor ltt_run_filter
;
44 extern void ltt_filter_register(ltt_run_filter_functor func
);
45 extern void ltt_filter_unregister(void);
47 #if defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT)
50 * Calculate the offset needed to align the type.
51 * size_of_type must be non-zero.
53 static inline unsigned int ltt_align(size_t align_drift
, size_t size_of_type
)
55 size_t alignment
= min(sizeof(void *), size_of_type
);
56 return (alignment
- align_drift
) & (alignment
- 1);
58 /* Default arch alignment */
61 static inline int ltt_get_alignment(void)
63 return sizeof(void *);
68 static inline unsigned int ltt_align(size_t align_drift
,
74 #define LTT_ALIGN __attribute__((packed))
76 static inline int ltt_get_alignment(void)
80 #endif /* defined(CONFIG_LTT) && defined(CONFIG_LTT_ALIGNMENT) */
82 #endif /* LTT_CORE_H */