2 * Because linux/module.h has tracepoints in the header, and ftrace.h
3 * eventually includes this file, define_trace.h includes linux/module.h
4 * But we do not want the module.h to override the TRACE_SYSTEM macro
5 * variable that define_trace.h is processing, so we only set it
6 * when module events are being processed, which would happen when
7 * CREATE_TRACE_POINTS is defined.
9 #ifdef CREATE_TRACE_POINTS
11 #define TRACE_SYSTEM module
14 #if !defined(LTTNG_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
15 #define LTTNG_TRACE_MODULE_H
17 #include "../../../probes/lttng-tracepoint-event.h"
18 #include <linux/version.h>
22 #ifndef _TRACE_MODULE_DEF
23 #define _TRACE_MODULE_DEF
28 LTTNG_TRACEPOINT_EVENT(module_load
,
30 TP_PROTO(struct module
*mod
),
35 __field( unsigned int, taints
)
36 __string( name
, mod
->name
)
40 tp_assign(taints
, mod
->taints
)
41 tp_strcpy(name
, mod
->name
)
44 TP_printk("%s %s", __get_str(name
), show_module_flags(__entry
->taints
))
47 LTTNG_TRACEPOINT_EVENT(module_free
,
49 TP_PROTO(struct module
*mod
),
54 __string( name
, mod
->name
)
58 tp_strcpy(name
, mod
->name
)
61 TP_printk("%s", __get_str(name
))
64 #ifdef CONFIG_MODULE_UNLOAD
65 /* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */
67 LTTNG_TRACEPOINT_EVENT_CLASS(module_refcnt
,
69 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
70 TP_PROTO(struct module
*mod
, unsigned long ip
),
74 TP_PROTO(struct module
*mod
, unsigned long ip
, int refcnt
),
76 TP_ARGS(mod
, ip
, refcnt
),
80 __field( unsigned long, ip
)
81 __field( int, refcnt
)
82 __string( name
, mod
->name
)
87 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
88 tp_assign(refcnt
, __this_cpu_read(mod
->refptr
->incs
) + __this_cpu_read(mod
->refptr
->decs
))
90 tp_assign(refcnt
, refcnt
)
92 tp_strcpy(name
, mod
->name
)
95 TP_printk("%s call_site=%pf refcnt=%d",
96 __get_str(name
), (void *)__entry
->ip
, __entry
->refcnt
)
99 LTTNG_TRACEPOINT_EVENT_INSTANCE(module_refcnt
, module_get
,
101 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
102 TP_PROTO(struct module
*mod
, unsigned long ip
),
106 TP_PROTO(struct module
*mod
, unsigned long ip
, int refcnt
),
108 TP_ARGS(mod
, ip
, refcnt
)
112 LTTNG_TRACEPOINT_EVENT_INSTANCE(module_refcnt
, module_put
,
114 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
115 TP_PROTO(struct module
*mod
, unsigned long ip
),
119 TP_PROTO(struct module
*mod
, unsigned long ip
, int refcnt
),
121 TP_ARGS(mod
, ip
, refcnt
)
124 #endif /* CONFIG_MODULE_UNLOAD */
126 LTTNG_TRACEPOINT_EVENT(module_request
,
128 TP_PROTO(char *name
, bool wait
, unsigned long ip
),
130 TP_ARGS(name
, wait
, ip
),
133 __field( unsigned long, ip
)
134 __field( bool, wait
)
135 __string( name
, name
)
140 tp_assign(wait
, wait
)
141 tp_strcpy(name
, name
)
144 TP_printk("%s wait=%d call_site=%pf",
145 __get_str(name
), (int)__entry
->wait
, (void *)__entry
->ip
)
148 #endif /* CONFIG_MODULES */
150 #endif /* LTTNG_TRACE_MODULE_H */
152 /* This part must be outside protection */
153 #include "../../../probes/define_trace.h"
This page took 0.034051 seconds and 4 git commands to generate.