Re: [PATCH v2 0/6] perf: Introduce extended syscall error reporting

Vince Weaver
2015-08-26T21:12:35Z

On Wed, 26 Aug 2015, Andrew Morton wrote:

> On Wed, 26 Aug 2015 16:50:33 -0400 (EDT) Vince Weaver <vince@deater.net> wrote:
> > I often have to resort to sprinkling the kernel with printks to find the
> > source of errors, which is a pain. It's even more fun when the user's
> > setup is slightly different enough that I can't reproduce the issue on a
> > local machine, which happens often (due to different kernels, distros
> > backporting perf fixes, different hardware, different security settings,
> > etc).
>
> Suppose you were to tell them "please do `echo 1 > /proc/whatever' then
> send me the kernel logs". Would this be good enough?

would /proc/whatever require CAP_SYS_ADMIN?

If so, then no, probably not good enough. Many of the users are trying to
run things on large computing clusters, etc, and won't have root
permissions. They quite possibly won't have access to the syslog either.

I realize that the userbase affected by this is very tiny compared to the
amount of bloat introduced to fix it.

It would have been easier if event validation were done in userspace (ala
perfmon2) rather than having everything in the kernel like perf_event
does, but too late for that. Although at some point once you start
re-using the limited number of error return codes more than once things
can get confusing very quickly.

Vince