From patchwork Fri Oct 11 09:19:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 175925 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp487404ill; Fri, 11 Oct 2019 02:20:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxt+FfcTLrQy5ZLayIPhVTZmJ2MJLY6LUibV10OpK4Vtq9Vj0t/fHEksS419mB1VLcHmAB9 X-Received: by 2002:a17:906:e82:: with SMTP id p2mr12598834ejf.237.1570785604017; Fri, 11 Oct 2019 02:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570785604; cv=none; d=google.com; s=arc-20160816; b=E1G93EU98pYLiCDeVnBTLZbAy/NbgZn2w2GEJDMI9PEc+qpmC23wD8Rsn7ZwS3uk2b GPwPJSvXQk+rk0FJondLccNZ3DZxQtq312AdViBPAMuT/RzSbhIvY7iB43CICXvQEFzI 6MMQkvzzEGfGqjGNNn/SLh7vmCjLfN4/xIybOzH0tU4e2Gh623dC+2bcRaSYi2PEKnU3 b4w4xfuOVd2juSQmWHeE2DvSSM0iK+DN56ZHWqXVJDemhTeUoG3WFffXCWvYPxyappS5 8KGOCmojwy38c5THa5Mp8F/GMBIH6BQMxA7QBZNXQs9rn+1uXP2xRl13O957JKyv6Mis P4pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=JePE8ClpvmkdREqAemoY5/Xc8Y8z7AI4rivC6NTKD84=; b=AoNxPyLEyB4neuQ5sQzLAd/s9Zu27/rfrwSJJSBc2Zm0urCsLK/JBVonoMz9inDhZK UBIu7nt9MZx/tzmcNefhkNROgW9Xlc4mRzcegJLOWKCn8HBdQ11zgMhIjb4KUKO55hXz ORdH9gXM5kTYB8wlNKMbXlImpbskHVCDvQL/LQYtoO91H724/fK/gPZU5MxQNsOT6EvJ zPRH38+CSWmHWhc0MxBn22sUricWdgc+3Abc/ds4PL/lABM3Wj3B3XH4CotLwpTRupQS klK69tofF9juoySWTk1GEhLhcSp8KYnPBt394+v/Nqikh36QHqDuY8NgYRrsEKEXwFNI yYYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jm+pwRG0; 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 r16si4754427edo.307.2019.10.11.02.20.03; Fri, 11 Oct 2019 02:20:04 -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=Jm+pwRG0; 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 S1727641AbfJKJUD (ORCPT + 21 others); Fri, 11 Oct 2019 05:20:03 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38142 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726863AbfJKJUC (ORCPT ); Fri, 11 Oct 2019 05:20:02 -0400 Received: by mail-wm1-f68.google.com with SMTP id 3so9471763wmi.3 for ; Fri, 11 Oct 2019 02:20:01 -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; bh=JePE8ClpvmkdREqAemoY5/Xc8Y8z7AI4rivC6NTKD84=; b=Jm+pwRG0HzWyJjQGN+1v3eL2WIqd5IsEwLRdxn/PV5CkmMnZpTcCwdw/MI9JFaAQxH 5Bme0bpmr00gbYIaw5o1SqfSl3V3VgAjFwPXzemCtKQpeZUpAsWfaq9pjhv9UsgC0cCe Y3uB5VEEmmL+i605dBiywQX/4xlOpr5emrQLVTambUIj6xa8Jnr6oZ+U4cGK48S3bcA5 fqEL/ctyy9UvxO9K94DZ4q56v8nnxOkcC+2OG2PslOJfYFu+6V8FjiP9Uyov4jCiHjOi zoJfRSbt2cFf5Wf0uzmWlgihH8n3o/hVgZl+ZLC81fteGXF9rM+oMOWbrX+XZIl3R0lB L+ZA== 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; bh=JePE8ClpvmkdREqAemoY5/Xc8Y8z7AI4rivC6NTKD84=; b=oYDB3NOWKzT61YOzHRHltgleiLAua3ib8v4o8M1zrBfOR4SI80ycczcMT3PCEFyrBB 9FknD/SKEDuu+kFdbEbHr0CXL57G4JQmqmiCZpahpU3nDRlXvkIyPnCA0SEyYXH12GsS b6ZJmQ+Z6h3nV1zw+ghizS41XmVTPnNdEceZrF0JFJVqR2dxOsba1J0OQbidA1JW33iQ FKyoCqZd7HUVzkO+8GX1dyTVxCrUc24Q9yQvVbucH7Ds5kV9m5uze9ZwBA4kDCTgLAWc pYNpbIfeZykzUS0fpfLmT0d2q7gsuXOIkw4PjX8qjCTzsfWiz/jAF4De30sd5WQ/pRhQ MD9g== X-Gm-Message-State: APjAAAXRcVy6MLMnI4R+3sT1TyCei2uWZaie+pPqmYas+hqgeJfuI96v pOB7Ut+d19a/Hh/ZxtuTTWFduw== X-Received: by 2002:a05:600c:2201:: with SMTP id z1mr2463573wml.169.1570785600656; Fri, 11 Oct 2019 02:20:00 -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.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 02:19:59 -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 1/2] perf test: Report failure for mmap events Date: Fri, 11 Oct 2019 17:19:41 +0800 Message-Id: <20191011091942.29841-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When fail to mmap events in task exit case, it misses to set 'err' to -1; thus the testing will not report failure for it. This patch sets 'err' to -1 when fails to mmap events, thus Perf tool can report correct result. Signed-off-by: Leo Yan --- tools/perf/tests/task-exit.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index bce3a4cb4c89..ca0a6ca43b13 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -110,6 +110,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused if (evlist__mmap(evlist, 128) < 0) { pr_debug("failed to mmap events: %d (%s)\n", errno, str_error_r(errno, sbuf, sizeof(sbuf))); + err = -1; goto out_delete_evlist; } 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; }