linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@leon.nu>
To: David Howells <dhowells@redhat.com>
Cc: Linux-MM <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-cachefs <linux-cachefs@redhat.com>,
	linux-afs <linux-afs@lists.infradead.org>
Subject: Re: [RFC] Refactor kenter/kleave/kdebug macros
Date: Mon, 18 May 2015 16:23:07 +0300	[thread overview]
Message-ID: <CALq1K=J4iRqD5qiSr2S7m+jgr63K7=e1PmA-pX1s4MEDimsLbw@mail.gmail.com> (raw)
In-Reply-To: <7254.1431945085@warthog.procyon.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2769 bytes --]

On Mon, May 18, 2015 at 1:31 PM, David Howells <dhowells@redhat.com> wrote:

> I can turn on all the macros in a file just be #defining __KDEBUG at the
> top.
> When I first did this, pr_xxx() didn't exist.
>
> Note that the macros in afs, cachefiles, fscache and rxrpc are more complex
> than a grep tells you.  There are _enter(), _leave() and _debug() macros
> which
> are conditional via a module parameter.  These are trivially individually
> enableable during debugging by changing the initial underscore to a 'k'.
> They
> are otherwise enableable by module parameter (macros are individually
> selectable) or enableably by file __KDEBUG.  These are well used.  Note
> that
> just turning them all into pr_devel() would represent a loss of useful
> function.
>
> The ones in the keys directory are also very well used, though they aren't
> externally selectable.  I've added functionality to the debugging, but
> haven't
> necessarily needed to backport it to earlier variants.
>
> For the mn10300 macros, I would just recommend leaving them as is.
>
> For the nommu macros, you could convert them to pr_devel() - but putting
> all
> the information in the kenter/kleave/kdebug macro into each pr_devel macro
> would be more intrusive in the code since you'd have to move the stuff out
> of
> there macro definition into each caller.  You could also reexpress the
> macros
> in terms of pr_devel and get rid of the conditional.  OTOH, there's not
> that
> much in the nommu code, so you could probably slim down a lot of what's
> printed.
>
> For the cred macro, just convert to pr_devel() or pr_debug() and make
> pr_fmt
> insert current->comm and current->pid.
>
> > 2. Move it to general include file (for example linux/printk.h) and
> > commonize the output to be consistent between different kdebug users.
>
> I would quite like to see kenter() and kleave() be moved to printk.h,
> expressed in a similar way to pr_devel() or pr_debug() (and perhaps renamed
> pr_enter() and pr_leave()) but separately so they can be enabled
> separately.
> OTOH, possibly they should be enableable by compilation block rather than
> by
> macro set.
>
> The main thing I like out of the ones in afs, cachefiles, fscache and
> rxrpc is
> the ability to just turn on a few across a bunch of files so as not to get
> overwhelmed by data.
>
Blind conversion to pr_debug will blow the code because it will be always
compiled in. In current implementation, it replaced by empty functions
which is thrown by compiler.

Additionally, It looks like the output of these macros can be viewed by
ftrace mechanism.

Maybe we should delete them from mm/nommu.c as was pointed by Joe?



>
> David
>



-- 
Leon Romanovsky | Independent Linux Consultant
        www.leon.nu | leon@leon.nu

[-- Attachment #2: Type: text/html, Size: 3697 bytes --]

  reply	other threads:[~2015-05-18 13:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-16 17:01 Leon Romanovsky
2015-05-16 17:09 ` Joe Perches
2015-05-16 18:56   ` Leon Romanovsky
2015-05-18 10:31 ` David Howells
2015-05-18 13:23   ` Leon Romanovsky [this message]
2015-05-18 13:27     ` Leon Romanovsky
2015-05-18 13:29   ` David Howells
2015-05-18 13:52     ` Leon Romanovsky
2015-05-18 15:20     ` David Howells
2015-05-18 18:35       ` Leon Romanovsky

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='CALq1K=J4iRqD5qiSr2S7m+jgr63K7=e1PmA-pX1s4MEDimsLbw@mail.gmail.com' \
    --to=leon@leon.nu \
    --cc=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox