From: Mathieu Desnoyers Date: Fri, 17 Apr 2015 20:00:34 +0000 (-0400) Subject: Update regmap instrumentation for Linux 3.19.4 and 4.0 X-Git-Tag: v2.6.1~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=206584b257bfe5e9820bdb3184a7b694a88a1854;p=lttng-modules.git Update regmap instrumentation for Linux 3.19.4 and 4.0 This is necessary after commit c6b570d97c0e77f570bb6b2ed30d372b2b1e9aae in the kernel. Signed-off-by: Mathieu Desnoyers --- diff --git a/instrumentation/events/lttng-module/regmap.h b/instrumentation/events/lttng-module/regmap.h index 87df6a6d..e1a27e73 100644 --- a/instrumentation/events/lttng-module/regmap.h +++ b/instrumentation/events/lttng-module/regmap.h @@ -14,6 +14,50 @@ struct device; struct regmap; #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4)) +/* + * Log register events + */ +LTTNG_TRACEPOINT_EVENT_CLASS(regmap_reg, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), + + TP_ARGS(map, reg, val), + + TP_STRUCT__entry( + __string( name, regmap_name(map)) + __field( unsigned int, reg ) + __field( unsigned int, val ) + ), + + TP_fast_assign( + tp_strcpy(name, regmap_name(map)) + tp_assign(reg, reg) + tp_assign(val, val) + ), + + TP_printk("%s reg=%x val=%x", __get_str(name), + (unsigned int)__entry->reg, + (unsigned int)__entry->val) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_write, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), + + TP_ARGS(map, reg, val) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), + + TP_ARGS(map, reg, val) +) +#else /* * Log register events */ @@ -47,7 +91,6 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_write, unsigned int val), TP_ARGS(dev, reg, val) - ) LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read, @@ -56,20 +99,79 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read, unsigned int val), TP_ARGS(dev, reg, val) - ) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4)) +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read_cache, + + TP_PROTO(struct regmap *map, unsigned int reg, + unsigned int val), -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) + TP_ARGS(map, reg, val) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_reg, regmap_reg_read_cache, TP_PROTO(struct device *dev, unsigned int reg, unsigned int val), TP_ARGS(dev, reg, val) - ) #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4)) +LTTNG_TRACEPOINT_EVENT_CLASS(regmap_block, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count), + + TP_STRUCT__entry( + __string( name, regmap_name(map)) + __field( unsigned int, reg ) + __field( int, count ) + ), + + TP_fast_assign( + tp_strcpy(name, regmap_name(map)) + tp_assign(reg, reg) + tp_assign(count, count) + ), + + TP_printk("%s reg=%x count=%d", __get_str(name), + (unsigned int)__entry->reg, + (int)__entry->count) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_start, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_read_done, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_start, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_done, + + TP_PROTO(struct regmap *map, unsigned int reg, int count), + + TP_ARGS(map, reg, count) +) +#else LTTNG_TRACEPOINT_EVENT_CLASS(regmap_block, TP_PROTO(struct device *dev, unsigned int reg, int count), @@ -120,7 +222,32 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_block, regmap_hw_write_done, TP_ARGS(dev, reg, count) ) +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4)) +LTTNG_TRACEPOINT_EVENT(regcache_sync, + + TP_PROTO(struct regmap *map, const char *type, + const char *status), + + TP_ARGS(map, type, status), + + TP_STRUCT__entry( + __string( name, regmap_name(map)) + __string( status, status ) + __string( type, type ) + ), + + TP_fast_assign( + tp_strcpy(name, regmap_name(map)) + tp_strcpy(status, status) + tp_strcpy(type, type) + ), + + TP_printk("%s type=%s status=%s", __get_str(name), + __get_str(type), __get_str(status)) +) +#else LTTNG_TRACEPOINT_EVENT(regcache_sync, TP_PROTO(struct device *dev, const char *type, @@ -143,8 +270,44 @@ LTTNG_TRACEPOINT_EVENT(regcache_sync, TP_printk("%s type=%s status=%s", __get_str(name), __get_str(type), __get_str(status)) ) +#endif + + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,4)) +LTTNG_TRACEPOINT_EVENT_CLASS(regmap_bool, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) + TP_PROTO(struct regmap *map, bool flag), + + TP_ARGS(map, flag), + + TP_STRUCT__entry( + __string( name, regmap_name(map)) + __field( int, flag ) + ), + + TP_fast_assign( + tp_strcpy(name, regmap_name(map)) + tp_assign(flag, flag) + ), + + TP_printk("%s flag=%d", __get_str(name), + (int)__entry->flag) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_only, + + TP_PROTO(struct regmap *map, bool flag), + + TP_ARGS(map, flag) +) + +LTTNG_TRACEPOINT_EVENT_INSTANCE(regmap_bool, regmap_cache_bypass, + + TP_PROTO(struct regmap *map, bool flag), + + TP_ARGS(map, flag) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) LTTNG_TRACEPOINT_EVENT_CLASS(regmap_bool, TP_PROTO(struct device *dev, bool flag),