From nobody Tue Feb 10 01:19:18 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E03411CD1E1 for ; Tue, 24 Dec 2024 10:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735037088; cv=none; b=NBYmZAZBBlSAyDy1zUXRmwCkCRHBL/i8tiIlQGlJqpjeUgobyr8+/2IQYP7EULTAz8Dgl/84RQngvvcd9G41sUpUg9E9w8QkXcrdhzrKsisC5qAkMeYew4ZiSenMnbLtIvLjIOy9hPRfwewVvMjMCd0OEb7QI8a0t3ySREJkFoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735037088; c=relaxed/simple; bh=CzVsVOj5aHsPQBr+aXqDtSSnmkuppLx5203C1dQxOOw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=B+HwnnmhcBSLz/R+O23ec/LDl+dk+vU6c44XsaUcyUbNuWx3Upys0ifuXBm1hxa91Of6g9Dd52jMre7VYsUArnPsz7p292QF7QOAU9uyBTCIQs6qeTBffHZDDP4l3CzBaID4JBfEEZTW+hFb0g6MViP04kYOoS8Nl14eru9oUXY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mcPN7DRK; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mcPN7DRK" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-436345cc17bso37008425e9.0 for ; Tue, 24 Dec 2024 02:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735037085; x=1735641885; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wmWclsqjoRWfqPrE0WD8+jPpX9G+TTRqhb+EOtWuV1I=; b=mcPN7DRK2TWJCExPow7gWFvtBzslqpINOdk1nTh6LyyUrFsyLDYGsgmKyXRBVO12Bl 1GFC8MzOi3hhs9C9+7WRi5dLrGbwxGsARMyJzMm440aFuaKYdq1yb3jn0DBBX2QtdTLu O6VnRDhJQ2RzENZVmt078apymMJxJvHhU2w8wBbfT0rZOjPdOkx0AkIjffaIW+9Lu99K bBEwTpDF9vMfr+xXjraVuM+w7JsV3F86ikryHq9KllC/RDCiflxYHjoU4HNWbiauOmNX fWCHWdRfTEOMph7emunPqSy6WrMF+jCB2E+B9Bru9fsAzcoEf/JDir7FtM2OM6Bl4cZz rxjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735037085; x=1735641885; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wmWclsqjoRWfqPrE0WD8+jPpX9G+TTRqhb+EOtWuV1I=; b=Nb8Fr+YQ7zbNMS2lype0H4ykMST8sprEax5KG/LehnCGcQ0h4gV2j31ihTpDl0PwpQ VgxYvvVZMKJDW9Gnyl0YiYli713bj35btq7U8XwGKcA55HaPPpuayhmdNTpVHN/YCoqP MCXFtBEhrLEO3x7FQsL4iS0TKHJTm7J3/26kN0uAk3EozAvv8ezInLXw1Ke4oKV/bKzq iynceOC+YTITOBRiHLIcrSxSn0xAYID6Y8gkfjHZF0ZyJ19bxy828TI2VnfxmCFcKvTM Ji+d/eCmedPBqI0Zmyw/t8wDvrOkzH0GPYzuTqlXEEfJY9OZ5e4IxD/+KYKgabhxRncs bl0A== X-Forwarded-Encrypted: i=1; AJvYcCVikrJq1qGNaohhCwgHjtvFJTxCaIE3Qtsn2HWix+PMUceGHTBp3vimN5JFJ4oJat1aUxTB1hiWlKlUyvQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzLtC0bPXGAt1irzX86H/AdoQsEyThesGa6mFX9fkj4vbLrZDcr VvcFjkdl5uK/+GxE3rsC5sghBcVnUYru6SKDSPPfVFfOa/d1CwtQxgDd25CFvsA= X-Gm-Gg: ASbGnctcFAXFf3RZpM7mevwv9lyjNPgN+ayPOs6ydVqu36q0w/Y9a+L6Vf9ZsXm6jDA SlezzJqBVlhtRwV6x4/HD6MdAQrKQzcsoksnl2Pt1xbaNUFr7sumL3UVkLB0qSSeBDHP5pmb3nO YW3Snpu5yhCJkAEj9oz8gz59pGXIvSDyDjhNVagWqS0Zi9IY0X/8H1AD00lRRBd5eq4h0b3Yq9l 8UtXt8qH/2+f5V8lTRvuIOEZgvs+CjGfXjouHXrVzzcdqqRmMzRKp4= X-Google-Smtp-Source: AGHT+IHaBv3kwmR23DfMiPkW/ULQn6dCN6owu8F2AwgaW5A6C+1/Tsu2gsMP3xZT9UiCfrjTvu25qA== X-Received: by 2002:a05:6000:490e:b0:385:fc97:9c63 with SMTP id ffacd0b85a97d-38a221f16d6mr14526536f8f.9.1735037085301; Tue, 24 Dec 2024 02:44:45 -0800 (PST) Received: from pop-os.. ([145.224.66.70]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c847714sm13938184f8f.54.2024.12.24.02.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 02:44:44 -0800 (PST) From: James Clark To: linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, irogers@google.com, yeoreum.yun@arm.com, will@kernel.org, mark.rutland@arm.com Cc: robh@kernel.org, James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , John Garry , Mike Leach , Leo Yan , Graham Woodward , linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v2 3/5] perf tool: arm-spe: Don't allocate buffer or tracking event in discard mode Date: Tue, 24 Dec 2024 10:44:10 +0000 Message-Id: <20241224104414.179365-4-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241224104414.179365-1-james.clark@linaro.org> References: <20241224104414.179365-1-james.clark@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The buffer will never be written to so don't bother allocating it. The tracking event is also not required. Reviewed-by: Yeoreum Yun Signed-off-by: James Clark --- tools/perf/arch/arm64/util/arm-spe.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/u= til/arm-spe.c index 1b543855f206..4301181b8e45 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c @@ -376,7 +376,7 @@ static int arm_spe_recording_options(struct auxtrace_re= cord *itr, container_of(itr, struct arm_spe_recording, itr); struct evsel *evsel, *tmp; struct perf_cpu_map *cpus =3D evlist->core.user_requested_cpus; - + bool discard =3D false; int err; =20 sper->evlist =3D evlist; @@ -396,10 +396,17 @@ static int arm_spe_recording_options(struct auxtrace_= record *itr, return 0; =20 evlist__for_each_entry_safe(evlist, tmp, evsel) { - if (evsel__is_aux_event(evsel)) + if (evsel__is_aux_event(evsel)) { arm_spe_setup_evsel(evsel, cpus); + if (evsel->core.attr.config & + perf_pmu__format_bits(evsel->pmu, "discard")) + discard =3D true; + } } =20 + if (discard) + return 0; + err =3D arm_spe_setup_aux_buffer(opts); if (err) return err; --=20 2.34.1