From patchwork Fri Oct 18 08:55:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 176786 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp556000ill; Fri, 18 Oct 2019 01:56:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1Y+XSBKqjIU9lTuo/S+f+/+D8V2Mfmt5tbK5Qz1s1Fp4ePcktmbNEihp4STWwHc+gB2Dx X-Received: by 2002:a17:906:e108:: with SMTP id gj8mr7811699ejb.1.1571388998705; Fri, 18 Oct 2019 01:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571388998; cv=none; d=google.com; s=arc-20160816; b=APoLuAMHxC4UCELmQQXcV5FvGdAHvAnRdDb1IAYKKzfOI64gx6cWbrAaeLhQVDE6yS KZqX0PYHakdxX8tRzDPk7EWJXuahZ9BvbFiE5KlvUw6UIIlPjbk5QifXhjlGX9DE3r5e nOHgWnjexejcWu+oHAiobT7pAGxkqplixrefwxaqRpVqoyOBbi7N7DlZSFxZt1ukJ6Bk J5JyWaSoGU7WRuS20ElvjbGABEF+wihgIMi6B9DeEyul7jEjVhsNhL1nKyDuakExKkEv zg/NlOmfOi50JIK9Qc+v7oWDcqoNmoK4ENaVwxErUrEnwR82ORo+EFD8A+hAHzMtvJfD G4Cg== 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=snrzNKZP8UfDDZs1OeUEUGCjAFE7mZySQcyt2rcLINA=; b=reSJrZrdcNCIAsInnPurryXzBZLfRNaueCHqOmn3fBiIZdDF0KMpfbjcL94jELvY1t eLOLqd50PtCf6NJuoPYh+d6Xyr53xcf511MBgf9WM0vjQHZGMH+YqF5COf6tYqV6WPSA vGuwpEm54/GY3jzq92hN4NQYC4Nu5Aq/gW8I+BtmKlDi8+nIl9FLrclGU6iERxbq6owd jMCJEfW/Clw1+ht1tA901r+xNjpKlzMOcXt0laEMXw4XvY95CzXkFfBR5k5tm4TAGa7h NdnsVAD1jGvPmclkcLWi18p+36IOXCKBbNKpoFTTK/fuY+WQxrWNLkorUCrBnlfd//sX k3Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U2HT03hz; 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 y7si2949703ejp.378.2019.10.18.01.56.38; Fri, 18 Oct 2019 01:56:38 -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=U2HT03hz; 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 S2442217AbfJRI4e (ORCPT + 26 others); Fri, 18 Oct 2019 04:56:34 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:36826 "EHLO mail-qt1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731444AbfJRI4d (ORCPT ); Fri, 18 Oct 2019 04:56:33 -0400 Received: by mail-qt1-f173.google.com with SMTP id o12so8057059qtf.3 for ; Fri, 18 Oct 2019 01:56:31 -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=snrzNKZP8UfDDZs1OeUEUGCjAFE7mZySQcyt2rcLINA=; b=U2HT03hztP06LbbfQbo8H7jDrof9hC5KyKHqdcod+av5BovCeale9v/m7fV3jWYZoE shZWn8PaWaYYY64CEB4pR9zkRaRvyM683F97eX8qfF/m3db27g5+drVoSJnMI/1x5MXp /kZ5iwBR9BWkgi39e1WWhE/cRV/OSJdcGje83sYyDJOVzkKsf8jimWeMeWf9aN/sz9Gx stH6hMVs/wRxZe9z6NCh+3GoL5t/oAAyiR+oJlj2hPwBzfSl6QoJ4j8cAPflXYYD0Wlk dxgnVbyFq+MmYTPPxw5GV/DdnQtrjH1o2eF5fFe+1eXWWQF+TDZHgZVRPDbcAxXcQowv EBIA== 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=snrzNKZP8UfDDZs1OeUEUGCjAFE7mZySQcyt2rcLINA=; b=Wh5Wuf8ATt8C5UHiEWFG3nBzjg2EvQY9K5+H1WzSG0Rn69LSevnMBlxohL2DmfLrsZ rOY9qdtA6nmryfXo03LeW0Ct/RizQYlBPa8o0XVbrNso7OwgTr8f0Z+Yrv1bkVj7Oqlw h+ZGSdV6YtB3HpP/VCggf3StNW+pkg0O83itJFHLqoBco97Kfn3p+Nyq0UbSmGs8Oawq 4yrDlPLS8VvyRyLF2Y3oOaDC+AMaWBEELEsHXljCZ8uhfCCONKtEtIfu6u5rbBOgLPTV cGcggJmHBuzdz/ZcfIy+0k/029+dAGnp5V8clgVWVoasxqZ+53EAfVyQMiZxbQdUw/gx elkw== X-Gm-Message-State: APjAAAWOLRStoZFwZOV85D7irsX8Z7Tu52KafxFnj3IWAowE6e6+NJMu PdQo2Ver5wJ5QbWXtf04z3TArQ== X-Received: by 2002:ac8:27b7:: with SMTP id w52mr8777575qtw.78.1571388990676; Fri, 18 Oct 2019 01:56:30 -0700 (PDT) Received: from localhost.localdomain (li937-157.members.linode.com. [45.56.119.157]) by smtp.gmail.com with ESMTPSA id a134sm3076571qkc.95.2019.10.18.01.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 01:56:30 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mark Rutland , Will Deacon , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Brajeswar Ghosh , Souptick Joarder , Florian Fainelli , Adrian Hunter , Michael Petlan , Song Liu , linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 2/3] perf tests bp_account: Add dedicated checking helper is_supported() Date: Fri, 18 Oct 2019 16:55:30 +0800 Message-Id: <20191018085531.6348-2-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191018085531.6348-1-leo.yan@linaro.org> References: <20191018085531.6348-1-leo.yan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arm architecture supports the 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 --- 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.17.1 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__)