public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Charlie Jenkins <charlie@rivosinc.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Atish Patra <atishp@rivosinc.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] perf: Add PERF_EVENT_IOC_INC_EVENT_LIMIT
Date: Mon, 13 Jan 2025 10:59:29 -0800	[thread overview]
Message-ID: <Z4VikUrFuHocTXAl@ghost> (raw)
In-Reply-To: <20250113131812.GB8362@noisy.programming.kicks-ass.net>

On Mon, Jan 13, 2025 at 02:18:12PM +0100, Peter Zijlstra wrote:
> On Mon, Jan 06, 2025 at 08:07:32PM -0800, Charlie Jenkins wrote:
> > PERF_EVENT_IOC_REFRESH immediately enables after incrementing
> > event_limit.  Provide a new ioctl flag that allows programs to increment
> > event_limit without enabling the event. A usecase for this is to set an
> > event_limit in combination with enable_on_exec.
> 
> 
> Utter lack of WHY.

My usecase is being able to use libperf to calculate performance metrics
from running a program for X number of instructions.
PERF_EVENT_IOC_REFRESH can be used to stop the counters after the
instruction sampling threshold has been hit. This requires being able to
start PERF_EVENT_IOC_REFRESH as soon as the program starts executing,
which is a perfect application for enable_on_exec.

- Charlie


  reply	other threads:[~2025-01-13 18:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-07  4:07 [PATCH v3 0/3] perf: Add PERF_EVENT_IOC_INC_EVENT_LIMIT Charlie Jenkins
2025-01-07  4:07 ` [PATCH v3 1/3] " Charlie Jenkins
2025-01-13 13:18   ` Peter Zijlstra
2025-01-13 18:59     ` Charlie Jenkins [this message]
2025-01-07  4:07 ` [PATCH v3 2/3] perf: Document PERF_EVENT_IOC_INC_EVENT_LIMIT Charlie Jenkins
2025-01-07  4:07 ` [PATCH v3 3/3] libperf: Add perf_evsel__refresh() function Charlie Jenkins

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=Z4VikUrFuHocTXAl@ghost \
    --to=charlie@rivosinc.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=atishp@rivosinc.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@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