From fb2736bbaee0e704a4f33912cf532597b2dc5b33 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sun, 24 Jul 2011 21:30:55 +0100 Subject: regmap: Add basic tracepoints Trace single register reads and writes, plus start/stop tracepoints for the actual I/O to see where we're spending time. This makes it easy to have always on logging without overwhelming the logs and also lets us take advantage of all the context and time information that the trace subsystem collects for us. We don't currently trace register values for bulk operations as this would add complexity and overhead parsing the cooked data that's being worked with. Signed-off-by: Mark Brown --- include/trace/events/regmap.h | 112 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 include/trace/events/regmap.h (limited to 'include/trace') diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h new file mode 100644 index 000000000000..1c76f40dee44 --- /dev/null +++ b/include/trace/events/regmap.h @@ -0,0 +1,112 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM regmap + +#if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_REGMAP_H + +#include +#include +#include + +struct regmap; + +/* + * Log register events + */ +DECLARE_EVENT_CLASS(regmap_reg, + + TP_PROTO(struct device *dev, unsigned int reg, + unsigned int val), + + TP_ARGS(dev, reg, val), + + TP_STRUCT__entry( + __string( name, dev_name(dev) ) + __field( unsigned int, reg ) + __field( unsigned int, val ) + ), + + TP_fast_assign( + __assign_str(name, dev_name(dev)); + __entry->reg = reg; + __entry->val = val; + ), + + TP_printk("%s reg=%x val=%x", __get_str(name), + (unsigned int)__entry->reg, + (unsigned int)__entry->val) +); + +DEFINE_EVENT(regmap_reg, regmap_reg_write, + + TP_PROTO(struct device *dev, unsigned int reg, + unsigned int val), + + TP_ARGS(dev, reg, val) + +); + +DEFINE_EVENT(regmap_reg, regmap_reg_read, + + TP_PROTO(struct device *dev, unsigned int reg, + unsigned int val), + + TP_ARGS(dev, reg, val) + +); + +DECLARE_EVENT_CLASS(regmap_block, + + TP_PROTO(struct device *dev, unsigned int reg, size_t count), + + TP_ARGS(dev, reg, count), + + TP_STRUCT__entry( + __string( name, dev_name(dev) ) + __field( unsigned int, reg ) + __field( size_t, count ) + ), + + TP_fast_assign( + __assign_str(name, dev_name(dev)); + __entry->reg = reg; + __entry->count = count; + ), + + TP_printk("%s reg=%x count=%d", __get_str(name), + (unsigned int)__entry->reg, + (size_t)__entry->count) +); + +DEFINE_EVENT(regmap_block, regmap_hw_read_start, + + TP_PROTO(struct device *dev, unsigned int reg, size_t count), + + TP_ARGS(dev, reg, count) +); + +DEFINE_EVENT(regmap_block, regmap_hw_read_done, + + TP_PROTO(struct device *dev, unsigned int reg, size_t count), + + TP_ARGS(dev, reg, count) +); + +DEFINE_EVENT(regmap_block, regmap_hw_write_start, + + TP_PROTO(struct device *dev, unsigned int reg, size_t count), + + TP_ARGS(dev, reg, count) +); + +DEFINE_EVENT(regmap_block, regmap_hw_write_done, + + TP_PROTO(struct device *dev, unsigned int reg, size_t count), + + TP_ARGS(dev, reg, count) +); + +#endif /* _TRACE_REGMAP_H */ + +/* This part must be outside protection */ +#include -- cgit v1.2.3 From 3d9ead7c06e51249a92eb710a892a66601bd7290 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 9 Aug 2011 16:42:27 +0900 Subject: regmap: Use int rather than size_t for lengths when logging blocks x86_64 warns as size_t is not an int. Signed-off-by: Mark Brown Reported-by: Stephen Rothwell --- include/trace/events/regmap.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/trace') diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index 1c76f40dee44..e35e37c378c6 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h @@ -57,14 +57,14 @@ DEFINE_EVENT(regmap_reg, regmap_reg_read, DECLARE_EVENT_CLASS(regmap_block, - TP_PROTO(struct device *dev, unsigned int reg, size_t count), + TP_PROTO(struct device *dev, unsigned int reg, int count), TP_ARGS(dev, reg, count), TP_STRUCT__entry( __string( name, dev_name(dev) ) __field( unsigned int, reg ) - __field( size_t, count ) + __field( int, count ) ), TP_fast_assign( @@ -75,33 +75,33 @@ DECLARE_EVENT_CLASS(regmap_block, TP_printk("%s reg=%x count=%d", __get_str(name), (unsigned int)__entry->reg, - (size_t)__entry->count) + (int)__entry->count) ); DEFINE_EVENT(regmap_block, regmap_hw_read_start, - TP_PROTO(struct device *dev, unsigned int reg, size_t count), + TP_PROTO(struct device *dev, unsigned int reg, int count), TP_ARGS(dev, reg, count) ); DEFINE_EVENT(regmap_block, regmap_hw_read_done, - TP_PROTO(struct device *dev, unsigned int reg, size_t count), + TP_PROTO(struct device *dev, unsigned int reg, int count), TP_ARGS(dev, reg, count) ); DEFINE_EVENT(regmap_block, regmap_hw_write_start, - TP_PROTO(struct device *dev, unsigned int reg, size_t count), + TP_PROTO(struct device *dev, unsigned int reg, int count), TP_ARGS(dev, reg, count) ); DEFINE_EVENT(regmap_block, regmap_hw_write_done, - TP_PROTO(struct device *dev, unsigned int reg, size_t count), + TP_PROTO(struct device *dev, unsigned int reg, int count), TP_ARGS(dev, reg, count) ); -- cgit v1.2.3 From 593600890110c02eb471cf844649dee213870416 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Mon, 19 Sep 2011 14:34:04 +0100 Subject: regmap: Add the regcache_sync trace event Signed-off-by: Dimitris Papastamos Signed-off-by: Mark Brown --- include/trace/events/regmap.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include/trace') diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index e35e37c378c6..1e3193b8fcc8 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h @@ -106,6 +106,30 @@ DEFINE_EVENT(regmap_block, regmap_hw_write_done, TP_ARGS(dev, reg, count) ); +TRACE_EVENT(regcache_sync, + + TP_PROTO(struct device *dev, const char *type, + const char *status), + + TP_ARGS(dev, type, status), + + TP_STRUCT__entry( + __string( name, dev_name(dev) ) + __string( status, status ) + __string( type, type ) + __field( int, type ) + ), + + TP_fast_assign( + __assign_str(name, dev_name(dev)); + __assign_str(status, status); + __assign_str(type, type); + ), + + TP_printk("%s type=%s status=%s", __get_str(name), + __get_str(type), __get_str(status)) +); + #endif /* _TRACE_REGMAP_H */ /* This part must be outside protection */ -- cgit v1.2.3