From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F72C433DB for ; Fri, 15 Jan 2021 22:47:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3CDF1221E2 for ; Fri, 15 Jan 2021 22:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728436AbhAOWrn (ORCPT ); Fri, 15 Jan 2021 17:47:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbhAOWrm (ORCPT ); Fri, 15 Jan 2021 17:47:42 -0500 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27D3EC0613D3 for ; Fri, 15 Jan 2021 14:47:02 -0800 (PST) Received: by mail-pj1-x1029.google.com with SMTP id cq1so5886980pjb.4 for ; Fri, 15 Jan 2021 14:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JScurv9s+g/j4cSgsjSfeApqRxZJVnspOC9oDDMdzV8=; b=QIYx26ideOsBXsSY4n1u+JFURQ+CW4hUm/VKt7rCaz66a7+EuABzbDsJpmuYribIr1 hpYawTby4rQkczz+szEfDnaKwsmFE15Mulm0O5lmQFiyzfPIDfXMzDHDtOIJvVWajEvs 4GUi2m1XJFwEqpuJHwty+GD0mlo6lLUj5QNR71lqJXeVokiIQPvS9WdBulPAJN8Azy0G 6fN8D9XgNFqfyZmSYEzQHtKEmlDDWS5J3FwYUwhnjzWYVURe8d1u+Dngq4/BZ7QE76IR 17reMI+/p0wR8eVk7kou+m8DA69KTwszMp8sUyaG52kKG4Oaju2vgUBH6YJqWszgHFRR X80w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JScurv9s+g/j4cSgsjSfeApqRxZJVnspOC9oDDMdzV8=; b=WXCPZl4ITceD9ylVBGUAo/RcJt7lFALG85pZ5iUWCpPRY4KRJF5c1u6J5TVpPu7aOW Od+hsfCMIOJ+3DG9z30KEYMzoJsbTA99W2fBJakyq3Vy3qwTcoTTvEykWRMR6KJiz0EU 1Z/FpflYYyKVwu6Pb7qMS7gSt5MLsV6YMbDFLvOyYfSTF5EPJwdSkIDOrWqbriWP7YXQ zjjH8ZygGF5LaVb0Vw9vjqqzXAEP3Xj0L2/gtjwiw0DMfndYw1TRJSK7OCiJueXc0YaX wk6xdK9R/b6BHRSQTMcQURkitpTFwc7deU8yKZlfvBaiI1Zbo8Hz62nM1UqDXBRblmfM ruCA== X-Gm-Message-State: AOAM531qvHLTrKff+FZO30CnFRt5fJGrR9vt33/rOb5DwlN4UCjB0TJV X+3iXqBRnZ4RxDpKJN80lLC5eQ== X-Google-Smtp-Source: ABdhPJxbrXCZ8HcfuarcaDF09II/yNwXUL3lpJaE3INuF0u61UTDLSj51c/bjftnpZEXklfRZ4xprw== X-Received: by 2002:a17:90a:a88e:: with SMTP id h14mr12649790pjq.59.1610750821674; Fri, 15 Jan 2021 14:47:01 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id l197sm9165931pfd.97.2021.01.15.14.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:47:00 -0800 (PST) Date: Fri, 15 Jan 2021 15:46:58 -0700 From: Mathieu Poirier To: Mike Leach Cc: Suzuki K Poulose , Leo Yan , Arnaldo Carvalho de Melo , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , Daniel Kiss , Denis Nikitin , Coresight ML , linux-arm-kernel , Linux Kernel Mailing List Subject: Re: [PATCH v1 3/7] perf cs-etm: Calculate per CPU metadata array size Message-ID: <20210115224658.GC375055@xps15> References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-4-leo.yan@linaro.org> <96ec434e-4103-02ac-a05a-761a9ca8cb0d@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2021 at 12:09:12PM +0000, Mike Leach wrote: > Hi Leo, > > I think there is an issue here in that your modification assumes that > all cpus in the system are of the same ETM type. The original routine > allowed for differing ETM types, thus differing cpu ETM field lengths > between ETMv4 / ETMv3, the field size was used after the relevant > magic number for the cpu ETM was read. > > You have replaced two different sizes - with a single calculated size. I usually go through an entire patchset before looking at the comments people have made. In this case Mike and I are coming to the exact same conclusion. I will look at Mike's patch on Monday. > > Moving forwards we are seeing the newer FEAT_ETE protocol drivers > appearing on the list, which will ultimately need a new metadata > structure. > > We have had discussions within ARM regarding the changing of the > format to be more self describing - which should probably be opened > out to the CS mailing list. > > Regards > > Mike > > > On Mon, 11 Jan 2021 at 07:29, Suzuki K Poulose wrote: > > > > On 1/9/21 7:44 AM, Leo Yan wrote: > > > The metadata array can be extended over time and the tool, if using the > > > predefined macro (like CS_ETMV4_PRIV_MAX for ETMv4) as metadata array > > > size to copy data, it can cause compatible issue within different > > > versions of perf tool. > > > > > > E.g. we recorded a data file with an old version tool, afterwards if > > > use the new version perf tool to parse the file, since the metadata > > > array has been extended and the macro CS_ETMV4_PRIV_MAX has been > > > altered, if use it to parse the perf data with old format, this will > > > lead to mismatch. > > > > > > To maintain backward compatibility, this patch calculates per CPU > > > metadata array size on the runtime, the calculation is based on the > > > info stored in the data file so that it's reliable. > > > > > > Signed-off-by: Leo Yan > > > > Looks good to me. > > > > Acked-by: Suzuki K Poulose > > > > > -- > Mike Leach > Principal Engineer, ARM Ltd. > Manchester Design Centre. UK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DBD9C433DB for ; Fri, 15 Jan 2021 22:48:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4016E221E2 for ; Fri, 15 Jan 2021 22:48:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4016E221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S2UyOKXVAO87otBqy7K1mCVYJq9caJy19Y21RgPV95c=; b=Is7NQ97Elqo1Neg38u4ZEQXWB RDhsEp4+DX96JmEFOrhozK8ksppYhQAVzfb3cWxH/DtMthvUSyfsoxOfzAEFNp0kWAtCZKXDIWZOx sMvT0/ygDWsiCyPa0UcBYh8FHSpDiCVL7X4f/APezAaLLwhMNrf9rR3uhhR+Ma9ztfHCzYbIVU95s 6jY/tHGq1GrazVGHlJ3OGBJp8TKp6aLmXah3ZWh/0BbDv9mNbv2+VUCMoWzkzS0/vpkl5XnCBfJUS lttMDf2rrLlKEnh/NmEetiioxrrNfJt9FxBttO21peolnbiodmK4En03fQ1yvkLlbmwhJI1OmXaJC fOuJll2yw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0Xs4-0002Ey-0s; Fri, 15 Jan 2021 22:47:08 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0Xrz-0002Dt-Rj for linux-arm-kernel@lists.infradead.org; Fri, 15 Jan 2021 22:47:04 +0000 Received: by mail-pj1-x1032.google.com with SMTP id p15so5798347pjv.3 for ; Fri, 15 Jan 2021 14:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JScurv9s+g/j4cSgsjSfeApqRxZJVnspOC9oDDMdzV8=; b=QIYx26ideOsBXsSY4n1u+JFURQ+CW4hUm/VKt7rCaz66a7+EuABzbDsJpmuYribIr1 hpYawTby4rQkczz+szEfDnaKwsmFE15Mulm0O5lmQFiyzfPIDfXMzDHDtOIJvVWajEvs 4GUi2m1XJFwEqpuJHwty+GD0mlo6lLUj5QNR71lqJXeVokiIQPvS9WdBulPAJN8Azy0G 6fN8D9XgNFqfyZmSYEzQHtKEmlDDWS5J3FwYUwhnjzWYVURe8d1u+Dngq4/BZ7QE76IR 17reMI+/p0wR8eVk7kou+m8DA69KTwszMp8sUyaG52kKG4Oaju2vgUBH6YJqWszgHFRR X80w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JScurv9s+g/j4cSgsjSfeApqRxZJVnspOC9oDDMdzV8=; b=ZzAi51QtdJLo4J4Ywp1I8UA1fjCQ4sUdVYQfRV3+mhP7mssdepNKR5iZLDQVarVfUf qPJQ4estrqZLcCPbtTGwCVtri2r6aVAZUDLhrPUEuI6kO17cPN5n1brRP4SlJ5imkwXA EXoQPc161vNvGfeJsSDlWfaKcpIVpiMRRbzKKFtaW85pGOCyQOT/l2ZnyPaeryLX2m9u oE/GPrjHekMOrGz0MOm3OTpXLtGKqB2Th4J4FVP5zb14AZ8qtRKPFC5m54su3UZyltRN 3k1ey2aYD1DroW3tgr9ACRm4861cCf1lbPsxPhr+j/5/H5zJ1KPumeCeMtnToHLfW2of K/MQ== X-Gm-Message-State: AOAM530vNp7mHKJ9tpg1to8f0U+t7jVp/9ZLhkfOMdKR6e8bRqvofQQI e3ELR7T5xi1palVkkt5fXp0MPQ== X-Google-Smtp-Source: ABdhPJxbrXCZ8HcfuarcaDF09II/yNwXUL3lpJaE3INuF0u61UTDLSj51c/bjftnpZEXklfRZ4xprw== X-Received: by 2002:a17:90a:a88e:: with SMTP id h14mr12649790pjq.59.1610750821674; Fri, 15 Jan 2021 14:47:01 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id l197sm9165931pfd.97.2021.01.15.14.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 14:47:00 -0800 (PST) Date: Fri, 15 Jan 2021 15:46:58 -0700 From: Mathieu Poirier To: Mike Leach Subject: Re: [PATCH v1 3/7] perf cs-etm: Calculate per CPU metadata array size Message-ID: <20210115224658.GC375055@xps15> References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-4-leo.yan@linaro.org> <96ec434e-4103-02ac-a05a-761a9ca8cb0d@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210115_174703_917710_EDC121E2 X-CRM114-Status: GOOD ( 27.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Denis Nikitin , Suzuki K Poulose , Alexander Shishkin , Jiri Olsa , Coresight ML , John Garry , Linux Kernel Mailing List , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Leo Yan , Namhyung Kim , Will Deacon , linux-arm-kernel , Daniel Kiss Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 11, 2021 at 12:09:12PM +0000, Mike Leach wrote: > Hi Leo, > > I think there is an issue here in that your modification assumes that > all cpus in the system are of the same ETM type. The original routine > allowed for differing ETM types, thus differing cpu ETM field lengths > between ETMv4 / ETMv3, the field size was used after the relevant > magic number for the cpu ETM was read. > > You have replaced two different sizes - with a single calculated size. I usually go through an entire patchset before looking at the comments people have made. In this case Mike and I are coming to the exact same conclusion. I will look at Mike's patch on Monday. > > Moving forwards we are seeing the newer FEAT_ETE protocol drivers > appearing on the list, which will ultimately need a new metadata > structure. > > We have had discussions within ARM regarding the changing of the > format to be more self describing - which should probably be opened > out to the CS mailing list. > > Regards > > Mike > > > On Mon, 11 Jan 2021 at 07:29, Suzuki K Poulose wrote: > > > > On 1/9/21 7:44 AM, Leo Yan wrote: > > > The metadata array can be extended over time and the tool, if using the > > > predefined macro (like CS_ETMV4_PRIV_MAX for ETMv4) as metadata array > > > size to copy data, it can cause compatible issue within different > > > versions of perf tool. > > > > > > E.g. we recorded a data file with an old version tool, afterwards if > > > use the new version perf tool to parse the file, since the metadata > > > array has been extended and the macro CS_ETMV4_PRIV_MAX has been > > > altered, if use it to parse the perf data with old format, this will > > > lead to mismatch. > > > > > > To maintain backward compatibility, this patch calculates per CPU > > > metadata array size on the runtime, the calculation is based on the > > > info stored in the data file so that it's reliable. > > > > > > Signed-off-by: Leo Yan > > > > Looks good to me. > > > > Acked-by: Suzuki K Poulose > > > > > -- > Mike Leach > Principal Engineer, ARM Ltd. > Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel