Commit | Line | Data |
---|---|---|
17baffe2 MD |
1 | #ifndef _LTT_TRACER_H |
2 | #define _LTT_TRACER_H | |
3 | ||
1c8284eb | 4 | /* |
17baffe2 MD |
5 | * ltt-tracer.h |
6 | * | |
7 | * Copyright (C) 2005-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
1c8284eb MD |
8 | * |
9 | * This contains the definitions for the Linux Trace Toolkit tracer. | |
10 | * | |
11 | * Dual LGPL v2.1/GPL v2 license. | |
12 | */ | |
13 | ||
1c8284eb MD |
14 | #include <stdarg.h> |
15 | #include <linux/types.h> | |
16 | #include <linux/limits.h> | |
17 | #include <linux/list.h> | |
18 | #include <linux/cache.h> | |
1c8284eb MD |
19 | #include <linux/timex.h> |
20 | #include <linux/wait.h> | |
1c8284eb MD |
21 | #include <asm/atomic.h> |
22 | #include <asm/local.h> | |
23 | ||
f3bc08c5 | 24 | #include "wrapper/trace-clock.h" |
1c8284eb | 25 | #include "ltt-tracer-core.h" |
1c25284c | 26 | #include "ltt-events.h" |
1c8284eb | 27 | |
80c16bcf MD |
28 | #define LTTNG_VERSION 0 |
29 | #define LTTNG_PATCHLEVEL 9 | |
30 | #define LTTNG_SUBLEVEL 1 | |
31 | ||
c099397a MD |
32 | #ifndef CHAR_BIT |
33 | #define CHAR_BIT 8 | |
34 | #endif | |
35 | ||
1c8284eb MD |
36 | /* Number of bytes to log with a read/write event */ |
37 | #define LTT_LOG_RW_SIZE 32L | |
1c8284eb MD |
38 | #define LTT_MAX_SMALL_SIZE 0xFFFFU |
39 | ||
d793d5e1 | 40 | #ifdef RING_BUFFER_ALIGN |
d793d5e1 | 41 | #define ltt_alignof(type) __alignof__(type) |
c099397a | 42 | #else |
d793d5e1 MD |
43 | #define ltt_alignof(type) 1 |
44 | #endif | |
1c8284eb | 45 | |
1c8284eb | 46 | /* Tracer properties */ |
1c25284c | 47 | #define CTF_MAGIC_NUMBER 0xC1FC1FC1 |
881833e3 | 48 | #define TSDL_MAGIC_NUMBER 0x75D11D57 |
d793d5e1 MD |
49 | #define CTF_VERSION_MAJOR 0 |
50 | #define CTF_VERSION_MINOR 1 | |
1c8284eb | 51 | |
c099397a MD |
52 | /* |
53 | * Number of milliseconds to retry before failing metadata writes on buffer full | |
54 | * condition. (10 seconds) | |
55 | */ | |
56 | #define LTTNG_METADATA_TIMEOUT_MSEC 10000 | |
57 | ||
64c796d8 MD |
58 | #define LTT_RFLAG_EXTENDED RING_BUFFER_RFLAG_END |
59 | #define LTT_RFLAG_END (LTT_RFLAG_EXTENDED << 1) | |
60 | ||
1c8284eb MD |
61 | /* Register and unregister function pointers */ |
62 | ||
63 | enum ltt_module_function { | |
64 | LTT_FUNCTION_RUN_FILTER, | |
65 | LTT_FUNCTION_FILTER_CONTROL, | |
66 | LTT_FUNCTION_STATEDUMP | |
67 | }; | |
68 | ||
69 | extern int ltt_module_register(enum ltt_module_function name, void *function, | |
70 | struct module *owner); | |
71 | extern void ltt_module_unregister(enum ltt_module_function name); | |
72 | ||
1c8284eb MD |
73 | /* Exported control function */ |
74 | ||
1c8284eb MD |
75 | void ltt_core_register(int (*function)(u8, void *)); |
76 | ||
77 | void ltt_core_unregister(void); | |
78 | ||
1c8284eb MD |
79 | extern |
80 | void ltt_statedump_register_kprobes_dump(void (*callback)(void *call_data)); | |
81 | extern | |
82 | void ltt_statedump_unregister_kprobes_dump(void (*callback)(void *call_data)); | |
83 | ||
84 | extern void ltt_dump_softirq_vec(void *call_data); | |
85 | ||
f277b4c1 | 86 | #ifdef CONFIG_HAVE_LTT_DUMP_TABLES |
1c8284eb MD |
87 | extern void ltt_dump_sys_call_table(void *call_data); |
88 | extern void ltt_dump_idt_table(void *call_data); | |
f277b4c1 MD |
89 | #else |
90 | static inline void ltt_dump_sys_call_table(void *call_data) | |
91 | { | |
92 | } | |
93 | ||
94 | static inline void ltt_dump_idt_table(void *call_data) | |
95 | { | |
96 | } | |
97 | #endif | |
1c8284eb | 98 | |
1c8284eb | 99 | #endif /* _LTT_TRACER_H */ |