Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp405442lqp; Wed, 12 Jun 2024 05:29:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNQMs3sy+4jCrVvtYLgMF5Lk6R844eUX2W7rbGhVFzeYkFO/3VmaFWj8jpGqaZWh+1AS01fhkWGlkzkbx0jwUxcl91LUoYJgGU5VaGGQ== X-Google-Smtp-Source: AGHT+IFgzeLRkdTJEr16DtSEMkk3fD2UK7S5P/NV0ko9hvxJ8yjdV2Rdjp3VeTuSnvtSWMLWHdrJ X-Received: by 2002:a05:620a:450c:b0:795:a4fc:c000 with SMTP id af79cd13be357-797f4db4506mr316936285a.8.1718195367660; Wed, 12 Jun 2024 05:29:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718195367; cv=pass; d=google.com; s=arc-20160816; b=VjY2FFTbj/pmKPPCJTNUtJ9nK2LOpmgvK1KupvrNwNQoafOZfM4PFWZaRDe976CN29 6FDXfF0QwtoeBNRUvY5Jb+9mAo9d/rkpQxd/TEfRXNzyx9sQYCtxRPg1culbZL8yBLrX ePndOzYQndaKM3OAAsFvh+ZXYf2DYnIzwY7ZprjZ9EaKztpJXVG3+1FAr1GXVrQCuWJu rXeHwpxJzIQL671VuREuLBmQCugYJMWVs5bDhiWOlWH8NX1nqLA2bo9FQhFBOQILO/CV 2C6pS5KtvS5infCho5MzOyGPMC9c1XMsPMopLL9dxLlkvnLYEABfJD/W/KNT+fuLSsf4 PUUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=S7V1WzUfiOcsrZPeRCaOLgSHptYsAl5KakBVLZab0aw=; fh=ZH02pR/VK/BBnflaPl0Aw3fdzI2QjpXWpNA3hDqXiWU=; b=eRjmI1yoKrqSaiD2W7iv82q+fApexxjoyzlUKFW6eQgELTuSvYZkn+iiquCNnlBNq6 nKnhoooF5GUA6hA2+OTsMKpRQ/7vT3OxNU4UyYQObzZKuCtWhHBihXTdI9LM/a+AkGon wZ5PW/OPjSIeu1fAXNZrKaWAVASuGqBI/G0TOILMu4hlV1pGSsjNwpn7UigeMTexaGLu o9G6eHOjUp2eXc1H3nRfG2NqxV+OWtvwuwFLCStKQblw9TAMvTRVQ/2+RVb351wak+3q IUdwft1pmJacdmHH2fUo0H35gEibCHrKr0oz3gUUAQ44r4niSTdv/uLnDLybSaeGJrb+ nqTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-211481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-79533396cb8si1559073085a.734.2024.06.12.05.29.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 05:29:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-211481-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211481-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4D41B1C23616 for ; Wed, 12 Jun 2024 12:28:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E22D016F902; Wed, 12 Jun 2024 12:28:21 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84A0F16F0F3; Wed, 12 Jun 2024 12:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718195301; cv=none; b=IrMMrqMG/dmbbSKcBhOgpI1HYUgfTEiBxDlxz5funbH3MkFfcKzQ7M1KBAPGf8fgYLucC+5cOuBuUfzvgMF8H4nIjM0sH+MiNkacZIiX5M46fGGqAP6SMKloguUaCWWez84jF/Uw1Mcsu1PV1/RVEd7Bt71kdVIG3+jv4nHQras= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718195301; c=relaxed/simple; bh=CbHzrsS2xuvw8cRx5w/aRlruF8LSrUFindAXw2+MRag=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=rHTKtO25O8/DDcJcB7HUzH/p7bK/OeYMNUdotA1bXh3GpxNcA7DKx7hDNr5SSPUbZgCm3AaC8R9MMDXTTRO4X+DgoWK7o5ThL7oM++WEB/h3CEZFIpUJqUzpGAfiCaliYH3QOYihsDo4ocRBWbQ4XEaM8OoRVuNrtpzhpDtuycw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9FBF11595; Wed, 12 Jun 2024 05:28:41 -0700 (PDT) Received: from [192.168.1.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3EDF23F64C; Wed, 12 Jun 2024 05:28:14 -0700 (PDT) Message-ID: <8112b2bf-3950-4889-96bf-2317fbfb4bee@arm.com> Date: Wed, 12 Jun 2024 13:28:08 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 1/2] perf pmus: Sort/merge/aggregate PMUs like mrvl_ddr_pmu To: Aishwarya TCV , Ian Rogers Cc: Tuan Phan , Robin Murphy , Thomas Richter , Bhaskara Budiredla , Bharat Bhushan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , Ravi Bangoria , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Stephane Eranian , Mark Brown , Naresh Kamboju References: <20240515060114.3268149-1-irogers@google.com> <20240515060114.3268149-2-irogers@google.com> Content-Language: en-US From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/06/2024 12:19, Aishwarya TCV wrote: > > > On 15/05/2024 07:01, Ian Rogers wrote: >> The mrvl_ddr_pmu is uncore and has a hexadecimal address suffix while >> the previous PMU sorting/merging code assumes uncore PMU names start >> with uncore_ and have a decimal suffix. Because of the previous >> assumption it isn't possible to wildcard the mrvl_ddr_pmu. >> >> Modify pmu_name_len_no_suffix but also remove the suffix number out >> argument, this is because we don't know if a suffix number of say 100 >> is in hexadecimal or decimal. As the only use of the suffix number is >> in comparisons, it is safe there to compare the values as hexadecimal. >> Modify perf_pmu__match_ignoring_suffix so that hexadecimal suffixes >> are ignored. >> >> Only allow hexadecimal suffixes to be greater than length 2 (ie 3 or >> more) so that S390's cpum_cf PMU doesn't lose its suffix. >> >> Change the return type of pmu_name_len_no_suffix to size_t to >> workaround GCC incorrectly determining the result could be negative. >> >> Signed-off-by: Ian Rogers >> --- >> tools/perf/util/pmu.c | 33 +++++++++++++-------- >> tools/perf/util/pmus.c | 67 ++++++++++++++++++++++++------------------ >> tools/perf/util/pmus.h | 7 ++++- >> 3 files changed, 65 insertions(+), 42 deletions(-) >> > > Hi Ian, > > Perf test "perf_all_PMU_test" is failing when run against > next-master(next-20240612) kernel with Arm64 on JUNO in our CI. It looks > like it is failing when run on JUNO alone. Verified by running on other > boards like RB5 and Ampere_altra and confirming that it does not fail on > these boards. Suspecting that the suffixed 'armv8_pmuv3_0' naming could > be the reason of test failure. > > Reverting the change (3241d46f5f54) seems to fix it. > > This works fine on Linux version v6.10-rc3 > > Failure log > ------------ > 110: perf all PMU test: > --- start --- > test child forked, pid 8279 > Testing armv8_pmuv3/br_immed_retired/ > Event 'armv8_pmuv3/br_immed_retired/' not printed in: > # Running 'internals/synthesize' benchmark: > Computing performance of single threaded perf event synthesis by > synthesizing events on the perf process itself: > Average synthesis took: 1169.431 usec (+- 0.144 usec) > Average num. events: 35.000 (+- 0.000) > Average time per event 33.412 usec > Average data synthesis took: 1225.698 usec (+- 0.102 usec) > Average num. events: 119.000 (+- 0.000) > Average time per event 10.300 usec > > Performance counter stats for 'perf bench internals synthesize': > > 3263664785 armv8_pmuv3_0/br_immed_retired/ > > > 25.472854464 seconds time elapsed > > 8.004791000 seconds user > 17.060209000 seconds sys > ---- end(-1) ---- > 110: perf all PMU test : > FAILED! > > Thanks, > Aishwarya > I can take this one, the test can probably be relaxed to not care about the suffix. Or maybe change what we print in the stat output to match the string that the event was opened with. Not sure which way is best yet but it will probably become more obvious after some digging. James