~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/trace/events/module.h

Version: ~ [ linux-5.6 ] ~ [ linux-5.5.13 ] ~ [ linux-5.4.28 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.113 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.174 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.217 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.217 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.82 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Because linux/module.h has tracepoints in the header, and ftrace.h
  3  * used to include 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.
  8  */
  9 #ifdef CREATE_TRACE_POINTS
 10 #undef TRACE_SYSTEM
 11 #define TRACE_SYSTEM module
 12 #endif
 13 
 14 #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
 15 #define _TRACE_MODULE_H
 16 
 17 #include <linux/tracepoint.h>
 18 
 19 #ifdef CONFIG_MODULES
 20 
 21 struct module;
 22 
 23 #define show_module_flags(flags) __print_flags(flags, "",       \
 24         { (1UL << TAINT_PROPRIETARY_MODULE),    "P" },          \
 25         { (1UL << TAINT_OOT_MODULE),            "O" },          \
 26         { (1UL << TAINT_FORCED_MODULE),         "F" },          \
 27         { (1UL << TAINT_CRAP),                  "C" },          \
 28         { (1UL << TAINT_UNSIGNED_MODULE),       "E" })
 29 
 30 TRACE_EVENT(module_load,
 31 
 32         TP_PROTO(struct module *mod),
 33 
 34         TP_ARGS(mod),
 35 
 36         TP_STRUCT__entry(
 37                 __field(        unsigned int,   taints          )
 38                 __string(       name,           mod->name       )
 39         ),
 40 
 41         TP_fast_assign(
 42                 __entry->taints = mod->taints;
 43                 __assign_str(name, mod->name);
 44         ),
 45 
 46         TP_printk("%s %s", __get_str(name), show_module_flags(__entry->taints))
 47 );
 48 
 49 TRACE_EVENT(module_free,
 50 
 51         TP_PROTO(struct module *mod),
 52 
 53         TP_ARGS(mod),
 54 
 55         TP_STRUCT__entry(
 56                 __string(       name,           mod->name       )
 57         ),
 58 
 59         TP_fast_assign(
 60                 __assign_str(name, mod->name);
 61         ),
 62 
 63         TP_printk("%s", __get_str(name))
 64 );
 65 
 66 #ifdef CONFIG_MODULE_UNLOAD
 67 /* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */
 68 
 69 DECLARE_EVENT_CLASS(module_refcnt,
 70 
 71         TP_PROTO(struct module *mod, unsigned long ip),
 72 
 73         TP_ARGS(mod, ip),
 74 
 75         TP_STRUCT__entry(
 76                 __field(        unsigned long,  ip              )
 77                 __field(        int,            refcnt          )
 78                 __string(       name,           mod->name       )
 79         ),
 80 
 81         TP_fast_assign(
 82                 __entry->ip     = ip;
 83                 __entry->refcnt = atomic_read(&mod->refcnt);
 84                 __assign_str(name, mod->name);
 85         ),
 86 
 87         TP_printk("%s call_site=%ps refcnt=%d",
 88                   __get_str(name), (void *)__entry->ip, __entry->refcnt)
 89 );
 90 
 91 DEFINE_EVENT(module_refcnt, module_get,
 92 
 93         TP_PROTO(struct module *mod, unsigned long ip),
 94 
 95         TP_ARGS(mod, ip)
 96 );
 97 
 98 DEFINE_EVENT(module_refcnt, module_put,
 99 
100         TP_PROTO(struct module *mod, unsigned long ip),
101 
102         TP_ARGS(mod, ip)
103 );
104 #endif /* CONFIG_MODULE_UNLOAD */
105 
106 TRACE_EVENT(module_request,
107 
108         TP_PROTO(char *name, bool wait, unsigned long ip),
109 
110         TP_ARGS(name, wait, ip),
111 
112         TP_STRUCT__entry(
113                 __field(        unsigned long,  ip              )
114                 __field(        bool,           wait            )
115                 __string(       name,           name            )
116         ),
117 
118         TP_fast_assign(
119                 __entry->ip     = ip;
120                 __entry->wait   = wait;
121                 __assign_str(name, name);
122         ),
123 
124         TP_printk("%s wait=%d call_site=%ps",
125                   __get_str(name), (int)__entry->wait, (void *)__entry->ip)
126 );
127 
128 #endif /* CONFIG_MODULES */
129 
130 #endif /* _TRACE_MODULE_H */
131 
132 /* This part must be outside protection */
133 #include <trace/define_trace.h>
134 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp