From patchwork Fri Oct 11 09:19:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 175926 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp487476ill; Fri, 11 Oct 2019 02:20:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPkgWWyL2CbWHOgflGliszr6rgEoUdLal/Vz4zXmZPhU9Kz2z61dfuE02nFLgIABqTzr1d X-Received: by 2002:a17:906:6d82:: with SMTP id h2mr12641086ejt.127.1570785609451; Fri, 11 Oct 2019 02:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570785609; cv=none; d=google.com; s=arc-20160816; b=MVBS/I+WVAqNbg5aJCvBM9aUURLMk8uDfYG7vMH7b0SARyuyDcB9hjrC/xQrS0ZH5R 4fDLYI9ld0FYFhE8Xmfn0XgZtPLOhXrMoHo+D1ckZ6YQ0BKG9ldrbwOljJIFyGFFBL0e dvfC9svW8TK3ufqCW38uiniEOzkgVBNA92Nyn7ccMJaCxh+x4n9xeHUfBWuZHlILzu5v UYXs1sQxu4BseKbA6UTGZhdN8iF8VNUMtKGpCFND/F1+2tf/qaailYDABa/HdqRPAOck Y5QBRs9kUf7BsOgk0pMf8ZKON4ldk+3528KQL+wEoMaDx06YlXIEMUQ9rZUPkWlh8kUQ H9iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=qTreiY0r3fTwoJUxRJnyLrebcRQRT7U9Xfdqs5o+giI=; b=vmqfB3s/te4rCtRCWVSX7SLRFjH5n7Mk8EXBtKtyaJdRk2dev3COUSIj0GaIA92Cp/ +ZLHnCG+LAgwGy468pxVNMVhP5F3BbNUc1vYJzmTgfJtIwwYqozc5tLsKvOpfweoXw+D ruQzZ4J3UYf5qKtH2vwg5YA44MeYhUwu7gWHL7ZQsKB5Hg9CdRH8G91xZuAmV5OOnolL 84VG9LEzchr2TmyLuqVHn7wHC6sB64+l81R4YF9c8jT5+l0Ou6GVyYQl5xeo5heuYj5B pskK9eHHiMe/Skl7gbKYPhaeYhHFFI/QOIrtaiAg1WzL10CpD0Hbzrk+Pb8aSBmL8aqj c2iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mHYydlo2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si4698165eju.406.2019.10.11.02.20.09; Fri, 11 Oct 2019 02:20:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mHYydlo2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbfJKJUI (ORCPT + 21 others); Fri, 11 Oct 2019 05:20:08 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35818 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727125AbfJKJUH (ORCPT ); Fri, 11 Oct 2019 05:20:07 -0400 Received: by mail-wr1-f67.google.com with SMTP id v8so11048991wrt.2 for ; Fri, 11 Oct 2019 02:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qTreiY0r3fTwoJUxRJnyLrebcRQRT7U9Xfdqs5o+giI=; b=mHYydlo2SqywtwYM3g8rRTyOTaZ2DBvRJEpZhZPD1tC+iz0x4R6WeN6JaUYRAztMUG gn2u58+m9hI4YnuqqyWMWrdrjhVE1t8obVZLZLJ0xA//K0dsZVu0ikMZdLAH7IouHwcG HR7xJuoCu5fYsYytFqGykH4pl2m8vh6QoCfCoKZqz5oZMeZnMuZAsk83mbmZtzI1KWbt mGDZMm/X3kDPWmPqyjO+n3mRwqVKNmDmfZcM6Yf9u8ecAATx3RHDpnr7HY7ok3hmys+q ey0hxGyhjdsIZ0L+aD+db2hK+1U/lH/EqOF3Lbc6P6vhE1k0ygypHyF84DO/VYncpPLL twTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qTreiY0r3fTwoJUxRJnyLrebcRQRT7U9Xfdqs5o+giI=; b=ZIZCMrSmD6b2c7zREPql5fKZ4Nj31QFjkuUHY3B1DJXxsuPRPfK3ie9yudscl0TPEc /2pBzDN5kkPR24vA2w+ndXCOm/Tvc3agxj+bgdLYjwfxpkXEt6cgy7KC9ulrWuywtJdH dqPOfWKLuqgvPcbo4OJw8qf4WMeWkAYZZCdnjzhgLeMaBKlMkZfai/0dfAjzBmAlBRHe HI3WKIfeN2tyq75MIypv776uF5O/uoOWCC17AEkx/rN5TImjOO/LhO6OswBKosAOz0Pn dyGiRI6eeiIJpQxY7mkWmhezEmAEifuHq+IcydwAJTx9YPKyrT+9Mteg3GDOSbwWSF87 RD3w== X-Gm-Message-State: APjAAAXzl5vVqucQUrK38SroajiREyFxAH7OfAtYr2wfQlwOs8A4c3Tf dyK3c7eaTOL9XQEdTFjx8kPuPA== X-Received: by 2002:adf:ed52:: with SMTP id u18mr13058979wro.16.1570785604033; Fri, 11 Oct 2019 02:20:04 -0700 (PDT) Received: from localhost.localdomain (li2042-79.members.linode.com. [172.105.81.79]) by smtp.gmail.com with ESMTPSA id u10sm8603492wmm.0.2019.10.11.02.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 02:20:03 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 2/2] perf test: Avoid infinite loop for task exit case Date: Fri, 11 Oct 2019 17:19:42 +0800 Message-Id: <20191011091942.29841-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011091942.29841-1-leo.yan@linaro.org> References: <20191011091942.29841-1-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When execute task exit testing case, Perf tool stucks in this case and doesn't return back on Arm64 Juno board. After dig into this issue, since Juno board has Arm's big.LITTLE CPUs, thus the PMUs are not compatible between the big CPUs and little CPUs. This leads to PMU event cannot be enabled properly when the traced task is migrated from one variant's CPU to another variant. Finally, the test case runs into infinite loop for cannot read out any event data after return from polling. Eventually, we need to work out formal solution to allow PMU events can be freely migrated from one CPU variant to another, but this is a difficult task and a different topic. This patch tries to fix the Perf test case to avoid infinite loop, when the testing detects 1000 times retrying for reading empty events, it will directly bail out and return failure. This allows the Perf tool can continue its other test cases. Signed-off-by: Leo Yan --- tools/perf/tests/task-exit.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index ca0a6ca43b13..d85c9f608564 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -53,6 +53,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused struct perf_cpu_map *cpus; struct perf_thread_map *threads; struct mmap *md; + int retry_count = 0; signal(SIGCHLD, sig_handler); @@ -132,6 +133,13 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused out_init: if (!exited || !nr_exit) { evlist__poll(evlist, -1); + + if (retry_count++ > 1000) { + pr_debug("Failed after retrying 1000 times\n"); + err = -1; + goto out_free_maps; + } + goto retry; }