linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Marco Elver <elver@google.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Fabian Hemmer <copy@copy.sh>, Ian Rogers <irogers@google.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	kasan-dev@googlegroups.com
Subject: Re: [PATCH] perf test: Add basic stress test for sigtrap handling
Date: Tue, 16 Nov 2021 11:03:54 -0300	[thread overview]
Message-ID: <0683D134-7465-46A8-A3FF-2E2D9131BB3D@gmail.com> (raw)
In-Reply-To: <YZO4zVusjQ+zu9PJ@elver.google.com>



On November 16, 2021 10:57:33 AM GMT-03:00, Marco Elver <elver@google.com> wrote:
>On Tue, Nov 16, 2021 at 09:51AM -0300, Arnaldo Carvalho de Melo wrote:
>> Em Mon, Nov 15, 2021 at 12:28:23PM +0100, Marco Elver escreveu:
>> > Add basic stress test for sigtrap handling as a perf tool built-in test.
>> > This allows sanity checking the basic sigtrap functionality from within
>> > the perf tool.
>> 
>> Works as root:
>> 
>> [root@five ~]# perf test sigtrap
>> 73: Sigtrap                                                         : Ok
>> [root@five ~]
>> 
>> Not for !root:
>[...]
>> FAILED sys_perf_event_open(): Permission denied
>> test child finished with -1
>> ---- end ----
>> Sigtrap: FAILED!
>
>Ah, that shouldn't be the case. It's missing exclude_kernel/hv, and this
>test should work just fine as non-root. Please squash the below as well.
>Let me know if you'd like a v2.

I'll squash

>
>Ack for your change printing errors as well.
>
>Thanks,
>-- Marco
>
>------ >8 ------
>
>From: Marco Elver <elver@google.com>
>Date: Tue, 16 Nov 2021 14:52:18 +0100
>Subject: [PATCH] fixup! perf test: Add basic stress test for sigtrap handling
>
>Exclude kernel/hypervisor so the test can run as non-root.
>
>Signed-off-by: Marco Elver <elver@google.com>
>---
> tools/perf/tests/sigtrap.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c
>index febfa1609356..e566f855bf74 100644
>--- a/tools/perf/tests/sigtrap.c
>+++ b/tools/perf/tests/sigtrap.c
>@@ -46,6 +46,8 @@ static struct perf_event_attr make_event_attr(void)
> 		.remove_on_exec = 1, /* Required by sigtrap. */
> 		.sigtrap	= 1, /* Request synchronous SIGTRAP on event. */
> 		.sig_data	= TEST_SIG_DATA,
>+		.exclude_kernel = 1,
>+		.exclude_hv	= 1,
> 	};
> 	return attr;
> }

  reply	other threads:[~2021-11-16 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 11:28 [PATCH] perf test: Add basic stress test for sigtrap handling Marco Elver
2021-11-16 12:51 ` Arnaldo Carvalho de Melo
2021-11-16 13:57   ` Marco Elver
2021-11-16 14:03     ` Arnaldo Carvalho de Melo [this message]
2021-11-16 14:44     ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0683D134-7465-46A8-A3FF-2E2D9131BB3D@gmail.com \
    --to=arnaldo.melo@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=copy@copy.sh \
    --cc=elver@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).