All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Alasdair G Kergon <agk@redhat.com>
Cc: Morgan Mears <morgan.mears@netapp.com>,
	Heinz Mauelshagen <heinzm@redhat.com>,
	dm-devel@redhat.com, Joe Thornber <ejt@redhat.com>
Subject: Re: [PATCH 21/24] dm cache: add trc policy shim
Date: Fri, 25 Oct 2013 17:08:21 -0400	[thread overview]
Message-ID: <20131025210820.GA7589@redhat.com> (raw)
In-Reply-To: <20131025201356.GM17070@agk-dp.fab.redhat.com>

On Fri, Oct 25 2013 at  4:13pm -0400,
Alasdair G Kergon <agk@redhat.com> wrote:

> On Thu, Oct 24, 2013 at 02:30:34PM -0400, Mike Snitzer wrote:
> > From: Morgan Mears <morgan.mears@netapp.com>
>  
> > This commit includes a non-terminal policy (aka "shim") called trc that
> > may be stacked ontop of a terminal policy (e.g. mq).
> > The second shim, trc, adds function-call-level tracing to the policy
> > stack.  By default, an INFO-level log message including function name
> > and parameter(s) will be generated whenever most of the cache policy
> > interface functions are called.  An interface to increase or decrease
> > the verbosity of the trace output is also provided.
>  
> Firstly, why not call it 'trace' in full, rather than abbreviating it to 3
> consonants?

We can easily rename.
 
> > +++ b/drivers/md/dm-cache-policy-trc.c
> 
> > +#define DM_TRC_OUT(lev, p, f, arg...) \
> > +	do { \
> > +		if (to_trc_policy(p)->trace_level >= lev) \
> > +			DMINFO("%s: " f, __func__, ## arg); \
> > +	} while (0)
> 
> OK for private debugging, but I can't pretend to be very keen on this
> one going upstream in this form.   Might this not need to support high
> volumes of messages sometimes?  Were other upstream mechanisms
> considered?  (E.g. see Documentation/trace).

Think this would take care of it (not full-blown tracepoints like
blktrace but certainly more performant than standard printk):

---
 drivers/md/dm-cache-policy-trc.c |    2 +-
 include/linux/device-mapper.h    |    3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

Index: linux/drivers/md/dm-cache-policy-trc.c
===================================================================
--- linux.orig/drivers/md/dm-cache-policy-trc.c
+++ linux/drivers/md/dm-cache-policy-trc.c
@@ -27,7 +27,7 @@
 #define DM_TRC_OUT(lev, p, f, arg...) \
 	do { \
 		if (to_trc_policy(p)->trace_level >= lev) \
-			DMINFO("%s: " f, __func__, ## arg); \
+			DMTRACE("%s: " f, __func__, ## arg); \
 	} while (0)
 
 enum dm_trace_lev_e {
Index: linux/include/linux/device-mapper.h
===================================================================
--- linux.orig/include/linux/device-mapper.h
+++ linux/include/linux/device-mapper.h
@@ -520,6 +520,9 @@ extern struct ratelimit_state dm_ratelim
 			       "\n", ## arg); \
 	} while (0)
 
+#define DMTRACE(f, arg...) \
+	trace_printk(DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
+
 #ifdef CONFIG_DM_DEBUG
 #  define DMDEBUG(f, arg...) \
 	printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)

  reply	other threads:[~2013-10-25 21:08 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24 18:30 [PATCH 00/24] dm cache: proposed changes for v3.13 merge Mike Snitzer
2013-10-24 18:30 ` [PATCH 01/24] dm: nest targets used for testing under DM_TEST_TARGETS Mike Snitzer
2013-10-24 23:17   ` Alasdair G Kergon
2013-10-25 19:25     ` Mike Snitzer
2013-10-25 19:29       ` Alasdair G Kergon
2013-10-24 23:51   ` Alasdair G Kergon
2013-10-24 18:30 ` [PATCH 02/24] dm space map disk: optimise sm_disk_dec_block Mike Snitzer
2013-10-24 18:30 ` [PATCH 03/24] dm cache policy: remove return from void policy_remove_mapping Mike Snitzer
2013-10-24 18:30 ` [PATCH 04/24] dm cache policy mq: a few small fixes Mike Snitzer
2013-10-24 18:30 ` [PATCH 05/24] dm cache policy mq: implement writeback_work() and mq_{set, clear}_dirty() Mike Snitzer
2013-10-25 16:06   ` Alasdair G Kergon
2013-10-25 19:18     ` Mike Snitzer
2013-10-24 18:30 ` [PATCH 06/24] dm cache policy mq: return NULL if mq->free list is empty in alloc_entry Mike Snitzer
2013-10-25 16:37   ` Alasdair G Kergon
2013-10-25 20:44     ` Mike Snitzer
2013-10-25 22:36       ` Heinz Mauelshagen
2013-10-29 14:49   ` [PATCH 06/24 v2] dm cache policy mq: return NULL from alloc_entry if cache is full Mike Snitzer
2013-10-24 18:30 ` [PATCH 07/24] dm cache: be much more aggressive about promoting writes to discarded blocks Mike Snitzer
2013-10-24 18:30 ` [PATCH 08/24] dm cache metadata: return bool from __superblock_all_zeroes Mike Snitzer
2013-10-24 18:30 ` [PATCH 09/24] dm cache metadata: check the metadata version when reading the superblock Mike Snitzer
2013-10-25 17:07   ` Alasdair G Kergon
2013-10-25 19:53     ` Mike Snitzer
2013-10-24 18:30 ` [PATCH 10/24] dm cache policy: variable hints support Mike Snitzer
2013-10-24 18:30 ` [PATCH 11/24] dm table: print error on preresume failure Mike Snitzer
2013-10-25 19:22   ` Alasdair G Kergon
2013-10-25 19:58     ` Mike Snitzer
2013-10-24 18:30 ` [PATCH 12/24] dm cache: add passthrough mode Mike Snitzer
2013-10-24 18:30 ` [PATCH 13/24] dm cache policy: have policy_writeback_work return -ENODATA by default Mike Snitzer
2013-10-24 18:30 ` [PATCH 14/24] dm cache: use is_write_io() in more places Mike Snitzer
2013-10-25 19:53   ` Alasdair G Kergon
2013-10-25 20:11     ` Mike Snitzer
2013-10-24 18:30 ` [PATCH 15/24] dm cache: use cell_defer() boolean argument consistently Mike Snitzer
2013-10-24 18:30 ` [PATCH 16/24] dm cache: log error message if dm_kcopyd_copy() fails Mike Snitzer
2013-11-08 13:33   ` Alasdair G Kergon
2013-10-24 18:30 ` [PATCH 17/24] dm cache: use a boolean when setting cache->quiescing Mike Snitzer
2013-11-06 15:02   ` Alasdair G Kergon
2013-11-06 15:25     ` Mike Snitzer
2013-10-24 18:30 ` [PATCH 18/24] dm cache: optimize commit_if_needed Mike Snitzer
2013-10-24 18:30 ` [PATCH 19/24] dm cache: support for stackable caching policies Mike Snitzer
2013-10-24 18:30 ` [PATCH 20/24] dm cache: add era policy shim Mike Snitzer
2013-10-24 18:30 ` [PATCH 21/24] dm cache: add trc " Mike Snitzer
2013-10-25 20:13   ` Alasdair G Kergon
2013-10-25 21:08     ` Mike Snitzer [this message]
2013-10-25 22:44       ` Mike Snitzer
2013-11-01 21:39         ` Steven Rostedt
2013-11-01 23:38           ` Mike Snitzer
2013-10-24 18:30 ` [PATCH 22/24] dm cache: add hints policy Mike Snitzer
2013-10-24 18:30 ` [PATCH 23/24] dm cache: add cache block invalidation API Mike Snitzer
2013-10-24 18:30 ` [PATCH 24/24] dm cache policy era: add cache block invalidation support Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131025210820.GA7589@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ejt@redhat.com \
    --cc=heinzm@redhat.com \
    --cc=morgan.mears@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.