From patchwork Thu Oct 20 17:26:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 6310 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp236151wrr; Thu, 20 Oct 2022 10:34:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7nqTpby/UgjRltNI3osz77BIlnQf0Vj4O42cFtZmpaUentSzvK/JrAtz5m29/DqaD8zL2V X-Received: by 2002:a17:906:730c:b0:791:997f:d65d with SMTP id di12-20020a170906730c00b00791997fd65dmr12199854ejc.18.1666287291153; Thu, 20 Oct 2022 10:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666287291; cv=none; d=google.com; s=arc-20160816; b=A4nG9hPDzSNHWvo3gKc7q5jkESK9KNigSVRjS8J7f8ZNX0X2/iAXFZNxeXrs4R/HVW hGMtcY1c8+D9RKTeJ78ORFwANovksLLHZ5ai/Dh76/0bpDjdrjtIrHaM7JfUgKiwG18f w10bB3MSF9Zu618jl9BdN6HlAHLTI3m3Euj/Def8R9pppfnQMANAHmZFR5epvqRDn4SH 9IE9/TCGMLoYY4/cV1Z7o/p5nlMjdKH1aIettHkazo45aqfv+pBqh8CNQzqLbwh3zfXS OuXxeRH5fkAIeWCPMHzXJu+YPs6abjwk8fPSmJA6bYBbaLPJ+S/EiguJKO22aBYjm16g 6oXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=76OWpPG6taxwukfGOQIVyyPduKaLqtTpv/FwNGCoWTE=; b=AkVxOJ09mipSlHUjp6rhCMbjIQD2F0OV/SaAhinQLz2WHw+RGUgklhOjSBFElIExb9 /+NbTiSTSNLDGiWzLeXCAgKOIxabuO2F2Adu+bjB3Yf9uw1ZeEYQuy3IGY1zfBIvnaNL vVXtej+zFS4vZpflw4bVpscT/q5DhWUzxGKq44BXZMRU3YFNYo8bE5LhZjqxUJ5paq0G yg0DFOc9n300wznZcH6g1rsnOG1Bkp1KictT9M1mDnF2JMiRo4pFAOBXwC0iaEwvvQlG muKbfG949zzA5adsABJJt8pQn46JH49HMMviTIsc8YD1tVjw1w9wxPNwizJKOob5uCPr nVxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z6KCfwmi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa42-20020a1709076d2a00b0078c80f5d81bsi15749908ejc.47.2022.10.20.10.34.25; Thu, 20 Oct 2022 10:34:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Z6KCfwmi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbiJTR1Q (ORCPT + 99 others); Thu, 20 Oct 2022 13:27:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbiJTR1D (ORCPT ); Thu, 20 Oct 2022 13:27:03 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFBDB1BC169; Thu, 20 Oct 2022 10:26:54 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id u8-20020a17090a5e4800b002106dcdd4a0so4183428pji.1; Thu, 20 Oct 2022 10:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=76OWpPG6taxwukfGOQIVyyPduKaLqtTpv/FwNGCoWTE=; b=Z6KCfwmiq9NtR6cwQNiCy/gQEIkNFbsC+MCSiH37yTkxXMGoqFN/ePPmZ48zdSmu0u HTxCPD3vtu71oueq4lkzFCHYjyTSb+9VX468KWxtkQMfRaeiKJMI8ORNBHNYtX+A/gpP dqMRomWBp0wu4v5Xos4rA7B+D2g5/OFdqNlWiPvYVeCHQFAly6j14dGpY9HiL2fMmdzu OA8Ui70Q861xHEXcSV493t9E2NiGY4GTb/G0DFqpq8ToSD5IBj6IUWKFZkcE21NbvZnJ dolOi1OhsS7MIcjqv9+reld3g2SwX2GKJmfwAOI0FXLrbIAYYztHihyDjjDVoLZ+QUWt k/nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=76OWpPG6taxwukfGOQIVyyPduKaLqtTpv/FwNGCoWTE=; b=6jRSezQRG753iOHsNiu92mv3FKvmjIzM4rhg1JjrSg+VUyTEH0f5+cYigxdeMtHlBu zIEoFag3Fu+81Cybw0yfQkHNjFXSKkYm2JGamxxCRYsbiMZKFW2NOqA/A1YkA1rW01IE aYcGTzG1QdCLhHsn27PGH7i8IjceOO4RSTAoVLK3M7wm/yp3cN3N8brJNnahMng7dMtp AwC5JQZvtCDgoWIYyKqNpKgJFQ22imIVX4wqXzyWtXcQNnQCwFyxgYWCGA2lxeLEVRVt 2Ubwl8qylgp1O9M/q/egbOmlJxDhr59nVkRLhjRJHoPvqnReKrPcFKFjI6SCnAHY11nA Xjnw== X-Gm-Message-State: ACrzQf2hNMaGZpxqNQzmiO94Y6SZEVKjiapY+GZ9Cr8iMbVYclfxYTgr b6Dd+lG7T4IVSRcNQusVhUo= X-Received: by 2002:a17:90b:33cc:b0:20a:7f32:9632 with SMTP id lk12-20020a17090b33cc00b0020a7f329632mr17637703pjb.149.1666286814349; Thu, 20 Oct 2022 10:26:54 -0700 (PDT) Received: from youngsil.svl.corp.google.com ([2620:15c:2d4:203:637f:7dcc:4bbf:4981]) by smtp.gmail.com with ESMTPSA id q13-20020a170902f34d00b0017680faa1a8sm12951754ple.112.2022.10.20.10.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 10:26:54 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org Subject: [PATCH 7/8] perf test: Test record with --threads option Date: Thu, 20 Oct 2022 10:26:42 -0700 Message-Id: <20221020172643.3458767-8-namhyung@kernel.org> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221020172643.3458767-1-namhyung@kernel.org> References: <20221020172643.3458767-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747228862355577543?= X-GMAIL-MSGID: =?utf-8?q?1747228862355577543?= The --threads option changed the perf record behavior significantly, so it'd be nice if we test it separately. Add --threads options with different argument in each test supported and check the result. Also update the cleanup routine because threads recording produces data in a directory. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Reviewed-by: Adrian Hunter --- tools/perf/tests/shell/record.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh index c59d1459c960..01aa9531b369 100755 --- a/tools/perf/tests/shell/record.sh +++ b/tools/perf/tests/shell/record.sh @@ -13,8 +13,8 @@ testprog=$(mktemp /tmp/__perf_test.prog.XXXXXX) testsym="test_loop" cleanup() { - rm -f "${perfdata}" - rm -f "${perfdata}".old + rm -rf "${perfdata}" + rm -rf "${perfdata}".old if [ "${testprog}" != "true" ]; then rm -f "${testprog}" @@ -171,6 +171,19 @@ test_system_wide() { err=1 return fi + if ! perf record -aB --synth=no -e cpu-clock,cs --threads=cpu \ + -o "${perfdata}" ${testprog} 2> /dev/null + then + echo "System-wide record [Failed record --threads option]" + err=1 + return + fi + if ! perf report -i "${perfdata}" -q | grep -q "${testsym}" + then + echo "System-wide record [Failed --threads missing output]" + err=1 + return + fi echo "Basic --system-wide mode test [Success]" } @@ -188,6 +201,19 @@ test_workload() { err=1 return fi + if ! perf record -e cpu-clock,cs --threads=package \ + -o "${perfdata}" ${testprog} 2> /dev/null + then + echo "Workload record [Failed record --threads option]" + err=1 + return + fi + if ! perf report -i "${perfdata}" -q | grep -q "${testsym}" + then + echo "Workload record [Failed --threads missing output]" + err=1 + return + fi echo "Basic target workload test [Success]" }