Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp87498img; Wed, 27 Mar 2019 17:36:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXrXxdH07mSkmFo6ZyyoYG4j9cKAREIXWoNomVeyBG28hPhqMmKOiAARSViTyHXjpjNjAC X-Received: by 2002:a17:902:bb0c:: with SMTP id l12mr40436758pls.108.1553733375436; Wed, 27 Mar 2019 17:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553733375; cv=none; d=google.com; s=arc-20160816; b=M9JJ1eTHTti0QHCRq+etWArRLLpSypGTsx91Qtu+BxYKauIDaFzVybIalrO40RmuHb 4ZPRGRc9o8xJE0v4P/TcFqQ2QrC/Os8z2D7ZBiAzG8i38SZhkFdNKVosYQCVtsYvjJVC 1lxALt/H1AVYMnHjQ3/QgBdTCKdVpShSNKxuCQcXaG8x7pTYGg7623+O2jnM3KM9AYPd MzFib7zulfDnwb/gUmoheiONriBd3ReNSNc0EEyhUx6iI2DiY2Om3Pfs/Qp458vRmpvK a/nFOOwf3zYKYVnGzTfZI2lcLtKj8kzbxGwDGIZsZC7/yTsb38l2Bo/WPd+3wOnPYEre OV8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:dkim-filter :date; bh=TrI78oTepP+/CgsWTM9cBNDK2/IRtIFgHtRujH+NxYM=; b=MbS05tuthorLpQz7x8wnB+EUuz/TYCFh5SF3BLxBIxWRW/PEdKPTUsdTLV3vEWm/mo +9QzY8jspn9fafEO9c6tKAqNy2pEOYf90iSVXFaSR5Osd1BdbSMAouPTb4vDs1HWKNrm j32pufIMNTdEMINgYgSaLttuFXM9SV6By7UlTx1AZ96ad8kzLk+9R6meyw4l4P2VT+Hb uc2KFZPum+4zRY6CTTjsaVYp/wufUpynnWg0FYtXXjhdsmPi4JVytV6Po67ejOnynuhS ELRhsPB+NHVu5R2pYS1dsMvutmfZUIuqcXtzlgIry3ej2R9B9rs9ZPzjUiTlJB0qhtTS 7eCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@innovation.ch header.s=default header.b=X7tj1Dfl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=innovation.ch Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si20092763pfc.120.2019.03.27.17.35.58; Wed, 27 Mar 2019 17:36:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@innovation.ch header.s=default header.b=X7tj1Dfl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=innovation.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727210AbfC1AfA (ORCPT + 99 others); Wed, 27 Mar 2019 20:35:00 -0400 Received: from chill.innovation.ch ([216.218.245.220]:46602 "EHLO chill.innovation.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbfC1AfA (ORCPT ); Wed, 27 Mar 2019 20:35:00 -0400 Date: Wed, 27 Mar 2019 17:34:59 -0700 DKIM-Filter: OpenDKIM Filter v2.10.3 chill.innovation.ch 5A70F64012F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=innovation.ch; s=default; t=1553733299; bh=TrI78oTepP+/CgsWTM9cBNDK2/IRtIFgHtRujH+NxYM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X7tj1DflzaQmoYDxflPKzm+wgPdR8/k+1VOPUxwPkZdS+X/USt53pl/YP1MZ1Fog8 eBv6QIU/8wJepJrYqAkDc725hYVaxf4UCdSVcdwSQwksNJWb2vbf/NUKIVcS+2/2oc MoRJlQP8lI05LIz/PrOd559/hEzmVQMQV+siitnpKyC+ajFvAK3xzYesSBFFgl3NJo YgvUHIkRU41NMKcjvd+UQ8hyyPJ9/Z0DReGq8XTI2sO8CI9+XA/oJFs8TO27uDyIRw mCJtCuSCXdSUi7fEygKl7eQCiGi+udw7iHLvbeadzrXbvb0z/RKJyNwZmGuNZLYVr3 sVkO0G90JudBg== From: "Life is hard, and then you die" To: Andy Shevchenko Cc: Dmitry Torokhov , Henrik Rydberg , Andy Shevchenko , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lukas Wunner , Federico Lorenzi , linux-input , Linux Kernel Mailing List Subject: Re: [PATCH v3 2/4] lib/hexdump.c: factor out generic hexdump formatting for reuse. Message-ID: <20190328003459.GG24753@innovation.ch> References: <20190327014807.7472-1-ronald@innovation.ch> <20190327014807.7472-3-ronald@innovation.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2019 at 09:46:48AM +0200, Andy Shevchenko wrote: > On Wed, Mar 27, 2019 at 3:49 AM Ronald Tschal?r wrote: > > > > This introduces print_hex_dump_to_cb() which contains all the hexdump > > formatting minus the actual printk() call, allowing an arbitrary print > > function to be supplied instead. And print_hex_dump() is re-implemented > > using print_hex_dump_to_cb(). > > > > This allows other hex-dump logging functions to be provided which call > > printk() differently or even log the hexdump somewhere entirely > > different. > > No Sign-off? Yeah, my screwup. > In any case, don't do it like this. smaller non-recursive printf() is > better than one big receursive call. > When it looks like an optimization, it's actually a regression. Not sure where you see recursion here - are you referring to the callback approach? Since dev_printk() ends up calling printk with a dictionary as well as additional formatting, vs print_hex_dump()'s stright use of printk, this seemed like the best way accommodate various possible ways of logging the messages. But as per below I guess this is moot. > And yes, debugfs idea is not bad. So it seems like that is the consensus. As per my other response, I'll do this then and leave the print_hex_dump() alone. > P.S. Also check %*ph specifier. Thanks! Cheers, Ronald