From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (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 6576843C05B for ; Thu, 17 Sep 2026 06:43:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789627382; cv=none; b=o2DezmpfHnsR1c2G0x0CkGBzE9DCrWsqoxtY+SSSh6It9PS+7as2xUoaOVEmMM9EKRL2TP/F76kK9hUrgh+MdWZCvC4ElGm2MA5LJNrGW7/vN9sXaMLx5mA1lZHWPN79jsO+TOSsOmJWhjUA1GTJ6YksS28RTBq2FpUuQ5QMon0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789627382; c=relaxed/simple; bh=ijr3LP2P40ZUq1DuBNqRk+AgK81THBcVB9Y2LVWBVcs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=jy4pBCJXiKkSefM/CRKbG7MauDTdvXFQe6ROP1ciCQjaWId0nfVdaCFL34vh+c6pOShqNAeT9xBqEvsJewvfnS0F3KfzlOjKcbUXAzg8IRCvsolQgcvIdVyqh1aPE6h21xA3KSzZDuk/AK1U7Fb/Qysir6nwDPdVaO5zUJrlVKM= 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=g1QZU5l9; arc=none smtp.client-ip=209.85.215.198 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="g1QZU5l9" Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-cc42a07d04aso434922a12.1 for ; Wed, 16 Sep 2026 23:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1789627380; x=1790232180; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1MnZowd6oTOfaxXZbzT35kcRhO2jRSIVNLLWdFtgUAI=; b=g1QZU5l92FrF56BSE5S8NYmAqQe6Vu9k9YZy5n0saBB26zvahaStdb+/WmCykdutvs VkcYbFWZrq4L3YfS+CniXX2sgKAtzXogN+cid04uPF4JXxMmXty0HJGVDBXSdjvCPK4s ln3wHkFxPQpduckgQNyON3Les6mkZ9ulYb8Rgs8+GIaQiN6QnSC/8dG6znEz155cM+Ic ++H/KZN8CYBqUIZNju/QLLxG8J+3OLMeNJaefZm8eGnJ0VAxaW4PkHcUMsI8Pft2Gktz T07Io4BxshRdCYFLYn1rFquCOddwL1TEuPu/Tr6Rsxi9J8ivpQaubtsnO6wdtfJKWzGl r1QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789627380; x=1790232180; h=content-type: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:content-type; bh=1MnZowd6oTOfaxXZbzT35kcRhO2jRSIVNLLWdFtgUAI=; b=jsZN/qHIzzBZ2Y98opPGVziVnur78qDnwLUtuZEArjOdOTQv+ZsflV+CcLicjEv0OU durJhJgcNfRI7+kpywkoXOok3uXeWeJaPix6BtvoA9ekohgDnIQhupOetJxuXb0hBKTK H+ppdql+R/a/O4uhC/rY2icW16N5VPFJwdoS4e1XZKIEkW3uhrXFyWeKybBxM8qgbM5U azvxJjuvJOUCybXQxKE+SRFxd1xTAlA8pkJDo9bUNK4K4ByRKA4m94lQH7WUHB3Q7nDm gmye+jebgG1/iLF5qJr0zZXr0ufQJqU6LHUHJzVGcjxIvtfyd955URtWha1DL6TQU8GG Yw5w== X-Forwarded-Encrypted: i=1; AKwUvBzh0TaudB4BexnBfdLERTb8p25fHCvisSlLgNxkFu5srYSXXACMLKCxZmV1KdKQY3+fLjFkRw6mWloOPxE=@vger.kernel.org X-Gm-Message-State: AFuF++lJinwwlhtXYaKA5pUfC/0uFuLzOeQnXAIosWEFyDlszXnbB+Cp DRPHdOIpc18DnW7OHXxGry2YpFeUbObu27FVXlf4pXov3rcQilkk3OsBUBPzWs3nbn2plnIbT+p U3XW/WHOfwA== X-Received: from dleb1-n2.prod.google.com ([2002:a05:701b:4241:20b0:144:4896:d41]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:6a0b:b0:3d3:ae1f:d7f3 with SMTP id adf61e73a8af0-3dd5f73ef30mr14251445637.19.1789627379362; Wed, 16 Sep 2026 23:42:59 -0700 (PDT) Date: Wed, 16 Sep 2026 23:42:28 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.55.0.1082.g2b9226bbc0-goog Message-ID: Subject: [PATCH v1 06/13] perf test test_task_analyzer: Isolate in temporary directory and make non-exclusive From: Ian Rogers To: Arnaldo Carvalho de Melo , Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Jiri Olsa , Adrian Hunter , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Ian Rogers Content-Type: text/plain; charset="UTF-8" test_task_analyzer.sh writes perf.data and temporary files directly into the current working directory, causing collisions when running tests in parallel. As a temporary measure until `perf script report` supports an input file option, resolve perfdir to an absolute path, change directory into $tmpdir for the test duration, and clean up in the exit trap. Remove the (exclusive) tag so the test runs in parallel. perfdir is derived from $0, which may be relative, so it has to be resolved before the cd into $tmpdir, otherwise both PERF_EXEC_PATH and the cleanup trap point at paths that no longer exist. Assisted-by: Antigravity:gemini-3.1-pro Signed-off-by: Ian Rogers --- tools/perf/tests/shell/test_task_analyzer.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/perf/tests/shell/test_task_analyzer.sh b/tools/perf/tests/shell/test_task_analyzer.sh index 0314412e63b4..6f729d9508f8 100755 --- a/tools/perf/tests/shell/test_task_analyzer.sh +++ b/tools/perf/tests/shell/test_task_analyzer.sh @@ -1,8 +1,13 @@ #!/bin/bash -# perf script task-analyzer tests (exclusive) +# perf script task-analyzer tests # SPDX-License-Identifier: GPL-2.0 +# Resolve the source directory before changing the working directory below, +# $0 may be a relative path and would no longer resolve from $tmpdir. +perfdir=$(cd "$(dirname "$0")/../.." && pwd) + tmpdir=$(mktemp -d /tmp/perf-script-task-analyzer-XXXXX) +cd "$tmpdir" || exit 1 # TODO: perf script report only supports input from the CWD perf.data file, make # it support input from any file. perfdata="perf.data" @@ -11,7 +16,6 @@ csvsummary="$tmpdir/csvsummary" err=0 # set PERF_EXEC_PATH to find scripts in the source directory -perfdir=$(dirname "$0")/../.. if [ -e "$perfdir/scripts/python/Perf-Trace-Util" ]; then export PERF_EXEC_PATH=$perfdir fi @@ -20,8 +24,7 @@ fi export ASAN_OPTIONS=detect_leaks=0 cleanup() { - rm -f "${perfdata}" - rm -f "${perfdata}".old + cd "$perfdir" || cd /tmp || exit rm -rf "$tmpdir" trap - exit term int -- 2.55.0.1082.g2b9226bbc0-goog