X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fmodule.h;h=c63f86602555f59feb90d7e8957cc7707cfb0aaa;hb=7c68b363332170e4db100327ecc9e09b8a79cf29;hp=2e83431a87e3589e350c859116936bfa84cb812f;hpb=b283666ff19841a28b0448c6a867beb2f809f11a;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/module.h b/instrumentation/events/lttng-module/module.h index 2e83431a..c63f8660 100644 --- a/instrumentation/events/lttng-module/module.h +++ b/instrumentation/events/lttng-module/module.h @@ -15,6 +15,7 @@ #define _TRACE_MODULE_H #include +#include #ifdef CONFIG_MODULES @@ -40,8 +41,8 @@ TRACE_EVENT(module_load, ), TP_fast_assign( - tp_assign(taints, mod->taints); - tp_strcpy(name, mod->name); + tp_assign(taints, mod->taints) + tp_strcpy(name, mod->name) ), TP_printk("%s %s", __get_str(name), show_module_flags(__entry->taints)) @@ -58,7 +59,7 @@ TRACE_EVENT(module_free, ), TP_fast_assign( - tp_strcpy(name, mod->name); + tp_strcpy(name, mod->name) ), TP_printk("%s", __get_str(name)) @@ -69,9 +70,15 @@ TRACE_EVENT(module_free, DECLARE_EVENT_CLASS(module_refcnt, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) TP_PROTO(struct module *mod, unsigned long ip), TP_ARGS(mod, ip), +#else + TP_PROTO(struct module *mod, unsigned long ip, int refcnt), + + TP_ARGS(mod, ip, refcnt), +#endif TP_STRUCT__entry( __field( unsigned long, ip ) @@ -80,9 +87,13 @@ DECLARE_EVENT_CLASS(module_refcnt, ), TP_fast_assign( - tp_assign(ip, ip); - tp_assign(refcnt, __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs)); - tp_strcpy(name, mod->name); + tp_assign(ip, ip) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + tp_assign(refcnt, __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs)) +#else + tp_assign(refcnt, refcnt) +#endif + tp_strcpy(name, mod->name) ), TP_printk("%s call_site=%pf refcnt=%d", @@ -91,16 +102,28 @@ DECLARE_EVENT_CLASS(module_refcnt, DEFINE_EVENT(module_refcnt, module_get, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) TP_PROTO(struct module *mod, unsigned long ip), TP_ARGS(mod, ip) +#else + TP_PROTO(struct module *mod, unsigned long ip, int refcnt), + + TP_ARGS(mod, ip, refcnt) +#endif ) DEFINE_EVENT(module_refcnt, module_put, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) TP_PROTO(struct module *mod, unsigned long ip), TP_ARGS(mod, ip) +#else + TP_PROTO(struct module *mod, unsigned long ip, int refcnt), + + TP_ARGS(mod, ip, refcnt) +#endif ) #endif /* CONFIG_MODULE_UNLOAD */ @@ -117,9 +140,9 @@ TRACE_EVENT(module_request, ), TP_fast_assign( - tp_assign(ip, ip); - tp_assign(wait, wait); - tp_strcpy(name, name); + tp_assign(ip, ip) + tp_assign(wait, wait) + tp_strcpy(name, name) ), TP_printk("%s wait=%d call_site=%pf",