From patchwork Fri Mar 31 05:56:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Leach X-Patchwork-Id: 13195236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64BB8C6FD18 for ; Fri, 31 Mar 2023 05:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Wlf/R3HjcOIWhrOIxNTx0bLZwJ0UswC/nQ8zCrIs+yQ=; b=wMT0DMzV3Kj3Cq A1KWFcQnya0JnUeePy76xUBIpCvW5oyHkLZcSqDH7vKqnVP4FTDCbJSfoM4LL8nlkTvV7IKpH+ZhT 1ca8+o1cNoJo6wcFY0yPu8Cjf5PXU8us3hcTc5r4HBNYKvWhTq4FsQhe3qmEbbgr88otxFgAU7g42 ZLnjkY5O3Vn2i7cdDDWzqNqJjVB12LgnTbvCx1MmevnEmd20PkRYIPP//dqYJTCvuJkggIo40GiRt /50uFjcnySQKZnEelk0rtohSH+4XYSqF0Q0ytmAOGiLnPWu/Mkfb+Utno2E7Vt1SKbunr4aZIA28O tWvLlPzK9u0hYsrXiYmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pi7ku-005wpX-2B; Fri, 31 Mar 2023 05:56:56 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pi7kr-005wn8-1C for linux-arm-kernel@lists.infradead.org; Fri, 31 Mar 2023 05:56:54 +0000 Received: by mail-wm1-x334.google.com with SMTP id v20-20020a05600c471400b003ed8826253aso4166898wmo.0 for ; Thu, 30 Mar 2023 22:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680242209; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s/jH0xPqB6+Pn+vISLE52np45zk9fgumfQUoqdD2YAc=; b=UslLcl/w9lPYagwyWUN6K+ZQJdTl/H20JiW1rJDfE1uogo/kwa9HTd52sgBvP8WdkK e9GLPmNGdRvA1ZxTWkOIjlrTy4TApoyzZfvrB7U4f4KLgrAUGLOwT+zZxmK6AebnG8We FhYoLzAku62Oh1fG1h8aBSN05+PKhftIhzp0X69uvDujRqmNRp2KPA3GZ8/FK/JQqa2n ZH7UB/XZe1S36MpkGHKXNWJVj2ztBr5t2nUXV5akoQ8ny6ea6CgAGXXCE9rQKou0ZKME zZcp2njq5UUblK1PsBOIYMiF3x43BJdHhfdoHNEUTK7n2MZQ0DPMOLka7YDePvesIIrl NaLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680242209; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s/jH0xPqB6+Pn+vISLE52np45zk9fgumfQUoqdD2YAc=; b=TGL1gvxMlS8sKNyjcmWCb5OgQttlFEiMZiBwV+kPwqB6y3VFirS/4PC2mVuxVRTqCN Qt/Sjl14ey2pyCmtMmpg/fej0NpfJigC9dsw3HhzbiUAQxexANAVg5phsRm02YsGzD19 r/fmigxDZf+4RA2kEr8ER8utBRlbPS9VZ4EprJnh3efFqTNs114bX+LCB+1Za/CloC3j 6SKXWAzfquYOugASbnjksoZVaO4cYCogVqFe7EtVCl66LVLFc8ITHlXpknG3+YAGpy8X QKGjZ71Zuq2Shlt0d7WoRPGavPn0WHlOlNr2o3ysfkS8i2AB6t0Ealwa7sJdkzxE7IRD ofjg== X-Gm-Message-State: AO0yUKVlHvZVmfgL/dJDYzsEhlrLsy2nN0H4UvQJ2O0n4TiWBAdeTmIQ QATqNLODpC+zeoVU0KgVy+oFRw== X-Google-Smtp-Source: AK7set9P5+8EdigmsCScfkL39tpuIF6bb7WS1jmhE+FKALWhub/tvT57wsJPsrCo7mbn5hxwgHU2SQ== X-Received: by 2002:a7b:cb93:0:b0:3ee:814b:9c39 with SMTP id m19-20020a7bcb93000000b003ee814b9c39mr19104518wmi.18.1680242209130; Thu, 30 Mar 2023 22:56:49 -0700 (PDT) Received: from linaro.org ([2a00:23c5:680a:d01:24d4:5fa:d4b2:7c14]) by smtp.gmail.com with ESMTPSA id iz5-20020a05600c554500b003ef67ac3846sm8464055wmb.24.2023.03.30.22.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 22:56:48 -0700 (PDT) From: Mike Leach To: linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, acme@kernel.org Cc: suzuki.poulose@arm.com, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, will@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, gankulkarni@os.amperecomputing.com, darren@os.amperecomputing.com, Mike Leach Subject: [PATCH v9 0/3] perf: cs-etm: Update perf to handle new Coresight Trace ID Date: Fri, 31 Mar 2023 06:56:42 +0100 Message-Id: <20230331055645.26918-1-mike.leach@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230330_225653_444575_E258A3AE X-CRM114-Status: GOOD ( 11.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The original method for allocating trace source ID values to sources was to use a fixed algorithm for CPU based sources of (cpu_num * 2 + 0x10). The STM was allocated ID 0x1. This mechanism is broken for systems with more than 47 cores. The kernel related patches the provide a fixed Trace ID allocation mechanism are now upstreamed. This patchset updates the perf code to handle the changes to the trace ID notification mechanism that now uses the PERF_RECORD_AUX_OUTPUT_HW_ID packet to set Trace ID in the perf ETM decoders. Applies and test oo perf/core Changes since v8: 1. Fix build issues 2. Fix implicit function problem Changes since v7: Split from original patchset [1] to be sent separately as kernel related patches are now upstream. [1] https://lore.kernel.org/linux-arm-kernel/20230116124928.5440-1-mike.leach@linaro.org/ Mike Leach (3): perf: cs-etm: Move mapping of Trace ID and cpu into helper function perf: cs-etm: Update record event to use new Trace ID protocol perf: cs-etm: Handle PERF_RECORD_AUX_OUTPUT_HW_ID packet tools/include/linux/coresight-pmu.h | 47 ++- tools/perf/arch/arm/util/cs-etm.c | 27 +- tools/perf/util/cs-etm-base.c | 3 +- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 7 + tools/perf/util/cs-etm.c | 326 +++++++++++++++--- tools/perf/util/cs-etm.h | 14 +- 6 files changed, 356 insertions(+), 68 deletions(-)