From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751569AbcGTFFG (ORCPT ); Wed, 20 Jul 2016 01:05:06 -0400 Received: from mail-qk0-f178.google.com ([209.85.220.178]:32783 "EHLO mail-qk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750810AbcGTFFE (ORCPT ); Wed, 20 Jul 2016 01:05:04 -0400 Date: Wed, 20 Jul 2016 01:05:00 -0400 (EDT) From: Nicolas Pitre To: Joe Perches cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Viro , David Howells , Greg Ungerer Subject: Re: [PATCH v3 02/12] binfmt_flat: convert printk invocations to their modern form In-Reply-To: <1468989000.1900.94.camel@perches.com> Message-ID: References: <1468988424-32671-1-git-send-email-nicolas.pitre@linaro.org> <1468988424-32671-3-git-send-email-nicolas.pitre@linaro.org> <1468989000.1900.94.camel@perches.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1881906319-1468991102=:27128" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1881906319-1468991102=:27128 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Tue, 19 Jul 2016, Joe Perches wrote: > On Wed, 2016-07-20 at 00:20 -0400, Nicolas Pitre wrote: > > diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c > [] > > @@ -15,6 +15,8 @@ > >   * JAN/99 -- coded full program relocation (gerg@snapgear.com) > >   */ > >   > > +#define pr_fmt(fmt) "BINFMT_FLAT: : " fmt > > Why the double colon? Go figure. > Much more common would be > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Sure. I used the all-caps version as that's what most former printk's used. But if you say KBUILD_MODNAME is more common then I have no issue with that. > > > @@ -106,8 +98,8 @@ static struct linux_binfmt flat_format = { > >   > >  static int flat_core_dump(struct coredump_params *cprm) > >  { > > - printk("Process %s:%d received signr %d and should have core dumped\n", > > - current->comm, current->pid, cprm->siginfo->si_signo); > > + pr_warning("Process %s:%d received signr %d and should have core dumped\n", > > +    current->comm, current->pid, cprm->siginfo->si_signo); > > Prefer pr_warn OK. Updated in my repo and pushed out. > >   return(1); > >  } > >   > > @@ -190,17 +182,17 @@ static int decompress_exec( > >   loff_t fpos; > >   int ret, retval; > >   > > - DBG_FLT("decompress_exec(offset=%lx,buf=%p,len=%lx)\n",offset, dst, len); > > + pr_debug("decompress_exec(offset=%lx,buf=%p,len=%lx)\n",offset, dst, len); > > Generally unnecessary as the function tracer works well Not necessarily on uClinux where you might not aford it. And this patch is about converting existing printk()'s so if some of them should be removed then it would be best to do that separately. > >   memset(&strm, 0, sizeof(strm)); > >   strm.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); > >   if (strm.workspace == NULL) { > > - DBG_FLT("binfmt_flat: no memory for decompress workspace\n"); > > + pr_debug("no memory for decompress workspace\n"); > >   return -ENOMEM; > >   } > >   buf = kmalloc(LBUFSIZE, GFP_KERNEL); > >   if (buf == NULL) { > > - DBG_FLT("binfmt_flat: no memory for read buffer\n"); > > + pr_debug("no memory for read buffer\n"); > > Unnecessary OOM messages as allocs do a stack dump Again this should probably be done separately. Nicolas --8323329-1881906319-1468991102=:27128--