From patchwork Mon Oct 21 13:38:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 177086 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3436692ill; Mon, 21 Oct 2019 06:41:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxyD9rw6YehEvB7VyLqQSkfYUAzGZoUjK7ZnR2oiMuO+NRh9kHvHol6jFq3IVMFuPM6ALC X-Received: by 2002:a17:906:c836:: with SMTP id dd22mr2701537ejb.178.1571665265059; Mon, 21 Oct 2019 06:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571665265; cv=none; d=google.com; s=arc-20160816; b=ag7f9HqDgsnc9VTZrt3ZoGYlqyYGcvnin9/ZiQNg/rs/0A4UPnOmvi1tKIQy1bhdMM qxcFmP9gwa+56FRJ9lwdKHFfLjxNVXWS2qX922+xSJMtrQiB3nEaAt+dmC10DyaMtmUG osEvfwLPaTeT7frziwEnlHvcRZyDgPQT+AbdJstIpw8puOMpSzNMnE9/TQtsTob3nBK5 VvlSeJpF/kTEorVjyIaZWmNYIJZy/pms3saW7f7c0UCxUJ3NnhoeiPQA58fxqpWC1GQc WZE7oSVrbjycp9t5Kf1Hv/jF4BlT9BteEmrRzaKFDwB/iJW6fXGlj9udoYYw6K3LOThM AhPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=abOLawgMHduWFtRiLQNctf6hNZKX7O1Ebqzqlwi3/8M=; b=yGBxY1zh7IgyNSlMRogzTth3eOUKjRXMG3JF8R7+R3ypdilNeTlch6CAAObO5zPLoe 0xzCiX1zblDXkKxFJ6MSK3fv5Put1O2nYW9sbbuiMnUbsb5J7Aj2g2un/otFaTZZrj81 eoVKmtjFadyTNog2rYOuWAOraFtoSb62lhHe6jys0zJKnc7VSH/SiOkPQ7tKvr0Suljv urbxI7a3J+eSe+6za10SoyDU9yj2aOxBvj0S63bA84FHvQk6D9F6yPlRCnke/QnApm/R 6+6Y8KpRut58Nime1M73m4fqkN5/bDEpVBCS9UGRXxZpa8EP7en/p1bob95MO0+YuvEK 9jKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jAjZ1tnH; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si12292750edi.326.2019.10.21.06.41.04; Mon, 21 Oct 2019 06:41:05 -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=@kernel.org header.s=default header.b=jAjZ1tnH; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729610AbfJUNlB (ORCPT + 26 others); Mon, 21 Oct 2019 09:41:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:42790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729593AbfJUNkz (ORCPT ); Mon, 21 Oct 2019 09:40:55 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.35.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B01B9217D7; Mon, 21 Oct 2019 13:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571665254; bh=muH0CLm37RWgXCw9tdoRkRQCcOWFtFZ43VskU7mzloU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jAjZ1tnHd7PmRwzO7RGhm/kKtMDdxMJIwn8rvCuNK3rudi6ZvzW2yj2d9qpisJVur KYXm7OunKNoxH2xTQlr6CQNNU05/PlFmkUbuSQ9a8pkkYb3IDmRurlkk6ncictTLOt sbT/XF8JR7O0eJeurk8Si9inD1bAAGRVDyZmWGVM= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Leo Yan , Adrian Hunter , Alexander Shishkin , Brajeswar Ghosh , Florian Fainelli , Jiri Olsa , Mark Rutland , Michael Petlan , Peter Zijlstra , Song Liu , Souptick Joarder , Will Deacon , Arnaldo Carvalho de Melo Subject: [PATCH 41/57] perf tests bp_account: Add dedicated checking helper is_supported() Date: Mon, 21 Oct 2019 10:38:18 -0300 Message-Id: <20191021133834.25998-42-acme@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191021133834.25998-1-acme@kernel.org> References: <20191021133834.25998-1-acme@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leo Yan The arm architecture supports breakpoint accounting but it doesn't support breakpoint overflow signal handling. The current code uses the same checking helper, thus it disables both testings (bp_account and bp_signal) for arm platform. For handling two testings separately, this patch adds a dedicated checking helper is_supported() for breakpoint accounting testing, thus it allows supporting breakpoint accounting testing on arm platform; the old helper test__bp_signal_is_supported() is only used to checking for breakpoint overflow signal testing. Signed-off-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Brajeswar Ghosh Cc: Florian Fainelli Cc: Jiri Olsa Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Souptick Joarder Cc: Will Deacon Link: http://lore.kernel.org/lkml/20191018085531.6348-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/bp_account.c | 16 ++++++++++++++++ tools/perf/tests/builtin-test.c | 2 +- tools/perf/tests/tests.h | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c index 52ff7a462670..d0b935356274 100644 --- a/tools/perf/tests/bp_account.c +++ b/tools/perf/tests/bp_account.c @@ -188,3 +188,19 @@ int test__bp_accounting(struct test *test __maybe_unused, int subtest __maybe_un return bp_accounting(wp_cnt, share); } + +bool test__bp_account_is_supported(void) +{ + /* + * PowerPC and S390 do not support creation of instruction + * breakpoints using the perf_event interface. + * + * Just disable the test for these architectures until these + * issues are resolved. + */ +#if defined(__powerpc__) || defined(__s390x__) + return false; +#else + return true; +#endif +} diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 55774baffc2a..8b286e9b7549 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -121,7 +121,7 @@ static struct test generic_tests[] = { { .desc = "Breakpoint accounting", .func = test__bp_accounting, - .is_supported = test__bp_signal_is_supported, + .is_supported = test__bp_account_is_supported, }, { .desc = "Watchpoint", diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index 72912eb473cb..9837b6e93023 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -111,6 +111,7 @@ int test__map_groups__merge_in(struct test *t, int subtest); int test__time_utils(struct test *t, int subtest); bool test__bp_signal_is_supported(void); +bool test__bp_account_is_supported(void); bool test__wp_is_supported(void); #if defined(__arm__) || defined(__aarch64__)