[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YFtB+Ta9pkMg4C2h@hirez.programming.kicks-ass.net>
Date: Wed, 24 Mar 2021 14:43:21 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Marco Elver <elver@...gle.com>
Cc: alexander.shishkin@...ux.intel.com, acme@...nel.org,
mingo@...hat.com, jolsa@...hat.com, mark.rutland@....com,
namhyung@...nel.org, tglx@...utronix.de, glider@...gle.com,
viro@...iv.linux.org.uk, arnd@...db.de, christian@...uner.io,
dvyukov@...gle.com, jannh@...gle.com, axboe@...nel.dk,
mascasa@...gle.com, pcc@...gle.com, irogers@...gle.com,
kasan-dev@...glegroups.com, linux-arch@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v3 07/11] perf: Add breakpoint information to siginfo on
SIGTRAP
On Wed, Mar 24, 2021 at 02:21:37PM +0100, Peter Zijlstra wrote:
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -5652,13 +5652,17 @@ static long _perf_ioctl(struct perf_even
> return perf_event_query_prog_array(event, (void __user *)arg);
>
> case PERF_EVENT_IOC_MODIFY_ATTRIBUTES: {
> + struct perf_event_attr __user *uattr;
> struct perf_event_attr new_attr;
> - int err = perf_copy_attr((struct perf_event_attr __user *)arg,
> - &new_attr);
> + int err;
>
> + uattr = (struct perf_event_attr __user *)arg;
> + err = perf_copy_attr(uattr, &new_attr);
> if (err)
> return err;
>
> + event->siginfo.si_perf = (unsigned long)uattr;
Oh bugger; that wants updating for all children too..
> +
> return perf_event_modify_attr(event, &new_attr);
> }
> default:
> @@ -12011,6 +12010,11 @@ SYSCALL_DEFINE5(perf_event_open,
> goto err_task;
> }
>
> + clear_siginfo(&event->siginfo);
> + event->siginfo.si_signo = SIGTRAP;
> + event->siginfo.si_code = TRAP_PERF;
> + event->siginfo.si_perf = (unsigned long)attr_uptr;
And inherit_event() / perf_event_alloc() want to copy/propagate that.
> if (is_sampling_event(event)) {
> if (event->pmu->capabilities & PERF_PMU_CAP_NO_INTERRUPT) {
> err = -EOPNOTSUPP;
Powered by blists - more mailing lists