From patchwork Fri Oct 18 08:55:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 176785 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp555870ill; Fri, 18 Oct 2019 01:56:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5lZo+RWdGxAmvuhdl7kiukjAM/mG4GEzH9EzJVnjHfMY/1yryToHpE6cFFyEZngnf+ngO X-Received: by 2002:a50:aca5:: with SMTP id x34mr8443340edc.130.1571388990792; Fri, 18 Oct 2019 01:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571388990; cv=none; d=google.com; s=arc-20160816; b=fUp+6tacB+gfLLzJAYgl2qynzNQQOzv1HEbBcq4ViVfS107KjZBTIFs4N7ohEfkkxP PDiXW3iYZIiEKx74mgR+dv5+JBIu+QIxs5DO7PTvxo9wJgTkVExbnQKBrhJ4nE2a5lKJ 3LONj7xWmkv+xDbE+FSTU7jg2ZmeSw9Y7upq9BtCX1HbnvkaF2cP3FCKP81bDzmkvLdV ShMolbX9RayNIGzxSc05lr0vruGjif495R6x0gCALaCckxED8alm8a/bjRB7EP09AId+ 5XGyr7FzqwGG/AKT64rHkqZN9/s0A1f2g6DsM5BoMWRKZpfaGoJLtvga/bOLHcb5EnRS wGrQ== 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=ugnrp2k1zFImPpsw0D6yHUbYeoEMpwYIr1OCnGwoTi0=; b=QbgkRkDcX5VpXGc1uqOiFmWCuZgkQn+/yTW8o8KwJNHIW93w0N2tvVbDQt2MoefRES ZDPW7X2WGgOnd+xa/ruMy+76eKx2CSlrhpY523z5HvyNTAxi6akPyZYw1xibZLQIdmxc T0R+1FhaOIt5/Yj/vgpq9NOAprxxTDl6uEpL15lU0kCjAXxA6thOHOdLFQcE9C6n/6uC tmeDU7UtcF+Brxmvml3xaxUAmy0hZdrbDS8Pk3Sp66tvdDKvblm6K355KpKf6sV8adaf AOS/VxWyGgEiykGXNLEIdTeUvGXOtNKIPZdAFCoYI68m0mRQSuEO2ayHLMXK3espXTvm cVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rm90ugQI; 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 x12si2922757ejs.203.2019.10.18.01.56.30; Fri, 18 Oct 2019 01:56:30 -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=rm90ugQI; 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 S2409645AbfJRI40 (ORCPT + 26 others); Fri, 18 Oct 2019 04:56:26 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:34108 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731444AbfJRI4Z (ORCPT ); Fri, 18 Oct 2019 04:56:25 -0400 Received: by mail-qk1-f196.google.com with SMTP id f18so3985594qkm.1 for ; Fri, 18 Oct 2019 01:56:25 -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=ugnrp2k1zFImPpsw0D6yHUbYeoEMpwYIr1OCnGwoTi0=; b=rm90ugQIlFRTFD3MXHb2shRtEJTxh2AB2m9p3GuCl7KTPQRvTRViHDwpf0aDzOuYL+ r54vROHJxUMIMnj1pKiu76h3NwsR4hdCmPxdEluS2pCpKHmEKFVBA3BUYeMVT59T9Dru 4r6xSPxGTABKsNBvulDht13i7zwI7gCRy0+epyFksMx5Ww9oqyYkLOuaDw/KnIKOZHQ9 AMhpjHqAu5DGpSXDnBc9Ldra8tfgb2PIRp/3o61M/YBcI0b18iXtIhhiv7CwZUF2f6jX 0y5hmOelHTDjVkjo5HGRgC0YPMd5wdt5v/I3HcY06hFjAtrJUIiHb7i/E2WEJ4v9pgjr 3fGw== 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=ugnrp2k1zFImPpsw0D6yHUbYeoEMpwYIr1OCnGwoTi0=; b=OGeeiPD1DNPF8gNGcvFtIJOgk9S0sYC4vhasHKtIOLelDyZ1a7Ktn2gCpPlkEohzMt lFyZ6wQXSA8Ch8BtFzxVI3D4EcQqoWJJ3rkyxnen1jPeV1Thp6ZRe0ZOjKjceYQvpmTm 62DaBbtLFEA0S3Fr1oR5oEHyPn2a0Epv94ZxNek51PPqZrgeuE8DEnlz/qFBg3o7hSIw 8LNJ+dDGlQMvKyvrem5RUvg1YzkIjWRk9V8ArVXwCJrNTB7EOg2c0gRr8GmX7iRq/PBr bUDUFNelF0dZEifztJfDVvGQ31R1I+dc88L7o42I1JZlpyIvOLh2MFHt4yK32YhkWdfW NHwg== X-Gm-Message-State: APjAAAXXHKjBpdx933Q8Ht8bX5vuEgHWckLGglarrk0chrZ1o6ha0/MP 5OAehoUZAse6v/UartzyRMKbrA== X-Received: by 2002:a05:620a:74b:: with SMTP id i11mr7490306qki.397.1571388984550; Fri, 18 Oct 2019 01:56:24 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 01:56:24 -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 1/3] perf tests: Remove needless headers for bp_account Date: Fri, 18 Oct 2019 16:55:29 +0800 Message-Id: <20191018085531.6348-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 A few headers are not needed and were introduced by copying from other test file. This patch removes the needless headers for the breakpoint accounting testing. Signed-off-by: Leo Yan --- tools/perf/tests/bp_account.c | 4 ---- 1 file changed, 4 deletions(-) -- 2.17.1 diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c index 016bba2c142d..52ff7a462670 100644 --- a/tools/perf/tests/bp_account.c +++ b/tools/perf/tests/bp_account.c @@ -10,11 +10,7 @@ #include #include #include -#include #include -#include -#include -#include #include #include "tests.h" 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__) From patchwork Fri Oct 18 08:55:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 176787 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp556030ill; Fri, 18 Oct 2019 01:56:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLjbDijncoYlsCppH6TF5+/oZmkOOXienJGToJZy8A+4SSvpaHKs+oLBmAN/110GLC/wD5 X-Received: by 2002:a50:e445:: with SMTP id e5mr8250055edm.257.1571389001563; Fri, 18 Oct 2019 01:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571389001; cv=none; d=google.com; s=arc-20160816; b=p8jZXjK9+VYDDBzXcNj6+pNasT6t12Z1WPd2UkOl/yZnsY3jYQkw0Am1S0BqAh5juZ Cz+6V4lLM3prUYbTwdlAvciMJUpO80dd/ws/4YCUJ8NNGmi/vuHUaD83VnpEtLHOKNeX z7EITAkGm2+C+oRyNSqstkog0xcYtDZ4YBrT/9U0zxWzgYIzbs/8SPU4dVWpGepUUUwb 3n+SmDKRdYGAo3v+fT7pi1eIRATPtoY/ZSHx0BiQtkRtdtOq2sgt+ueHOTfXWSpJAHgP gvje7Ij8w0T2lgoRlRsBlOndTifef3VMnzfzMx53GAApgBD1x7kvzwlaiK7uW9S6Aw+P q4Sw== 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=dmDzTeY3CiACq15/Bx/rwtvcb3Fz1hiuxWty6anzD54=; b=POmSNfDzRtJGn+bY7emrmzpxTK76x5YZlzox9EUocftlcbh8Mkwirh453uVvSkX8cc ujdCwiPNL7A8O+dmkjJzpcVIvgmMT5i665MgJL5v3Q4LuNtEAWqnA22N0qQmIELCTId+ a373W9KtZC1Dg+Q1JJcqlaaGwhxgGSaDxHNAn/iDubCgcLXvuEGJ29WtfSZEVb6oOcRk Weh1pX/9Se6HwBuIQErlUnEVTL114gUi1Cw87X43n4fVzf8bn8b3YTzodTfSq5KdXvVe Py79/qMCtduWaJReyYq8F02D4veJnkGzz0MwWOb/XB+AdD31Qb7F5axT4BwFfLLrGmKz m42Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v1CsJy5Z; 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 m21si3512970edc.153.2019.10.18.01.56.41; Fri, 18 Oct 2019 01:56:41 -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=v1CsJy5Z; 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 S2442254AbfJRI4i (ORCPT + 26 others); Fri, 18 Oct 2019 04:56:38 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:37673 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731444AbfJRI4h (ORCPT ); Fri, 18 Oct 2019 04:56:37 -0400 Received: by mail-qt1-f196.google.com with SMTP id n17so8042854qtr.4 for ; Fri, 18 Oct 2019 01:56:37 -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=dmDzTeY3CiACq15/Bx/rwtvcb3Fz1hiuxWty6anzD54=; b=v1CsJy5ZeASy786vCf6HHlz7oLFg3UVvKEFm/RVhb0CExXVXw1CopZem87PYLnPmRl 7ijznXPsyC4Ry7yhh+Et6tRPEccPHBxYpRvKBCnupSXE59r5XftU4dKtPP2k19t9wFpt kYZInbvlu2ycsefybi04TGAyQQAheQSEITk0L4dbl45z18S1mTjXyb5Xe+U2M21/p1zI 6pitk9736k1Vzr4/ZpMsyb10cqRDXHV7SWjYK9Eyu9emJiayf53yVjcjc62Fn6BP4/pT /b0AxeUjXrm95pDBIL4iQOZWZa8O3I0kATFLalqzS1tbTXFCmm5+Yxty2xgi57NkNN3f 2bPw== 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=dmDzTeY3CiACq15/Bx/rwtvcb3Fz1hiuxWty6anzD54=; b=uWtukTh2+ZXUSRzaKOEXjZS23MKT5TY66xV8XDTTRKFCAS16ASRWiKVRrZGNZLTepP 2m6p4mw/D31wXN8LWjJBZdpMOru1z7jQGj+INxycz4hGCGrpaXC+rLPauqnis9X6/jtZ AvLE/3sUX5LSPPXtb1ZzxaJD7giWY+3vcVe+SiPE+AKAWsPtyneeluYtJbCukO3XroKR gtQomsxX1vQSFaeSMQ8n5y+1tHqP7I06BLtdqwxA0eSDQJ+/5xHbs6/afBCpTxr1FkqE vtaXz4MdhLOy54htDhOHDhxr3O2lhsqy+jYR4dm4LJcALLEwWXcNO+Cs6DhGBjqwWNR3 Fw2A== X-Gm-Message-State: APjAAAVu7b7sbt+bw2RJWOM8r5IewHvakYtbo83di4ZcT2lwSyDy3Vo3 o/fpb5k7petuhog9CNCI52gV9A== X-Received: by 2002:a0c:c3c4:: with SMTP id p4mr8762728qvi.178.1571388996362; Fri, 18 Oct 2019 01:56:36 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 01:56:35 -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 3/3] perf tests: Disable bp_signal testing for arm64 Date: Fri, 18 Oct 2019 16:55:31 +0800 Message-Id: <20191018085531.6348-3-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 As there have several discussions for enabling Perf breakpoint signal testing on arm64 platform; arm64 needs to rely on single-step to execute the breakpointed instruction and then reinstall the breakpoint exception handler. But if hook the breakpoint with a signal, the signal handler will do the stepping rather than the breakpointed instruction, this causes infinite loops as below: Kernel space | Userspace -----------------------------------|-------------------------------- | __test_function() -> hit | breakpoint breakpoint_handler() | `-> user_enable_single_step() | do_signal() | | sig_handler() -> Step one | instruction and | trap to kernel single_step_handler() | `-> reinstall_suspended_bps() | | __test_function() -> hit | breakpoint again and | repeat up flow infinitely As Will Deacon mentioned [1]: "that we require the overflow handler to do the stepping on arm/arm64, which is relied upon by GDB/ptrace. The hw_breakpoint code is a complete disaster so my preference would be to rip out the perf part and just implement something directly in ptrace, but it's a pretty horrible job". Though Will commented this on arm architecture, but the comment also can apply on arm64 architecture. For complete information, I searched online and found a few years back, Wang Nan sent one patch 'arm64: Store breakpoint single step state into pstate' [2]; the patch tried to resolve this issue by avoiding single stepping in signal handler and defer to enable the signal stepping when return to __test_function(). The fixing was not merged due to the concern for missing to handle different usage cases. Based on the info, the most feasible way is to skip Perf breakpoint signal testing for arm64 and this could avoid the duplicate investigation efforts when people see the failure. This patch skips this case on arm64 platform, which is same with arm architecture. [1] https://lkml.org/lkml/2018/11/15/205 [2] https://lkml.org/lkml/2015/12/23/477 Signed-off-by: Leo Yan --- tools/perf/tests/bp_signal.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c index c1c2c13de254..166f411568a5 100644 --- a/tools/perf/tests/bp_signal.c +++ b/tools/perf/tests/bp_signal.c @@ -49,14 +49,6 @@ asm ( "__test_function:\n" "incq (%rdi)\n" "ret\n"); -#elif defined (__aarch64__) -extern void __test_function(volatile long *ptr); -asm ( - ".globl __test_function\n" - "__test_function:\n" - "str x30, [x0]\n" - "ret\n"); - #else static void __test_function(volatile long *ptr) { @@ -302,10 +294,15 @@ bool test__bp_signal_is_supported(void) * stepping into the SIGIO handler and getting stuck on the * breakpointed instruction. * + * Since arm64 has the same issue with arm for the single-step + * handling, this case also gets suck on the breakpointed + * instruction. + * * Just disable the test for these architectures until these * issues are resolved. */ -#if defined(__powerpc__) || defined(__s390x__) || defined(__arm__) +#if defined(__powerpc__) || defined(__s390x__) || defined(__arm__) || \ + defined(__aarch64__) return false; #else return true;