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

~ [ 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