mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephane Eranian <eranian@google.com>,
	Ian Rogers <irogers@google.com>
Subject: Re: [RFC] perf evlist: Warn if event group has mixed sw/hw events
Date: Mon, 26 Oct 2020 08:21:08 -0700	[thread overview]
Message-ID: <20201026152108.GW466880@tassilo.jf.intel.com> (raw)
In-Reply-To: <20201026141937.582087-1-namhyung@kernel.org>

On Mon, Oct 26, 2020 at 11:19:37PM +0900, Namhyung Kim wrote:
> This patch just added a warning before running it.  I'd really want to
> fix the kernel if possible but don't have a good idea.  Thoughts?

The easiest fix would be some multi threading in perf stat opening, then then
extra latencies could be mostly hidden. One thread per group would probably
be overkill, but just a few threads would lower the penalty significantly.

I think that would be better than this patch and it's likely not that much
more complicated, as this is already a lot of code.

> +{
> +	const char *known_sw_pmu[] = {
> +		"software", "tracepoint", "breakpoint", "kprobe", "uprobe", "msr"

That's a non scalable approach. New pmus get added regularly. It would be better to
indicate this in a generic way from the kernel.

> +			pr_warning("WARNING: Event group has mixed hw/sw events.\n"
> +				   "This will slow down the perf_event_open syscall.\n"
> +				   "Consider putting a hw event as a leader.\n\n");

You really need to tell the user which group, otherwise it is hard to find
in a large command line.


-Andi

  reply	other threads:[~2020-10-26 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 14:19 Namhyung Kim
2020-10-26 15:21 ` Andi Kleen [this message]
2020-10-26 15:49   ` Alexander Shishkin
2020-10-27  4:45     ` Namhyung Kim
2020-10-27  4:43   ` Namhyung Kim
2020-11-01  8:23 ` [perf evlist] 5f2344c367: perf-sanity-tests.'import_perf'_in_python.fail kernel test robot
2020-11-05  8:40 ` [RFC] perf evlist: Warn if event group has mixed sw/hw events Stephane Eranian

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=20201026152108.GW466880@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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

all inboxes | Powered by JetHome®