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 BDE3EC433E6 for ; Mon, 11 Jan 2021 12:10:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7782420719 for ; Mon, 11 Jan 2021 12:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726732AbhAKMKG (ORCPT ); Mon, 11 Jan 2021 07:10:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbhAKMKF (ORCPT ); Mon, 11 Jan 2021 07:10:05 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB5F7C061786 for ; Mon, 11 Jan 2021 04:09:24 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id e25so14876272wme.0 for ; Mon, 11 Jan 2021 04:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qAfBPpGti4IJb/cZMqnoVtqAcc2r4v07Ip2T/G5Ovz4=; b=uhMWbETIOgCPmlXFR2NKajl5ifHGLOYARBG1WPZ8kSXAvb5hSGYLFYetzZdbqRoUXw xyoBqCRr7vFo267aAYXOqWj3rTMXUbjHBghJ73ThVlXv3QXTjOVXJNI081o+qc8BihBG mqA8IW2z2GvDodU1XdOMOVukxzYjnJtfjTSp2LYXXmSxkPUWuGSjRPQTkZ1Lp87EEAYG 7oLO9EgDedzdO1fBq/KET0Rxo23I+mWfD5OsJ4C72D0JOLcDLkaKuPgFTXxo394F7/Wz 5WRpwOeU4zxwdsFyKXWPgwHVd4GW6rDPEbyuDothVcY1nfCiTuERlF9Z941tsp9zf/yd kygA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qAfBPpGti4IJb/cZMqnoVtqAcc2r4v07Ip2T/G5Ovz4=; b=Qy3ejeFNd9p1tKGUJLFhKpGQRLi2gJjGq/FsHGiA8U4cMC5G2aQJUpwCMkwu7VSj7J PUdl08YvioeTVaRmqiEIJ8eR/sc0GdaZlLpYkYStwIdKV0ZeKjTTAiGF7V/k99WWjzd+ X5JUxA+T/wGsgci5s73+8Dt5iSEtpGdgpViwsUltKiEVYyE4u+XjRgKJBn9WElFqf9W2 y7gTKTNWx1+rFBibDuUtK1nI17NbGuZGh4fyyJWlpUzbo+4AN3564ds1czIyUq5Zco3o 2z3X1+rS9lZgodZQkBSWMqDk1dn0xTp8NFT+buFFiZ4tcvHFEXRsU7i2YDs/Ud2moRHe hHhA== X-Gm-Message-State: AOAM5304FFi3KwXXOr3waUeQLbl+DgPc+X8Fkk8IUXefhYP/hDSBP0Xx iEGxy6+svAbsMlsKRcMDaoW4no+R9c8G9SiZBbXyqQ== X-Google-Smtp-Source: ABdhPJzDeFk/mOQloneLtj4kfha+Qnij5WrMFQUSxRNUrw8SRxCA+cQtKp2UGtisY7+fW/cX3oO00jllzN2ejjxl2AI= X-Received: by 2002:a7b:c7d3:: with SMTP id z19mr14624684wmk.31.1610366963630; Mon, 11 Jan 2021 04:09:23 -0800 (PST) MIME-Version: 1.0 References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-4-leo.yan@linaro.org> <96ec434e-4103-02ac-a05a-761a9ca8cb0d@arm.com> In-Reply-To: <96ec434e-4103-02ac-a05a-761a9ca8cb0d@arm.com> From: Mike Leach Date: Mon, 11 Jan 2021 12:09:12 +0000 Message-ID: Subject: Re: [PATCH v1 3/7] perf cs-etm: Calculate per CPU metadata array size To: Suzuki K Poulose Cc: Leo Yan , Arnaldo Carvalho de Melo , Mathieu Poirier , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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=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 3F3B3C433DB for ; Mon, 11 Jan 2021 12:11:13 +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 CF52F2054F for ; Mon, 11 Jan 2021 12:11:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF52F2054F 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oUWvH3cCNkgY3d9t0ygxbUD1Fn2WYavTNZY8pt5qXP0=; b=oNYIEbdkLdbgu/ULEfXQzQj8q SV1j/gGMljmo0m1Cd9Z6/ly0U068mSAnF7NCyjr32D6XbGYCs0goZQZ9+b+bzYs+MxwvSNsE/vlYj Hxd73kzP7IZl/nUkADGBuAQZRGIER3v5sZFsD/9ItFRiIyrva0aP2XcsIIQpwZWXHFhwP8SZyOTqt j83TDfX77M0KZhVw94Ht7y8RSOlJ4uM2JmtLMomRUX5TeTJAVx2pnyYrkqyiyJaZY838Yd7aAJcra QAItRMEfAZdcouk4T6ml6U9IQKuR/yPEdAacq1cEj3aYSuXuMXm2ETDxK4gMV4yNAZJ/oMk9ImzNe sbMKYLW5A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyw0r-0007vk-KQ; Mon, 11 Jan 2021 12:09:33 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyw0l-0007uZ-2P for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2021 12:09:30 +0000 Received: by mail-wm1-x330.google.com with SMTP id q75so14860303wme.2 for ; Mon, 11 Jan 2021 04:09:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qAfBPpGti4IJb/cZMqnoVtqAcc2r4v07Ip2T/G5Ovz4=; b=uhMWbETIOgCPmlXFR2NKajl5ifHGLOYARBG1WPZ8kSXAvb5hSGYLFYetzZdbqRoUXw xyoBqCRr7vFo267aAYXOqWj3rTMXUbjHBghJ73ThVlXv3QXTjOVXJNI081o+qc8BihBG mqA8IW2z2GvDodU1XdOMOVukxzYjnJtfjTSp2LYXXmSxkPUWuGSjRPQTkZ1Lp87EEAYG 7oLO9EgDedzdO1fBq/KET0Rxo23I+mWfD5OsJ4C72D0JOLcDLkaKuPgFTXxo394F7/Wz 5WRpwOeU4zxwdsFyKXWPgwHVd4GW6rDPEbyuDothVcY1nfCiTuERlF9Z941tsp9zf/yd kygA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qAfBPpGti4IJb/cZMqnoVtqAcc2r4v07Ip2T/G5Ovz4=; b=VJayPrtbqbcAxK6rACWIvSZr60ft5rsdHX/P8XCOyoeilWNE2ujbFBnzZbkcWwPAF9 dnllgy8kaP/fWigBw0iqErjvswwuFigONkv+m3PkyyyISsciji2d2xChv2p0fs9Vuy1I Ym/IRytOQRg3b6ars0k1dsMSZ3Q5qqMjwIQJ22O+/+7dwtVy2mM0/ZoFd2Ohzx/Aot9e Atkq/h9jXMzImA06X4OM60WoN144vl8z8/w0h1M+dV5IEjKBIhMVqLeMAqpa9/AIBOoM 4bylQ+icKMc/hZ10pvmFTIBVyyBeY08w2/SuIFCbQzKbFRJOtQDHjZ2SfVkQRv8U7OfQ 89SQ== X-Gm-Message-State: AOAM531Hc3uDdhDHsecJ/6q6C3snnkX7j8BBQYm8Ri7LHj+yzJnDB4zK /21Yv2FLBtxdvv1tXnx/lbEW9aXWc7+oGP0Z8z1M1w== X-Google-Smtp-Source: ABdhPJzDeFk/mOQloneLtj4kfha+Qnij5WrMFQUSxRNUrw8SRxCA+cQtKp2UGtisY7+fW/cX3oO00jllzN2ejjxl2AI= X-Received: by 2002:a7b:c7d3:: with SMTP id z19mr14624684wmk.31.1610366963630; Mon, 11 Jan 2021 04:09:23 -0800 (PST) MIME-Version: 1.0 References: <20210109074435.626855-1-leo.yan@linaro.org> <20210109074435.626855-4-leo.yan@linaro.org> <96ec434e-4103-02ac-a05a-761a9ca8cb0d@arm.com> In-Reply-To: <96ec434e-4103-02ac-a05a-761a9ca8cb0d@arm.com> From: Mike Leach Date: Mon, 11 Jan 2021 12:09:12 +0000 Message-ID: Subject: Re: [PATCH v1 3/7] perf cs-etm: Calculate per CPU metadata array size To: Suzuki K Poulose X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210111_070927_143137_88D83B82 X-CRM114-Status: GOOD ( 20.69 ) 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 , Mathieu Poirier , 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 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. 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