Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp357379ybx; Wed, 6 Nov 2019 01:38:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyO1nOmVHD8p87Ci0AdFsYFZ6LiNsPCWXNPvCaFzc+C/J2L+V6IyoYUa/Bjii1q++JKYvNi X-Received: by 2002:a17:906:6d82:: with SMTP id h2mr33781759ejt.127.1573033104472; Wed, 06 Nov 2019 01:38:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573033104; cv=none; d=google.com; s=arc-20160816; b=zohecvmfSl1a4BbkhuPVs208mWTsKfU34rh5h1pjLuhcxa+EK5RIygHckvkvFHCDeO E2ZGx7jYzk4yC6YATAOpBqQ/07eG/RT6NKP/2D36WesmFUIyirSOpyipUldlu6+r1iR0 +w9mDLwKStgwgScZ33PKtoCrKtbLb4R9JEeRcSMeVFivXzLPkUfcvKghYYvWL4nu2INB +/izMFVIIfER78jEj5C72JXagWdxSnJQ5mo+/ZJHaIhupQqqEBhz9ygMPJBA+7RyVksS pVoLhayCUgICsCvrPeR0+FtSNTpMnxDW3tSGAC+N/N24y7tJtPCM9T0a0xLpBN2iSTaW cE5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2clN21ulk8X5SCPB5SHqoYl0DDJFsGPUWNMSn774SdE=; b=JDjHrrLWGsxRJFDCjjGLW2aUPq0P2sUm6G/2wSokY+Ir+IAtV5JqAe93J7KK0xK/uX rL3D6sRKd8T2IPI83wEWmLfDyowaVBVGRtnDRCqYJqX6pv9IfmMxASsmoiQ30/VbAXIi 0GR8vBPxOfu7xrTbbFIihthxnHfWJethq5cUryIEGUWTSAwiBkWqO5WsvL6Fz7GbWd+W R6j0Xx7Q8JnM6yms0VPsma6UbgrRTwudGLwc/nwKdaJ9KDcX1zmz4g/TfsfujKw6yio5 CRN3vPWI3HjJkuwFq3QbfiqFAh+En0gvb7JdTGYGHSVBE7lrRHimZ5FQhTKuW6sdWiQW dN2Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b49si10501581eda.312.2019.11.06.01.38.01; Wed, 06 Nov 2019 01:38:24 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731877AbfKFJeZ (ORCPT + 99 others); Wed, 6 Nov 2019 04:34:25 -0500 Received: from mga06.intel.com ([134.134.136.31]:23359 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731759AbfKFJeY (ORCPT ); Wed, 6 Nov 2019 04:34:24 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 01:34:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,274,1569308400"; d="scan'208";a="214185072" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga002.jf.intel.com with ESMTP; 06 Nov 2019 01:34:21 -0800 Received: from andy by smile with local (Exim 4.93-RC1) (envelope-from ) id 1iSHhk-00008U-Ls; Wed, 06 Nov 2019 11:34:20 +0200 Date: Wed, 6 Nov 2019 11:34:20 +0200 From: Andy Shevchenko To: Steven Rostedt Cc: Piotr Maziarz , linux-kernel@vger.kernel.org, mingo@redhat.com, cezary.rojewski@intel.com, gustaw.lewandowski@intel.com Subject: Re: [PATCH 1/2] seq_buf: Add printing formatted hex dumps Message-ID: <20191106093420.GZ32742@smile.fi.intel.com> References: <1573021660-30540-1-git-send-email-piotrx.maziarz@linux.intel.com> <20191106035317.7558e47e@grimm.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191106035317.7558e47e@grimm.local.home> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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, Nov 06, 2019 at 03:53:17AM -0500, Steven Rostedt wrote: > On Wed, 6 Nov 2019 07:27:39 +0100 > Piotr Maziarz wrote: > > + for (i = 0; i < len; i += rowsize) { > > + linelen = min(remaining, rowsize); > > + remaining -= rowsize; > > Probably should make the above: > > remaining -= linelen; > > Yeah, what you have works, but it makes a reviewer worry about using > remaining later and having it negative. OTOH, the original function and followers (like seq_hex_dump() one) are using exactly above form. Maybe for the sake of consistency we may do the same and then fix all at once. Or other way around, amend the rest first. > > + case DUMP_PREFIX_ADDRESS: > > I'm curious to know what uses the above type? By default, today, > pointers are pretty much obfuscated, and that will show up here too. Good question. Current users are: arch/microblaze/kernel/traps.c arch/x86/kernel/mpparse.c drivers/crypto/axis/artpec6_crypto.c drivers/crypto/caam/... drivers/crypto/ccree/cc_driver.c drivers/crypto/qat/qat_common/adf_transport_debug.c drivers/dma/xgene-dma.c drivers/mailbox/mailbox-test.c drivers/net/can/usb/ucan.c drivers/net/ethernet/cadence/macb_main.c drivers/net/ethernet/cavium/liquidio/octeon_droq.c drivers/net/ethernet/intel/... drivers/net/ethernet/mellanox/mlx5/core/en_tc.c drivers/usb/gadget/function/f_ncm.c fs/ext4/super.c fs/jfs/... mm/page_poison.c mm/slub.c Not many. My understanding that it's still useful in conjunction with some other messages where pointers are printed and developer, who is reading the logs, may match them and do some conclusions. > > + } -- With Best Regards, Andy Shevchenko