public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <robert.richter@amd.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Stephane Eranian <eranian@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH] perf: Introduce function to report unsupported syscall attribute flags
Date: Wed, 12 Sep 2012 15:02:53 +0200	[thread overview]
Message-ID: <20120912130253.GY8285@erda.amd.com> (raw)
In-Reply-To: <1347448843.15764.3.camel@twins>

On 12.09.12 13:20:43, Peter Zijlstra wrote:
> On Wed, 2012-09-12 at 13:01 +0200, Robert Richter wrote:
> > +       if (notsup)
> > +               pr_warn("perf: unsupported attribute flags: %016llx\n", notsup); 
> 
> This is a dmesg DoS..

This could be avoided by introducing a cpuinfo like sysfs file for
each pmu:

 /sys/bus/event_source/devices/*/flags

Then, userspace should know how to correctly setup the syscall. All
supported attributes would be known to perf and messages would thrown
only if something goes unexpected wrong.

I suggested this already here:

 https://lkml.org/lkml/2012/8/3/214
 https://lkml.org/lkml/2012/9/6/472

> I'm also not sure dmesg is the right way.. could we not somehow change
> the attrs to provide better diagnostic?

I found this discussion without a solution for the problem:

 http://lwn.net/Articles/374794/

Other options could be pr_debug() or trace_printk()'s for debugging
purposes. Or an error report in sysfs:

 cat /sys/bus/event_source/devices/*/log

But the pmu type needs to be known for this.

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center


  reply	other threads:[~2012-09-12 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 11:01 [PATCH] perf: Introduce function to report unsupported syscall attribute flags Robert Richter
2012-09-12 11:20 ` Peter Zijlstra
2012-09-12 13:02   ` Robert Richter [this message]
2012-09-12 14:26   ` Andi Kleen
2012-09-12 14:29     ` Peter Zijlstra

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=20120912130253.GY8285@erda.amd.com \
    --to=robert.richter@amd.com \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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