From patchwork Mon Feb 12 18:58:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 20267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp108699dyb; Mon, 12 Feb 2024 10:59:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWkGFJeyARtu9AjibCEJF7H/QnLueE3mRqie2LgllUDiYBG5R+eied8L8rWhEeGNGwk3ou7ZVo6C8UbpwabTYIA6g1+Dw== X-Google-Smtp-Source: AGHT+IGdZXWqibFz7a0L4ClCBlE9NJ1eiLbynrrAdwOLUmMyKM5wPuHLCid3yBKK3vqaCAzcuKB7 X-Received: by 2002:ad4:5ba3:0:b0:68c:8294:ad86 with SMTP id 3-20020ad45ba3000000b0068c8294ad86mr6494136qvq.33.1707764371351; Mon, 12 Feb 2024 10:59:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707764371; cv=pass; d=google.com; s=arc-20160816; b=VCERRva/emBa7PUUe1sFctFI3H4MWOkcD6hkW5i1FB2BlX0WwzmMa1+BrMWfpQFe0j U6SvRfoBftbpFIpMFzql6jvkmSzbRcXIFmC1wVQ0eELscwBdtwHcfNUvz+KMSUwILmlQ he6bxjoQz2ymYuKXWYRZqg/TyWce2S+5FkyYLRsgUJ9VqLtFDE9a5npeWZKu/CbsG26h B1GQxgDdOrmwcx6zSlADANQCxgdYxYPcgG6/kr2MYWV3D8mR+yX3dO+CnyqDw9V5zcGS QQY1dPtDel8ClAsejWFi2icL4GgBfRAGNxrf3kFlDTP90z3zgiGNFsAoZ5r0WvhgJLlQ JLJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date:dkim-signature; bh=/PJeKzS6BQLSmrUIcfcoDlL9jp1b7n/jV99AnuH7tUg=; fh=q09RW2NEQ7NIZ6UwIXXswV9y1jhhCKKEjRIa95z9J7w=; b=uiJC6e95smrTKNNXooNlYQZRFppK8EkHH+mP0cVOkadDXVkU1z4c7N4vgaBZgcWIiv J/BfgBVN+C25uXvk+FJTYjx8JHzKpOO4f4ewYCLBqpkxSsntBpaFUMxNMDcXxBJeap0O VtcJrOcyd3CsoQXeRtg3WT7oOc/vgzqfKS0EAYb6Bqi5kwb0jUpu62rKQTsAhw5Vd+Cj tkeYG7EF6vw/wqZof8cPOvB00VuxvWAsN7Oh3MuptDXcLGq1LVND94MSGU64fkSomVMn anZNYUz0lWEnTa4I2teY52bId007iQw6Yk2QcznZffq6nDENpW+/rIGRp9VgzEVB5+bD 7+Qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="YHdh4dJ/"; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62239-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62239-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCX97bcHKu4aDbh7GnRDkxhe9r3QQ4SE7nhyIvYI21oGy5y7qIfkF+XdVwkZSLd7RxfuyqppL/7tu6rQmRqDeHLep8rJ+w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t11-20020a05621421ab00b0068cf8165965si1028777qvc.365.2024.02.12.10.59.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 10:59:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62239-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="YHdh4dJ/"; arc=pass (i=1 spf=pass spfdomain=flex--irogers.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62239-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62239-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 279381C226A3 for ; Mon, 12 Feb 2024 18:59:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07A8F4655D; Mon, 12 Feb 2024 18:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YHdh4dJ/" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 53BE145970 for ; Mon, 12 Feb 2024 18:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707764351; cv=none; b=BY2iYOO8revn3GEBKRjOvIX3NQE8zEt/F3Re00tiAVwAo1lD09I59BWzMlLKcZzBLuXAPfvS7FxVfpVDIjjDbkXVv8PCJa/0u/U2uCUPJESKuZirTwREEiBtgrd9PbLswdD2UJa3MyGo5Ns0NXrI2PP0Gf2k10oMBmNc02b9XpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707764351; c=relaxed/simple; bh=kq2gDZXW4atNH6jHCSAioIQIj7W9ZIfsPic+NuVBLPE=; h=Date:Message-Id:Mime-Version:Subject:From:To:Content-Type; b=AydlVKzQdFpBs2eRb84yV7qYV5paBj+4srUIbwUzzZGT0wX2IjVo7VCcWKmxFkHmD1C2/Pp5CXXkHq+SEHxLgtTJHBQ8PHhwreTv+y33gz4dtubSUlf5N64IiIcY9sKkzN4pIgthAX18594DkV97K+NA0/ES8wcN5ys7S/ZdjbY= 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=YHdh4dJ/; arc=none smtp.client-ip=209.85.128.202 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 Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-60753c3fab9so14583667b3.0 for ; Mon, 12 Feb 2024 10:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707764347; x=1708369147; darn=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=/PJeKzS6BQLSmrUIcfcoDlL9jp1b7n/jV99AnuH7tUg=; b=YHdh4dJ/s9bsXLSl7WrBR9rC37y5VDpK4U/OTWW+cWUHSTHVXExGFEiuAgdOJ3kcUm TwfG5did7h015HR5xtu1TcNFBWxYu+ct5O6cf9AmB1+Hw0LQ2aoOEKPSx5qcUpf9h89f zVmRJvzEgOWKcD969EH6A2vQw4wffYbqDpE7J8dA1UTWc0RRsoIzgYikziADZ7aAfJZp EDkgmlL8DNDyhyIfams96UQ+Z5UMdZkAMTB7uusefD7SUVy/hFSZiMnLtO+/gMXcDFrJ Eh6Fx4QznsqBQip/HqXl09DYcVDZ5bHvA2v5dDpsx8xhYfIL6J2A4gH+EXnG2+C0tmFg jukQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707764347; x=1708369147; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/PJeKzS6BQLSmrUIcfcoDlL9jp1b7n/jV99AnuH7tUg=; b=ezqPk+6hqVBKalW037auT/bvOKnT7jVUsZF9NwWk59q41q20a74t/BnILCJH7EA6Oj SvpPSI7YkOoM3PKHhdM5fHOROUUMxKYfaMoUI/DYTn9Hjl+n1Tc7Ttym0NCoqe6lywwD ihqTcKVMLxTFHe6A879xWSOVpsB4Mh2sQZ/rTQcNltAmczXTgmCujz1y+4RrEuN1RzLG jCamMwjHLhRvXFGBggWQCFkFvlKHZhwPvgVn+7F0NqStg461VJgHW9MI+st6+yebR6WO XgmTbgQqYYyKYxSpXSUmow/6AfoCfgxQIA6o2FZrd0u3wVfnGbn1AxTHTdzAkYYAIYWT Tr0w== X-Forwarded-Encrypted: i=1; AJvYcCWYS1XpHZ8XKSaFFEn7zvCRLGycQLBQRrHVl4LaaBiQ5JgKMbeuDbKJ7Z14WQ50tlT26b5sgWXw5kHjjqH07ETQ/K1TX4V0i+beT3jr X-Gm-Message-State: AOJu0YwU91VjsnSS2nSiaWun6UG8M8m0sUQrWu8rwz5jJn1tOA0VuyEa SKg6cOBQ2DPRsC2J9W4kus+Kg+u0KvLC/X37LdWny3O87jOcZOorSec7IlXgVbUC/ndOLvUPly0 Io9dOuQ== X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:125c:bcda:4fe2:b6e6]) (user=irogers job=sendgmr) by 2002:a81:920c:0:b0:5ff:6ec3:b8da with SMTP id j12-20020a81920c000000b005ff6ec3b8damr72459ywg.1.1707764347288; Mon, 12 Feb 2024 10:59:07 -0800 (PST) Date: Mon, 12 Feb 2024 10:58:50 -0800 Message-Id: <20240212185858.68189-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Subject: [PATCH v3 0/8] Run tests in parallel From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , James Clark , Athira Jajeev , Kan Liang , Yang Jihong , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, llvm@lists.linux.dev X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790720733302324426 X-GMAIL-MSGID: 1790720733302324426 If command line option '-p' is provided, start/fork all tests in the main thread and then gather them in order at the end. On a laptop test time was reduced from 5 minutes 21 seconds to 1 minute 50 seconds. The option isn't default as the test shows up perf and test flakes. The '-v' option is modified so that 'perf test -v' will give verbose output only from failing tests. v3 - fix a crash if shell test directory isn't found, remove merged patch. v2 - fix parallel test output/verbose issue v1 - initial PoC Ian Rogers (8): perf thread_map: Skip exited threads when scanning /proc perf list: Add scandirat compatibility function perf tests: Avoid fork in perf_has_symbol test tools subcmd: Add a no exec function call option perf test: Rename builtin-test-list and add missed header guard perf tests: Use scandirat for shell script finding perf tests: Run time generate shell test suites perf tests: Add option to run tests in parallel tools/lib/subcmd/run-command.c | 2 + tools/lib/subcmd/run-command.h | 2 + tools/perf/tests/Build | 2 +- tools/perf/tests/builtin-test-list.c | 207 ---------- tools/perf/tests/builtin-test-list.h | 12 - tools/perf/tests/builtin-test.c | 369 ++++++++++-------- tools/perf/tests/shell/lib/perf_has_symbol.sh | 2 +- tools/perf/tests/tests-scripts.c | 257 ++++++++++++ tools/perf/tests/tests-scripts.h | 9 + tools/perf/util/print-events.c | 12 +- tools/perf/util/thread_map.c | 9 +- tools/perf/util/util.c | 19 + tools/perf/util/util.h | 8 + 13 files changed, 507 insertions(+), 403 deletions(-) delete mode 100644 tools/perf/tests/builtin-test-list.c delete mode 100644 tools/perf/tests/builtin-test-list.h create mode 100644 tools/perf/tests/tests-scripts.c create mode 100644 tools/perf/tests/tests-scripts.h