From nobody Sat Nov 30 10:30:04 2024 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 805B9188CC1 for ; Tue, 10 Sep 2024 15:18:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725981523; cv=none; b=qFvwMkzAOlZdRRAuui8JlOmyg9SS/FnZeRXNsXODDdM6pvUEnRkV1ovvgbaKZUl5vuVJJ+A3Y+KemTJsQuHZR3WjhvmD2HqOYWB3vgeRv1YKDgQTxJSPA5uKU3I1Tzvo605L6LlB2MAMjM35VQcfhPAjfd3EcglkelJdH8MtKBY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725981523; c=relaxed/simple; bh=hd7oyorl4TOQWVxg+vhsoBj05DEdVB7R33IhLz/6S/g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bto6b41b8mYyGL8JHrk/isX6u0UJOXaRBJo2U6fNEmMyZzhK0okYiNvI5HK0vJpJfWhMZWAfTwvFBnkdnFswaI5hJDryGTdG41tI2YmDPK6FJd+PxJkIy6qqMWDwnztGcvhJhK2JC+JcPF0gD67qR346i/kyWK4JWhYCsigTMig= 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=fZ1QPh7W; arc=none smtp.client-ip=209.85.221.44 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="fZ1QPh7W" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-374c1963cb6so3562235f8f.3 for ; Tue, 10 Sep 2024 08:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725981520; x=1726586320; 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=ZV/wWyP/OuoFa1Q1XSAgXw1mLQzgLi2JT0YhtXRGetA=; b=fZ1QPh7WHjyKH+VrNKGazUVUSD+fGshtPmNA+qVsDwEFqoYBTyUitvY76gznjJ03eX g+iSoSU6EIwwc/Ggp60IzInmrQolcI/nScRJB9vGNdOybhEJLy3JUBraSrtmoFFo5JpO gRJtNYehkRZIE8Wth2xbUz64b0pK9AM72Fh+zUt0ExpVzbzMU6slNyXW6O9r60HT+kU1 NscqMDFRct4iyULzmT2bL0hiBidXv79Ns4j5tu3INC5sKE8woKBq10AwbYFGtIvx5/6h Lzbu0UWsW3yA+JZaMRtYdq6xQcnVz9KSHl+JfrQ6RCdz7ZPsR9W3Bo71t0hu3oBC3OQY U/Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725981520; x=1726586320; 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=ZV/wWyP/OuoFa1Q1XSAgXw1mLQzgLi2JT0YhtXRGetA=; b=bo50R9J2egy9qoKRgWz31b1tsjxIH/aVkN3OANiK7ZSBVsVbwwSwTCaKY6EFE/QWSo vhG3n8vIValSc2WbICDuuYjCkq8MTH46RycoC52io+c9B03c7BHrw+27X3tcwl3Jb9TX /XdLrXU33/Hdr53N4+kRgz25SQxqWB9I9QFaQvLovfSVMsjvfUhrbyqFGI7AOZy+wIj+ 5gIq/+LwbZqmuHkSXl9snzv9jSjEGxIda9r+gtHhKax9/E58Pr7FoORbntGqgBi/T0En cN08tAriwn54w4TfBHeGt6b5DJHHqQy1j4BGZrIxemslla3778TvH56TeU71DA4j7bmx wgEw== X-Forwarded-Encrypted: i=1; AJvYcCW812wehbsE7rKDJFs7as/4yp9GSufmreil0JZBIuo6RN7eyZog5agGJ9c1NBrTfYisN8qoviJWiEZEb04=@vger.kernel.org X-Gm-Message-State: AOJu0YziVfuAfEbM0le+DCJ+eLNpM2SBqO1cfphl+ZbXRphMUkF2/mTm H4Kc9xyXeLR9TOS4ET9aBPukw7eJuScdOt50Y9k2qEhrV58YUKEdgdyqDxL3QPw= X-Google-Smtp-Source: AGHT+IFvmRJ3kwcH44X8tEVQpW/XuglOxSPCkP6MHjK2ehbvCFJ8Z5bWzyalPeu3oqnDHG3TOgB6LQ== X-Received: by 2002:adf:e544:0:b0:368:445e:91cc with SMTP id ffacd0b85a97d-378895c9deemr10636514f8f.21.1725981519545; Tue, 10 Sep 2024 08:18:39 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895665517sm9440844f8f.36.2024.09.10.08.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 08:18:38 -0700 (PDT) From: James Clark To: irogers@google.com, linux-perf-users@vger.kernel.org, kan.liang@linux.intel.com, ak@linux.intel.com, namhyung@kernel.org Cc: James Clark , John Garry , Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Weilin Wang , Dominique Martinet , Colin Ian King , Athira Rajeev , Yang Jihong , Howard Chu , Ze Gao , Yanteng Si , Jing Zhang , Sun Haiyong , Yicong Yang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 6/7] perf test: Make stat test work on DT devices Date: Tue, 10 Sep 2024 16:16:24 +0100 Message-Id: <20240910151640.907359-7-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910151640.907359-1-james.clark@linaro.org> References: <20240910151640.907359-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" PMUs aren't listed in /sys/devices/ on DT devices, so change the search directory to /sys/bus/event_source/devices which works everywhere. Also add armv8_cortex_* as a known PMU type to search for to make the test run on more devices. Acked-by: Namhyung Kim Signed-off-by: James Clark --- tools/perf/tests/shell/stat.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/perf/tests/shell/stat.sh b/tools/perf/tests/shell/stat.sh index 3f1e67795490..525d0c44fdc6 100755 --- a/tools/perf/tests/shell/stat.sh +++ b/tools/perf/tests/shell/stat.sh @@ -117,16 +117,18 @@ test_cputype() { =20 # Find a known PMU for cputype. pmu=3D"" - for i in cpu cpu_atom armv8_pmuv3_0 + devs=3D"/sys/bus/event_source/devices" + for i in $devs/cpu $devs/cpu_atom $devs/armv8_pmuv3_0 $devs/armv8_cortex= _* do - if test -d "/sys/devices/$i" + i_base=3D$(basename "$i") + if test -d "$i" then - pmu=3D"$i" + pmu=3D"$i_base" break fi - if perf stat -e "$i/instructions/" true > /dev/null 2>&1 + if perf stat -e "$i_base/instructions/" true > /dev/null 2>&1 then - pmu=3D"$i" + pmu=3D"$i_base" break fi done --=20 2.34.1