Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2585418pxa; Mon, 17 Aug 2020 13:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMnMRzJfGsn1hU76j1lRt6nRbLBs+Sch0Fv+KLhELCuh1xPfclaamcgNLp5RfIk/ikHaSt X-Received: by 2002:a17:906:2e86:: with SMTP id o6mr17530571eji.380.1597696189647; Mon, 17 Aug 2020 13:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597696189; cv=none; d=google.com; s=arc-20160816; b=lYBBoj0RITveREN98DXYKK5POm8tj+dNx5e/lGnf9J5j0k6FW7d4RDXe9gXLv0xImZ /PuIeUrKWJhlDbwjFjg7vuClqg5WqHTa+b1ZmEiPazglFymknKyFvfiLAEW5ddsdYVIv bQLDAhOIUqYurZylE2G3gqNxYQ01zctYl0JDr8hfxwJJbWtXQoGzXotHU2Y1QahwLG8w dMoHVp1AFuz5AFQxI23QjqWaFGXpNqzxPScbAj/uoKW4LSfmxvaULB8igCRDVjGhxMS5 6fWqHahcemKWRc/XYhMqCZCkPNyRAM1osB2EIHatK4I7T3If72YvGMGtSFXvJFutWwWJ Z61w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=IQJzLZaExmhEcQ2VqVMpTJoxZVI/u4dUItWh2z2beMU=; b=FCOv8jKZfkEX48d3GNeXlVuP8GJPKRzXPRQuic9nfkJHJT+e5J5S/9Bo1mbcPmBR8C vWWw/5UelVm/aSo2IGT1c01bvcEwFJffaamihpYMC6gROoI/FBE35cbEX7JuXYsMT+BH yjYiWH0NZRpP9U8Vt0Y2QaQXe9yYyv5P63CLWg0PgCpcS2WOuYH00OP3JpeYYD49x8us Vi/CEZqs7Rqd3MxdKMlISlD+2B4YvrTZa+ATpj59mO3fTTGI6WPYAUxosJzAsoQZRCbC ew55KH29tuPVhRQO8G9PQ1vVGMnPH1FMDzItndx7KiHEjtblsZMetpCTmmlSq4HAgSfc HdTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by18si11503558ejb.185.2020.08.17.13.29.25; Mon, 17 Aug 2020 13:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbgHQLou (ORCPT + 99 others); Mon, 17 Aug 2020 07:44:50 -0400 Received: from mga12.intel.com ([192.55.52.136]:33588 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbgHQLos (ORCPT ); Mon, 17 Aug 2020 07:44:48 -0400 IronPort-SDR: F5tImus1N4GBNkLglbn4Ctg0jpjMPxiUOoorL/f6LNyq2DNoR0/i2HMYRMSEPhTsMtRCemkfNo 8f8eXV9S2lfA== X-IronPort-AV: E=McAfee;i="6000,8403,9715"; a="134199126" X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="134199126" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 04:44:44 -0700 IronPort-SDR: bHApQlytgHJ6jq4V5bD6qw1c6k+ZY506s+KQj12iysHBxz7oQMzh1q8f6HPp17WTGF6XLOWLww Z9NOH4giSXgA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="326385168" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008.jf.intel.com with ESMTP; 17 Aug 2020 04:44:42 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1k7dZB-009IwK-Gv; Mon, 17 Aug 2020 14:44:41 +0300 Date: Mon, 17 Aug 2020 14:44:41 +0300 From: Andy Shevchenko To: Joe Perches Cc: LKML , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes Subject: Re: [RFC PATCH] vsprintf: Add %pv extension replacement for print_vma_addr Message-ID: <20200817114441.GK1891694@smile.fi.intel.com> References: <09f11651f0e913e159b955ac447cd8cadf36cb0d.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <09f11651f0e913e159b955ac447cd8cadf36cb0d.camel@perches.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 14, 2020 at 10:53:03AM -0700, Joe Perches wrote: > There is a print_vma_addr function used several places > that requires KERN_CONT use. > > Add a %pv mechanism to avoid the need for KERN_CONT. I like the idea, but I would accent the selling point to make code (in the user call sites) nicer. > An example conversion is arch/x86/kernel/signal.c > > from: > if (show_unhandled_signals && printk_ratelimit()) { > printk("%s" > "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx", > task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG, > me->comm, me->pid, where, frame, > regs->ip, regs->sp, regs->orig_ax); > print_vma_addr(KERN_CONT " in ", regs->ip); > pr_cont("\n"); > to: > printk("%s" > "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx in %pv\n", > task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG, > me->comm, me->pid, where, frame, > regs->ip, regs->sp, regs->orig_ax, (void *)regs->ip); ... > +#else > + buf = string_nocheck(buf, end, "CONFIG_MMU=n", default_str_spec); > +#endif Can we avoid this spammy message? Really it's quite long and fills valuable space in kernel buffer. I would rather print the hashed pointer as it's done for the rest of %pXXX. -- With Best Regards, Andy Shevchenko