From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (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 CC94F3DB319 for ; Tue, 16 Jun 2026 06:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781590463; cv=none; b=pwxiFdLypdvdmtWA59hchLTS2bQEPEoYkbZe+2dkN5JLpmqC4XyjtNXL99B0RWA23V8pLcYGUXHAV+lPPRE21s6o+PKt26TsQXUi7dOVPHcu1KENUpMFX+2DOKy1fU4lFntmBxKQIN1rBbgrre9gSbXKzBO50PeOA4fnC4/4Yss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781590463; c=relaxed/simple; bh=vl09NUTIgR4I2sPT+ijXo/wqoJPFK+xq+7nrGGfHlPw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ATt+DF3Lver5+4qCvu79pDkyDSyg6MEDlzrEdyH6XvvjJJfK9eJ13HUAcqxjXrHjos8k0ud4Df1AtIFtWfOe9IKO7emjZfCOrSC86tTPo0dgdwYcoGRGd+diPGuvkcfBd5+RGP8XBnnoJnpEedfy8HzItuwtdY7kQXyZaMMHIeg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NYPslBmg; arc=none smtp.client-ip=74.125.82.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NYPslBmg" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-304f23c55b2so5142243eec.0 for ; Mon, 15 Jun 2026 23:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781590461; x=1782195261; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=duN/u/LwjhNpessNfRzsayi44Fg+em3V06as4NgzcfM=; b=NYPslBmgfxL6gIfNCRdU4Vg/TpFETkfY0M4DnuIHVlQlWfqLAz+9c+HDHDCdx9Sh38 2UZWUuWZlwN1V4gEfJiu18wHuVUlxfcm6KNllpPxTikViNv/bokBSn+XHmFy11aG5WLm bL6VKlIF4heHKSqypaufvb9XyaXhW8kR3sZ/7TU4Ne5deUIGckiuuxjM1/T4ZW7jMzQi M+M6cZqEkyQfR86N2TCq3dtrjGVaRqQ0ENwNKL6KfrNETXSxGCi8jaepAqszfzCD4huC eiIeD9R/8iZZWve3XRdbBdxKrgHOKazIfrcjYsDImzau+Hwnc1AA7L9KGvpProgAftnW gZZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781590461; x=1782195261; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=duN/u/LwjhNpessNfRzsayi44Fg+em3V06as4NgzcfM=; b=BB4Xp+qh9ZehxCdW2RgNrcdqr7g7zyploC743d3loeKcN17WX1PjtX82mZN4lEg/fi wzO9Lqfru8L1Se511ueGPZo0bjihwyXWXvFav597OqTVrxdXmjRrSJ5d2PQKHssXMbky Yh995np+bDaCeHrKgp+vOeEtfZ/KXDT4uU9KNtaZ9Fj8iTLBitJ/iilJDvjSeWDA4lty tl6+yRZDqPNTrP5Aa47NODsw7MMIdipY7Mg8RyWNe2WbRR75rFCIQmq16tA01NllJTP2 nqclS9deH+21mSSlbPE3JGUR2rqqhJiA/B4Yx4XSUvYv3KDzH3MhELjN2vX/Za8iJ85s G5lQ== X-Forwarded-Encrypted: i=1; AFNElJ/u4mt66bATg8H4jgeQS+/GBAUwjoHQVg3WowKWK03Xt7/QNjOtw9ikgFU6blHe3ld/K2rXXEQx+Z4p2v4=@vger.kernel.org X-Gm-Message-State: AOJu0YyZfBCUxzvR2vniPCtPRUHorlkEgSxQB2CSioy0xYZRTGFOx5kC ZfqDYE3JNkNJ20eWjWkGmCuXNf1j1HnDdFccdodZuK2XDdvctD26thFulR5p3TybAKWqAbvI6im 1WVx0dDK1qg== X-Received: from dyaa8.prod.google.com ([2002:a05:693c:40c8:b0:30b:b82c:20e6]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:1827:b0:2dd:8ac2:9f7a with SMTP id 5a478bee46e88-30ba59d3517mr1511522eec.11.1781590460579; Mon, 15 Jun 2026 23:14:20 -0700 (PDT) Date: Mon, 15 Jun 2026 23:13:58 -0700 In-Reply-To: <20260616061404.41929-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260616012744.4049193-1-irogers@google.com> <20260616061404.41929-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.1136.gdb2ca164c4-goog Message-ID: <20260616061404.41929-7-irogers@google.com> Subject: [PATCH v2 06/12] perf tests: Fix Python JIT dump profiling test failure From: Ian Rogers To: irogers@google.com, acme@kernel.org, namhyung@kernel.org Cc: adrian.hunter@intel.com, james.clark@linaro.org, jolsa@kernel.org, leo.yan@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, thomas.falcon@intel.com, tmricht@linux.ibm.com Content-Type: text/plain; charset="UTF-8" The `python profiling with jitdump` test failed due to: 1. Target PID extraction resolving to duplicate space-separated values, which broke the buildid-cache loops. 2. The default workload duration being too short to capture JIT stack trampoline samples, resulting in 0 matching JIT symbols. Fix the PID parsing by sorting and retrieving a unique single-line value. Implement a robust retry loop starting at 1M python loop iterations and scaling up to 100M iterations until JIT symbols are successfully captured and verified. Fixes: c9cd0c7e529e ("perf test: Add python JIT dump test") Signed-off-by: Ian Rogers --- tools/perf/tests/shell/jitdump-python.sh | 76 ++++++++++++++++-------- 1 file changed, 51 insertions(+), 25 deletions(-) diff --git a/tools/perf/tests/shell/jitdump-python.sh b/tools/perf/tests/shell/jitdump-python.sh index ae86203b14a2..dd4a401cd245 100755 --- a/tools/perf/tests/shell/jitdump-python.sh +++ b/tools/perf/tests/shell/jitdump-python.sh @@ -20,7 +20,10 @@ PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXXX) cleanup() { echo "Cleaning up files..." - rm -f ${PERF_DATA} ${PERF_DATA}.jit /tmp/jit-${PID}.dump /tmp/jitted-${PID}-*.so 2> /dev/null + rm -f ${PERF_DATA} ${PERF_DATA}.jit ${PERF_DATA}.pid 2> /dev/null + for p in ${ALL_PIDS}; do + rm -f /tmp/jit-${p}.dump /tmp/jitted-${p}-*.so 2> /dev/null + done trap - EXIT TERM INT } @@ -33,9 +36,16 @@ trap_cleanup() { trap trap_cleanup EXIT TERM INT -echo "Run python with -Xperf_jit" -cat <') - -echo "Found ${NUM} matching lines" - -echo "Remove JIT-ed DSOs from the build-ID cache" -for F in /tmp/jitted-${PID}-*.so; do - perf buildid-cache -r "${F}" + if [ -f "${PERF_DATA}.pid" ]; then + REAL_PID=$(cat "${PERF_DATA}.pid") + ALL_PIDS="${ALL_PIDS} ${REAL_PID}" + fi + + # extract PID of the target process from the data + PID=$(perf report -i "${PERF_DATA}" --stdio -F pid -q -g none | \ + cut -d: -f1 -s | sort -u | head -n 1 | tr -d ' ') + if [ -z "${PID}" ]; then + echo "Failed to get PID, retrying..." + continue + fi + ALL_PIDS="${ALL_PIDS} ${PID}" + + echo "Generate JIT-ed DSOs using perf inject" + DEBUGINFOD_URLS='' perf inject -i "${PERF_DATA}" -j -o "${PERF_DATA}.jit" + + echo "Add JIT-ed DSOs to the build-ID cache" + for F in /tmp/jitted-${PID}-*.so; do + perf buildid-cache -a "${F}" + done + + echo "Check the symbol containing the function/module name" + NUM=$(perf report -i "${PERF_DATA}.jit" -s sym --stdio | grep -cE 'py::(foo|bar|baz):') + + echo "Remove JIT-ed DSOs from the build-ID cache" + for F in /tmp/jitted-${PID}-*.so; do + perf buildid-cache -r "${F}" + done + rm -f /tmp/jitted-${PID}-*.so /tmp/jit-${PID}.dump 2>/dev/null + + if [ "${NUM}" -gt 0 ]; then + echo "Success: found ${NUM} matching lines" + break + fi + echo "No matching lines found, retrying with more iterations..." done cleanup -- 2.54.0.1136.gdb2ca164c4-goog