linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Kyle Huey <me@kylehuey.com>
Cc: Ian Rogers <irogers@google.com>, Kyle Huey <khuey@kylehuey.com>,
	Robert O'Callahan <robert@ocallahan.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] perf test: Test FASYNC with watermark wakeups.
Date: Fri, 23 Feb 2024 14:59:28 -0300	[thread overview]
Message-ID: <ZdjdAKIV39A-jpR5@x1> (raw)
In-Reply-To: <CAP045Aqc6woHGYKJG4d=x4gPd0=PmrLeFv25Rkts1a8xFuocOQ@mail.gmail.com>

On Fri, Feb 23, 2024 at 09:35:29AM -0800, Kyle Huey wrote:
> On Thu, Feb 22, 2024 at 11:54 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >         fd = sys_perf_event_open(&attr, 0, -1, -1, perf_event_open_cloexec_flag());
> >         if (fd < 0) {
> >                 if (attr_has_sigtrap()) {
> >                         pr_debug("FAILED sys_perf_event_open(): %s\n",
> >                                  str_error_r(errno, sbuf, sizeof(sbuf)));
> >                 } else {
> >                         pr_debug("perf_event_attr doesn't have sigtrap\n");
> >                         ret = TEST_SKIP;
> >                 }
> >                 goto out_restore_sigaction;
 
> I think perhaps I'm barking up the wrong tree here. This seems like a
> ton of work just to write a regression test. Maybe I should be doing
> this in tools/testing/selftests instead?

Well, if it tests a perf feature, then yeah, that would be better placed
in 'perf test'.

Maybe you can just assume this will run just on modern kernels where
this feature is expected to be present and then add some pr_debug()
stating that maybe this feature is not present in the kernel.

For the vast majority of cases this will be enough, so that is what I
encourage you to do now.

Its possible that distros, like Red Hat, end up backporting first the
perf tools with this test and not the feature it is being tested, if
that happens, then it will eventually come to my attention and I will be
able to do the BTF treatment, as in that case even a test based on the
kernel version would be insufficient.

- Arnaldo

  reply	other threads:[~2024-02-23 17:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21 17:52 [PATCH 1/2] perf/ring_buffer: Trigger FASYNC signals for watermark wakeups Kyle Huey
2024-02-21 17:52 ` [PATCH 2/2] perf test: Test FASYNC with " Kyle Huey
2024-02-21 18:35   ` Ian Rogers
2024-02-22 17:55     ` Kyle Huey
2024-02-22 18:32       ` Ian Rogers
2024-02-22 18:41         ` Kyle Huey
2024-02-22 19:44           ` Ian Rogers
2024-02-22 19:54       ` Arnaldo Carvalho de Melo
2024-02-23 17:35         ` Kyle Huey
2024-02-23 17:59           ` Arnaldo Carvalho de Melo [this message]
2024-02-23 21:43             ` Robert O'Callahan
2024-02-24  2:27               ` Namhyung Kim
2024-02-24 15:58               ` Arnaldo Carvalho de Melo
2024-02-23 18:01           ` Ian Rogers
2024-02-23 18:17             ` Arnaldo Carvalho de Melo

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=ZdjdAKIV39A-jpR5@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=khuey@kylehuey.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=me@kylehuey.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=robert@ocallahan.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;
as well as URLs for NNTP newsgroup(s).