From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361AbbCSTSW (ORCPT ); Thu, 19 Mar 2015 15:18:22 -0400 Received: from smtprelay0082.hostedemail.com ([216.40.44.82]:35606 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750890AbbCSTST (ORCPT ); Thu, 19 Mar 2015 15:18:19 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:2:41:273:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1535:1593:1594:1605:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4051:4120:4321:4605:5007:6261:6678:7875:9040:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12517:12519:12555:12740:13019:13161:13180:13229:13972:14096:14097:21067:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:1:0 X-HE-Tag: lip73_656c15161ae3e X-Filterd-Recvd-Size: 9490 Date: Thu, 19 Mar 2015 15:18:15 -0400 From: Steven Rostedt To: Philipp Zabel Cc: Mark Brown , Pankaj Dubey , Ingo Molnar , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH v2] regmap: introduce regmap_name to fix syscon regmap trace events Message-ID: <20150319151815.620bca59@gandalf.local.home> In-Reply-To: <1425900013-3535-1-git-send-email-p.zabel@pengutronix.de> References: <1425900013-3535-1-git-send-email-p.zabel@pengutronix.de> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Mar 2015 12:20:13 +0100 Philipp Zabel wrote: Sorry for the late repy, I just noticed this email. > diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h > index 23d5615..22317d2 100644 > --- a/include/trace/events/regmap.h > +++ b/include/trace/events/regmap.h > @@ -7,27 +7,26 @@ > #include > #include > > -struct device; > -struct regmap; > +#include "../../../drivers/base/regmap/internal.h" Ouch, that is nasty! Can we move this regmap.h file into drivers/base/regmap/ directory. The trace_event sample code in samples/trace_events/ explains how to do that, but for those that are too lazy to read that, I'll explain it here too ;-) In drivers/base/regmap/Makefile, add: CFLAGS_regmap.o = -I$(src) Then in this header file add at the bottom just before the include of trace/define_trace.h: #undef TRACE_INCLUDE_PATH #define TRACE_INCLUDE_PATH . Note, if you want to rename this file to something like regmap_trace.h, then you also need to add: #undef TRACE_INCLUDE_FILE #define TRACE_INCLUDE_FILE regmap_trace And it should all work out. Then you don't need that ugly include and you can just add: #include "internal.h" -- Steve > > /* > * Log register events > */ > DECLARE_EVENT_CLASS(regmap_reg, > > - TP_PROTO(struct device *dev, unsigned int reg, > + TP_PROTO(struct regmap *map, unsigned int reg, > unsigned int val), > > - TP_ARGS(dev, reg, val), > + TP_ARGS(map, reg, val), > > TP_STRUCT__entry( > - __string( name, dev_name(dev) ) > - __field( unsigned int, reg ) > - __field( unsigned int, val ) > + __string( name, regmap_name(map) ) > + __field( unsigned int, reg ) > + __field( unsigned int, val ) > ), > > TP_fast_assign( > - __assign_str(name, dev_name(dev)); > + __assign_str(name, regmap_name(map)); > __entry->reg = reg; > __entry->val = val; > ), > @@ -39,45 +38,45 @@ DECLARE_EVENT_CLASS(regmap_reg, > > DEFINE_EVENT(regmap_reg, regmap_reg_write, > > - TP_PROTO(struct device *dev, unsigned int reg, > + TP_PROTO(struct regmap *map, unsigned int reg, > unsigned int val), > > - TP_ARGS(dev, reg, val) > + TP_ARGS(map, reg, val) > > ); > > DEFINE_EVENT(regmap_reg, regmap_reg_read, > > - TP_PROTO(struct device *dev, unsigned int reg, > + TP_PROTO(struct regmap *map, unsigned int reg, > unsigned int val), > > - TP_ARGS(dev, reg, val) > + TP_ARGS(map, reg, val) > > ); > > DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, > > - TP_PROTO(struct device *dev, unsigned int reg, > + TP_PROTO(struct regmap *map, unsigned int reg, > unsigned int val), > > - TP_ARGS(dev, reg, val) > + TP_ARGS(map, reg, val) > > ); > > DECLARE_EVENT_CLASS(regmap_block, > > - TP_PROTO(struct device *dev, unsigned int reg, int count), > + TP_PROTO(struct regmap *map, unsigned int reg, int count), > > - TP_ARGS(dev, reg, count), > + TP_ARGS(map, reg, count), > > TP_STRUCT__entry( > - __string( name, dev_name(dev) ) > - __field( unsigned int, reg ) > - __field( int, count ) > + __string( name, regmap_name(map) ) > + __field( unsigned int, reg ) > + __field( int, count ) > ), > > TP_fast_assign( > - __assign_str(name, dev_name(dev)); > + __assign_str(name, regmap_name(map)); > __entry->reg = reg; > __entry->count = count; > ), > @@ -89,48 +88,48 @@ DECLARE_EVENT_CLASS(regmap_block, > > DEFINE_EVENT(regmap_block, regmap_hw_read_start, > > - TP_PROTO(struct device *dev, unsigned int reg, int count), > + TP_PROTO(struct regmap *map, unsigned int reg, int count), > > - TP_ARGS(dev, reg, count) > + TP_ARGS(map, reg, count) > ); > > DEFINE_EVENT(regmap_block, regmap_hw_read_done, > > - TP_PROTO(struct device *dev, unsigned int reg, int count), > + TP_PROTO(struct regmap *map, unsigned int reg, int count), > > - TP_ARGS(dev, reg, count) > + TP_ARGS(map, reg, count) > ); > > DEFINE_EVENT(regmap_block, regmap_hw_write_start, > > - TP_PROTO(struct device *dev, unsigned int reg, int count), > + TP_PROTO(struct regmap *map, unsigned int reg, int count), > > - TP_ARGS(dev, reg, count) > + TP_ARGS(map, reg, count) > ); > > DEFINE_EVENT(regmap_block, regmap_hw_write_done, > > - TP_PROTO(struct device *dev, unsigned int reg, int count), > + TP_PROTO(struct regmap *map, unsigned int reg, int count), > > - TP_ARGS(dev, reg, count) > + TP_ARGS(map, reg, count) > ); > > TRACE_EVENT(regcache_sync, > > - TP_PROTO(struct device *dev, const char *type, > + TP_PROTO(struct regmap *map, const char *type, > const char *status), > > - TP_ARGS(dev, type, status), > + TP_ARGS(map, type, status), > > TP_STRUCT__entry( > - __string( name, dev_name(dev) ) > - __string( status, status ) > - __string( type, type ) > - __field( int, type ) > + __string( name, regmap_name(map) ) > + __string( status, status ) > + __string( type, type ) > + __field( int, type ) > ), > > TP_fast_assign( > - __assign_str(name, dev_name(dev)); > + __assign_str(name, regmap_name(map)); > __assign_str(status, status); > __assign_str(type, type); > ), > @@ -141,17 +140,17 @@ TRACE_EVENT(regcache_sync, > > DECLARE_EVENT_CLASS(regmap_bool, > > - TP_PROTO(struct device *dev, bool flag), > + TP_PROTO(struct regmap *map, bool flag), > > - TP_ARGS(dev, flag), > + TP_ARGS(map, flag), > > TP_STRUCT__entry( > - __string( name, dev_name(dev) ) > - __field( int, flag ) > + __string( name, regmap_name(map) ) > + __field( int, flag ) > ), > > TP_fast_assign( > - __assign_str(name, dev_name(dev)); > + __assign_str(name, regmap_name(map)); > __entry->flag = flag; > ), > > @@ -161,32 +160,32 @@ DECLARE_EVENT_CLASS(regmap_bool, > > DEFINE_EVENT(regmap_bool, regmap_cache_only, > > - TP_PROTO(struct device *dev, bool flag), > + TP_PROTO(struct regmap *map, bool flag), > > - TP_ARGS(dev, flag) > + TP_ARGS(map, flag) > > ); > > DEFINE_EVENT(regmap_bool, regmap_cache_bypass, > > - TP_PROTO(struct device *dev, bool flag), > + TP_PROTO(struct regmap *map, bool flag), > > - TP_ARGS(dev, flag) > + TP_ARGS(map, flag) > > ); > > DECLARE_EVENT_CLASS(regmap_async, > > - TP_PROTO(struct device *dev), > + TP_PROTO(struct regmap *map), > > - TP_ARGS(dev), > + TP_ARGS(map), > > TP_STRUCT__entry( > - __string( name, dev_name(dev) ) > + __string( name, regmap_name(map) ) > ), > > TP_fast_assign( > - __assign_str(name, dev_name(dev)); > + __assign_str(name, regmap_name(map)); > ), > > TP_printk("%s", __get_str(name)) > @@ -194,50 +193,50 @@ DECLARE_EVENT_CLASS(regmap_async, > > DEFINE_EVENT(regmap_block, regmap_async_write_start, > > - TP_PROTO(struct device *dev, unsigned int reg, int count), > + TP_PROTO(struct regmap *map, unsigned int reg, int count), > > - TP_ARGS(dev, reg, count) > + TP_ARGS(map, reg, count) > ); > > DEFINE_EVENT(regmap_async, regmap_async_io_complete, > > - TP_PROTO(struct device *dev), > + TP_PROTO(struct regmap *map), > > - TP_ARGS(dev) > + TP_ARGS(map) > > ); > > DEFINE_EVENT(regmap_async, regmap_async_complete_start, > > - TP_PROTO(struct device *dev), > + TP_PROTO(struct regmap *map), > > - TP_ARGS(dev) > + TP_ARGS(map) > > ); > > DEFINE_EVENT(regmap_async, regmap_async_complete_done, > > - TP_PROTO(struct device *dev), > + TP_PROTO(struct regmap *map), > > - TP_ARGS(dev) > + TP_ARGS(map) > > ); > > TRACE_EVENT(regcache_drop_region, > > - TP_PROTO(struct device *dev, unsigned int from, > + TP_PROTO(struct regmap *map, unsigned int from, > unsigned int to), > > - TP_ARGS(dev, from, to), > + TP_ARGS(map, from, to), > > TP_STRUCT__entry( > - __string( name, dev_name(dev) ) > - __field( unsigned int, from ) > - __field( unsigned int, to ) > + __string( name, regmap_name(map) ) > + __field( unsigned int, from ) > + __field( unsigned int, to ) > ), > > TP_fast_assign( > - __assign_str(name, dev_name(dev)); > + __assign_str(name, regmap_name(map)); > __entry->from = from; > __entry->to = to; > ),