Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp551728pxb; Wed, 11 Nov 2020 10:05:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrLdpyqp5kWnr8j8iFI1nT2ulUyoqWhQLOwvIxBRNeKi1ZbVkBh9Z9OYggfml5j8powwKy X-Received: by 2002:a17:906:ca93:: with SMTP id js19mr27821426ejb.537.1605117901799; Wed, 11 Nov 2020 10:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605117901; cv=none; d=google.com; s=arc-20160816; b=BVOuJmmZXrSWzA4dZO2snUVNE4sZ/+0bVE6WbKcQLCkY0N44NLlfN58r6C6J4RLcZk VKETmseITd3FkH6mV7Et9Io6ff393WFW9m9JG9z0uE/9qUgeJGldrOtcz8ZjTLm1+FzY YWyn1THHwP+gnLs3pio2FdIfSPJpQAxu8b5IZDrUPzMoGsdl/ND9QQ7vQDKcBWHh2XVe xa6mKYJzgQoEbMXLZC9Cwatvr8PAi096YMHy9idD/0pHByQfN1k9lTsfLyJMp7BN2qHM pMWDnUzcPIy/Ixm7AcYpjxTgs5hyps+z5YeaxSbSTh3W2hhd9mqaIySUtbSUncguKvN3 sBiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Oceaz0FnA36CZltaosKt+H8c7X0UGzZnaBd/n2TlllY=; b=KE6M+woO6rdpkGSqsdhwIzTgs4C0UFu4hjTZZf8CflOTJ1T2FXYkslqVdEELN3Jy32 3u4B8uhGpcmvnnPzmSQInk6zz1wRjMR0E06q1FCm8t3QjgOvsB1FA3TBilLzMQMFDwUs hxlIVsUVsTCJZvgibUNnmn00DLHi9B7EPw9L0g09YQZKaBkbYT1u3WiA4l5HU/6dyMcw sfGsORUsVLkBS3+tUFX8l3BcA6Q42SKay90tijtmE8NcyBmHra6ibXRtDOJAj5m89zy6 dazvT3US2/7X6UYQmryWeptqYqvi0YW8mXyMCpVaz6yOnQU63Ilh367EdXetys7Ufn0U 7DCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rhB4e5ze; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si2037808edx.179.2020.11.11.10.04.37; Wed, 11 Nov 2020 10:05:01 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=rhB4e5ze; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726134AbgKKSBd (ORCPT + 99 others); Wed, 11 Nov 2020 13:01:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:41596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbgKKSBa (ORCPT ); Wed, 11 Nov 2020 13:01:30 -0500 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 052A5206B6; Wed, 11 Nov 2020 18:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605117690; bh=rWIlCSVLkxy6U/Oi8BLJipuAg6hfbgdqGmwN3XRb5NQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rhB4e5zezCUflGLHAy5npSm00xFopJIbgN4b5ju8T3p34nghdDlSzKKE85MLRAAns hb6VapXatmNnYp6avXw33gpt2kbM9b1++XJOUHby6vVXMfSBDDSgMv1RtMqEMNH+AM 995Y4fU95RHGjpV3xK1/f0cEw0fiX1B90AMIzehc= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 29330411D1; Wed, 11 Nov 2020 15:01:27 -0300 (-03) Date: Wed, 11 Nov 2020 15:01:27 -0300 From: Arnaldo Carvalho de Melo To: Dave Martin Cc: Andre Przywara , "leo.yan@linaro.org" , James Clark , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Al Grant , Wei Li , John Garry , Will Deacon , Mathieu Poirier , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v8 06/22] perf arm-spe: Refactor printing string to buffer Message-ID: <20201111180127.GD380127@kernel.org> References: <20201111071149.815-1-leo.yan@linaro.org> <20201111071149.815-7-leo.yan@linaro.org> <20201111153555.GG355344@kernel.org> <20201111173922.GA380127@kernel.org> <20201111175827.GR6882@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201111175827.GR6882@arm.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Nov 11, 2020 at 05:58:27PM +0000, Dave Martin escreveu: > > On Wed, Nov 11, 2020 at 05:39:22PM +0000, Arnaldo Carvalho de Melo wrote: > > Em Wed, Nov 11, 2020 at 03:45:23PM +0000, Andr� Przywara escreveu: > > > On 11/11/2020 15:35, Arnaldo Carvalho de Melo wrote: > > > > Isn't this 'ret +=' ? Otherwise if any of these arm_spe_pkt_snprintf() > > > > calls are made the previous 'ret' value is simply discarded. Can you > > > > clarify this? > > > ret is the same as err. If err is negative (from previous calls), we > > > return that straight away, so it does nothing but propagating the error. > > Usually the return of a snprintf is used to account for buffer space, ok > > I'll have to read it, which I shouldn't as snprintf has a well defined > > meaning... > > Ok, now that I look at it, I realize it is not a snprintf() routine, but > > something with different semantics, that will look at a pointer to an > > integer and then do nothing if it comes with some error, etc, confusing > > :-/ > Would you be happier if the function were renamed? > Originally we were aiming for snprintf() semantics, but this still > spawns a lot of boilerplate code and encourages mistakes in the local > caller here -- hence the current sticky error approach. > So maybe the name should now be less "snprintf"-like. Please, its important to stick to semantics for such well known type of routines, helps reviewing, etc. I'll keep the series up to that point and will run my build tests, then push it publicly to acme/perf/core and you can go from there, ok? I've changed the BIT() to BIT_ULL() as Andre suggested and I'm testing it again. - Arnaldo