Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp552032pxb; Wed, 11 Nov 2020 10:05:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyV/7wV0HzZwaC8tx2mBKqGRnq9pp67LF1ZuLWD1ZQZDNDvT73AKdm3zJJ4qXaUJhV9Hvv5 X-Received: by 2002:aa7:d351:: with SMTP id m17mr728524edr.215.1605117920811; Wed, 11 Nov 2020 10:05:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605117920; cv=none; d=google.com; s=arc-20160816; b=jI1VDVrEA+/fjOsUt35bMz0JUC1RReg/xoKLiofe+HYzksSnb1Mgvlvl6DmJB3G/uk a+YfoAbr7T6fxIjaFRVlaml56kXJO0bMk26uSFAAuT5+4kclLLTMRQHBiCaywlK0Xa0i KghsdF8WW2wolUT3mgr6iq/PnB1n0xtUfATXdO+A8Td+iz3TrIJD5CPdUUr4yVy9NPle ouc713r+cT+GTORVDrFEI8whawgvXeuWZ+bFVdyz6pf/krnVsEe/SQfchJIJdLoC/jf6 2PrIw6kImLgbow8P2WQisKVyq7nG6W6aADjMmo4DKZRAABhSLxG3L1nRPbC+PF19iMRG AThg== 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=pb9bHKfw7VEaCzo4HDOyUbPnBsxLZeo1nQFLj1KzV+M=; b=w0+gEmskVyzwjHTDtw5WDilBlJzsA2/crYkVQdeMHKLr35aT22l5jBRE6CFBlbg7lk sMsXVOqSdT1dXs619Q/+dF3jYK/Q4LXCy1iDz5hG2E9bRNZ6YrZMeOoc4nXx7QaKGWqY ymmbrhCG7EjLuWmzXRX8tQLEI5k1mzlII/mcnoBUiEszvBsQVSlrLYXOak+CGczan5hY ufB1zGiRMO+LhhzSpQ1UpRs19mSZB8G03+vR1ZciUgEoKui4k6AtWsOk6aeo4NDr7229 2HHFmIj1RNgq90G/np0tZpnFrp+I2dhZ6gKiUDulR/P03YjbV7UmoHYhDkWBpNNVN3mA wUxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gSHahqpD; 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 e26si2070005edr.162.2020.11.11.10.04.56; Wed, 11 Nov 2020 10:05:20 -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=gSHahqpD; 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 S1726915AbgKKSCv (ORCPT + 99 others); Wed, 11 Nov 2020 13:02:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:41956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbgKKSCv (ORCPT ); Wed, 11 Nov 2020 13:02:51 -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 26954206B6; Wed, 11 Nov 2020 18:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605117770; bh=c6+pW3lw+shG0mbohxs3JzOIRUMxGkhGMDw53k5Zi58=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gSHahqpDqc2+mMs7hvXeTkPg8ndmvVZJHEdDq0fkvTlTbNkHQwPp/LElIAG86ERkL nKOlPA4Wl3iJe1vgsUK1O5w9lzLKxU0+QWBzuvMEW8G8OztqlpktfO8WofoX7Wq40J uGxQLvrDkGpOpcVV0U2nTyBnhYfkGA8mOa4d8mc4= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 210B2411D1; Wed, 11 Nov 2020 15:02:48 -0300 (-03) Date: Wed, 11 Nov 2020 15:02:48 -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: <20201111180248.GE380127@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> <20201111180127.GD380127@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201111180127.GD380127@kernel.org> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Nov 11, 2020 at 03:01:27PM -0300, Arnaldo Carvalho de Melo escreveu: > 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. To make it clear, this is what I have locally: 0a04244cabc5560c (HEAD -> perf/core) perf arm-spe: Fix packet length handling b65577baf4829092 perf arm-spe: Refactor arm_spe_get_events() b2ded2e2e2764e50 perf arm-spe: Refactor payload size calculation 903b659436b70692 perf arm-spe: Fix a typo in comment c185f1cde46653cd perf arm-spe: Include bitops.h for BIT() macro 40714c58630aaaf1 perf mem: Support ARM SPE events c825f7885178f994 perf c2c: Support AUX trace 13e5df1e3f1ba1a9 perf mem: Support AUX trace 014a771c7867fda5 perf auxtrace: Add itrace option '-M' for memory events 436cce00710a3f23 perf mem: Only initialize memory event for recording 8b8173b45a7a9709 perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE 4ba2452cd88f39da perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE eaf6aaeec5fa301c perf mem: Introduce weak function perf_mem_events__ptr() f9f16dfbe76e63ba perf mem: Search event name with more flexible path 644bf4b0f7acde64 (tag: perf-tools-tests-v5.11-2020-11-04, acme/perf/core) perf jevents: Add test for arch std events The perf-tools-tests-v5.11-2020-11-04, is in git.kernel.org, as it was tested, etc, test results are in that signed tag, as usual for some months. - Arnaldo