lkml.org 
[lkml]   [2021]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] perf test: Add basic stress test for sigtrap handling
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.

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;
}
--
2.34.0.rc1.387.gb447b232ab-goog
\
 
 \ /
  Last update: 2021-11-16 14:58    [W:0.054 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site