diff options
Diffstat (limited to 'include/trace/events')
-rw-r--r-- | include/trace/events/regmap.h | 36 | ||||
-rw-r--r-- | include/trace/events/writeback.h | 7 |
2 files changed, 41 insertions, 2 deletions
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h index 12fbf43524e..d69738280ff 100644 --- a/include/trace/events/regmap.h +++ b/include/trace/events/regmap.h @@ -139,6 +139,42 @@ TRACE_EVENT(regcache_sync, __get_str(type), __get_str(status)) ); +DECLARE_EVENT_CLASS(regmap_bool, + + TP_PROTO(struct device *dev, bool flag), + + TP_ARGS(dev, flag), + + TP_STRUCT__entry( + __string( name, dev_name(dev) ) + __field( int, flag ) + ), + + TP_fast_assign( + __assign_str(name, dev_name(dev)); + __entry->flag = flag; + ), + + TP_printk("%s flag=%d", __get_str(name), + (int)__entry->flag) +); + +DEFINE_EVENT(regmap_bool, regmap_cache_only, + + TP_PROTO(struct device *dev, bool flag), + + TP_ARGS(dev, flag) + +); + +DEFINE_EVENT(regmap_bool, regmap_cache_bypass, + + TP_PROTO(struct device *dev, bool flag), + + TP_ARGS(dev, flag) + +); + #endif /* _TRACE_REGMAP_H */ /* This part must be outside protection */ diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 8588a891802..5973410e8f8 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h @@ -47,7 +47,10 @@ DECLARE_EVENT_CLASS(writeback_work_class, __field(int, reason) ), TP_fast_assign( - strncpy(__entry->name, dev_name(bdi->dev), 32); + struct device *dev = bdi->dev; + if (!dev) + dev = default_backing_dev_info.dev; + strncpy(__entry->name, dev_name(dev), 32); __entry->nr_pages = work->nr_pages; __entry->sb_dev = work->sb ? work->sb->s_dev : 0; __entry->sync_mode = work->sync_mode; @@ -426,7 +429,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template, TP_fast_assign( strncpy(__entry->name, - dev_name(inode->i_mapping->backing_dev_info->dev), 32); + dev_name(inode_to_bdi(inode)->dev), 32); __entry->ino = inode->i_ino; __entry->state = inode->i_state; __entry->dirtied_when = inode->dirtied_when; |