From patchwork Fri Oct 25 21:08:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 3097541 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0FBE4BF924 for ; Fri, 25 Oct 2013 21:12:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D86EB202EC for ; Fri, 25 Oct 2013 21:11:58 +0000 (UTC) Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mail.kernel.org (Postfix) with ESMTP id B21A2202BE for ; Fri, 25 Oct 2013 21:11:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9PL8Ngd019564; Fri, 25 Oct 2013 17:08:24 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9PL8LZf009761 for ; Fri, 25 Oct 2013 17:08:21 -0400 Received: from localhost ([10.18.25.126]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r9PL8KqH018950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 25 Oct 2013 17:08:21 -0400 Date: Fri, 25 Oct 2013 17:08:21 -0400 From: Mike Snitzer To: Alasdair G Kergon Message-ID: <20131025210820.GA7589@redhat.com> References: <1382639437-27007-1-git-send-email-snitzer@redhat.com> <1382639437-27007-22-git-send-email-snitzer@redhat.com> <20131025201356.GM17070@agk-dp.fab.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20131025201356.GM17070@agk-dp.fab.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: dm-devel@redhat.com Cc: Morgan Mears , Heinz Mauelshagen , dm-devel@redhat.com, Joe Thornber Subject: Re: [dm-devel] [PATCH 21/24] dm cache: add trc policy shim X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Oct 25 2013 at 4:13pm -0400, Alasdair G Kergon wrote: > On Thu, Oct 24, 2013 at 02:30:34PM -0400, Mike Snitzer wrote: > > From: Morgan Mears > > > 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(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel 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)