From patchwork Wed May 19 04:15:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12266193 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 16847C433ED for ; Wed, 19 May 2021 04:18:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 9BED76112F for ; Wed, 19 May 2021 04:18:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BED76112F 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=odlrK0MQTbsraBmOX9ZtTt5mXi6D2az3jBeds6Q1P8c=; b=c6HHP12fVoFGYIF8PSUUrvZXv dz2HyaV5Wp0SDGNuoIwrWH8CY/cQ4sldmecqOiDaMmDrmgOVojJy0HX6HVJ/mwc2IBiDlnu5Bk2WE X6318kcHVwTBAIKLO207f6I/XTZEHT8AttGfejxVzmi5Cf4sRyaV2Lo8ecLIYoxqX/N1/2qnmKcmY 36m/XlFfL2pwlpmhBj5ZwIrcN8xzjIkF/Gq+dK3MeFkwGFUZ89wVFoRT/J8ceU/F/KBTSfTMkv/tX yQB0MwWVq4vES3kJ4ddppgOBpbZSXhezGDrjZH4r0uC+tOEtALlSPC+fB8TVAB9cy+6zAgFrIyJyI t6W7pJfSg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljDcv-002hbz-Qi; Wed, 19 May 2021 04:16:10 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljDcl-002haw-Vc for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 04:16:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=dSvPMJ6ajKYTaE4dMLmv0bU7XqFPvynhF+nhCSjEXqk=; b=iRlwUx/YJkiLTaxwZwbI+PD8CE wiRfSJEcTa16cV8CaR/tKuL7tdWldKNOrkOBMesetGrglFHWWR3rETeU1u/iiZYQIQx31E6A3c8gC oJuQUpYnhcUHeTnAy2BG3/kV4dHiAnHFrZFUBnrYosRP98ai3j0gG+KEhCkIRBnF1kY9tsNMAjuHn a2qqaB2Z9V+xPOPKiPPbxExUK2vTSQotTJLUO1r9DD0+33Jlsd0EqaptF1A42DLfMhjGxUArSyFFx 0V6SKTfbcOS+9n4xsZpF8Py+pxP1ihF3/BWOV1l4J0MB+BlLvh1IPLbXq1oEFXGrW6Vnz1bee7EIF rV55NN3A==; Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljDcj-00F77N-FC for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 04:15:58 +0000 Received: by mail-pf1-x42e.google.com with SMTP id 10so9004329pfl.1 for ; Tue, 18 May 2021 21:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dSvPMJ6ajKYTaE4dMLmv0bU7XqFPvynhF+nhCSjEXqk=; b=aaCOTZsa/3yjYLdqdA/OfbMLWzu9RyJRXuZPYfr+wm3AI9457kCSoFMDCrIsLQrGLt ByoCDOENXrICY1ExhAww4HbaQCkuMYnaHUi2moXVW/S5cevx0U9KeGKRAg+EdufUBA+V 1ZxFBOdj8svbSNooNQOceeTijJZm1lZDYEkpSXhTi+1d8Lr1q4cCdCLsaO/eKDLf19ez 2YkqD0JJR1s5x88/GXM+P0fpjAOd+F+NR7xfHvvKO4rjabQ2boL8aHUt8jn1GFkgTkj3 8xlRFRQ1K2K41Dhesb7oEyVgmMTj+CsIX46gFK77ODinRCHexWx2mKDAQQu7iBu65BYz ZwjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dSvPMJ6ajKYTaE4dMLmv0bU7XqFPvynhF+nhCSjEXqk=; b=bVfBCevov1Vs8GuLq12PAaxOL4QuNTO31wvrvzcZ8WuDK6huBnlbaJB8LJFG/RIJi+ diAt5cnzzoPUC1cuhLxWpJoJgtenmV/r2qdaBygKx5M3mv8hY697Uk4tzdfW39N5pNlw tjtMVQpU0/g+PBkOUFoIohCXR2xRc+L+jZaVtpP7OQwbtIxcKXNIlQKPC43J9xQoC4xe 73KCz5pM9T219bu4M8zaAxIJw9cOfX6KwRAX7Wsa0Xs2GT3rPnrlEjoB8CwtAY+PwO2o 5g+jnO2yJJM48Gc4Uu67MP+iLXd1MRcudmx7wqsBTORu8nIpqCXrVsCSpzjQRHO6CnI0 NjPw== X-Gm-Message-State: AOAM532SZMkoZozYsqvsFTz3LeB638uaajjRyICBCVhstLGmBRZOW4KE Pawwq84esnXL2YPtkGaaP/oZfg== X-Google-Smtp-Source: ABdhPJypI2NKauTPCzBLknKllWhLQ9Zb5c+DwOn8mkNjD/GPp1xQGsoaRdyiZLKLGIK9pw/p+X+/Tg== X-Received: by 2002:a65:5248:: with SMTP id q8mr8763715pgp.176.1621397756718; Tue, 18 May 2021 21:15:56 -0700 (PDT) Received: from localhost ([103.207.71.35]) by smtp.gmail.com with ESMTPSA id d3sm13588742pfn.141.2021.05.18.21.15.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 21:15:56 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , James Clark , Al Grant , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v2 1/4] perf arm-spe: Correct sample flags for SPE event Date: Wed, 19 May 2021 12:15:43 +0800 Message-Id: <20210519041546.1574961-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210519041546.1574961-1-leo.yan@linaro.org> References: <20210519041546.1574961-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_211557_527555_75D19D0A X-CRM114-Status: GOOD ( 18.52 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now it's hard code to set sample flags for CPU, TIME and TID for SPE event, which is pointless. The CPU is useful for sampling only for per-mmap case, it is used to indicate the AUX trace is associated to which CPU. The TIME sample is not needed for AUX event, since the time for AUX event is not really used and this time is a different thing from the timestamp in Arm SPE trace, the timestamp tracing which is controlled by Arm SPE's config bit. The TID sample is not useful for AUX event. This patch corrects the sample flags for SPE event, it only set CPU sample bit for per-cpu mmap case. Signed-off-by: Leo Yan Reviewed-by: James Clark Tested-by: James Clark --- tools/perf/arch/arm64/util/arm-spe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c index 414c8a5584b1..902e73a64184 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c @@ -68,6 +68,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, container_of(itr, struct arm_spe_recording, itr); struct perf_pmu *arm_spe_pmu = sper->arm_spe_pmu; struct evsel *evsel, *arm_spe_evsel = NULL; + struct perf_cpu_map *cpus = evlist->core.cpus; bool privileged = perf_event_paranoid_check(-1); struct evsel *tracking_evsel; int err; @@ -120,9 +121,9 @@ static int arm_spe_recording_options(struct auxtrace_record *itr, */ evlist__to_front(evlist, arm_spe_evsel); - evsel__set_sample_bit(arm_spe_evsel, CPU); - evsel__set_sample_bit(arm_spe_evsel, TIME); - evsel__set_sample_bit(arm_spe_evsel, TID); + /* In the case of per-cpu mmaps, sample CPU for AUX event. */ + if (!perf_cpu_map__empty(cpus)) + evsel__set_sample_bit(arm_spe_evsel, CPU); /* Add dummy event to keep tracking */ err = parse_events(evlist, "dummy:u", NULL);