Full support for Ginger Console
[linux-ginger.git] / include / trace / events / module.h
blob84160fb18478f99da3ae79bc19bc4da6044d8978
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM module
4 #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_MODULE_H
7 #include <linux/tracepoint.h>
9 #ifdef CONFIG_MODULES
11 struct module;
13 #define show_module_flags(flags) __print_flags(flags, "", \
14 { (1UL << TAINT_PROPRIETARY_MODULE), "P" }, \
15 { (1UL << TAINT_FORCED_MODULE), "F" }, \
16 { (1UL << TAINT_CRAP), "C" })
18 TRACE_EVENT(module_load,
20 TP_PROTO(struct module *mod),
22 TP_ARGS(mod),
24 TP_STRUCT__entry(
25 __field( unsigned int, taints )
26 __string( name, mod->name )
29 TP_fast_assign(
30 __entry->taints = mod->taints;
31 __assign_str(name, mod->name);
34 TP_printk("%s %s", __get_str(name), show_module_flags(__entry->taints))
37 TRACE_EVENT(module_free,
39 TP_PROTO(struct module *mod),
41 TP_ARGS(mod),
43 TP_STRUCT__entry(
44 __string( name, mod->name )
47 TP_fast_assign(
48 __assign_str(name, mod->name);
51 TP_printk("%s", __get_str(name))
54 TRACE_EVENT(module_get,
56 TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
58 TP_ARGS(mod, ip, refcnt),
60 TP_STRUCT__entry(
61 __field( unsigned long, ip )
62 __field( int, refcnt )
63 __string( name, mod->name )
66 TP_fast_assign(
67 __entry->ip = ip;
68 __entry->refcnt = refcnt;
69 __assign_str(name, mod->name);
72 TP_printk("%s call_site=%pf refcnt=%d",
73 __get_str(name), (void *)__entry->ip, __entry->refcnt)
76 TRACE_EVENT(module_put,
78 TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
80 TP_ARGS(mod, ip, refcnt),
82 TP_STRUCT__entry(
83 __field( unsigned long, ip )
84 __field( int, refcnt )
85 __string( name, mod->name )
88 TP_fast_assign(
89 __entry->ip = ip;
90 __entry->refcnt = refcnt;
91 __assign_str(name, mod->name);
94 TP_printk("%s call_site=%pf refcnt=%d",
95 __get_str(name), (void *)__entry->ip, __entry->refcnt)
98 TRACE_EVENT(module_request,
100 TP_PROTO(char *name, bool wait, unsigned long ip),
102 TP_ARGS(name, wait, ip),
104 TP_STRUCT__entry(
105 __field( bool, wait )
106 __field( unsigned long, ip )
107 __string( name, name )
110 TP_fast_assign(
111 __entry->wait = wait;
112 __entry->ip = ip;
113 __assign_str(name, name);
116 TP_printk("%s wait=%d call_site=%pf",
117 __get_str(name), (int)__entry->wait, (void *)__entry->ip)
120 #endif /* CONFIG_MODULES */
122 #endif /* _TRACE_MODULE_H */
124 /* This part must be outside protection */
125 #include <trace/define_trace.h>