linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org, KP Singh <kpsingh@kernel.org>,
	Song Liu <song@kernel.org>,
	bpf@vger.kernel.org, Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf bpf-filter: Support multiple events properly
Date: Tue, 13 Aug 2024 16:33:53 -0700	[thread overview]
Message-ID: <ZrvtYf2BG1hQlLGM@google.com> (raw)
In-Reply-To: <ZrFAIc0G8n0-zgxt@google.com>

On Mon, Aug 05, 2024 at 02:12:01PM -0700, Namhyung Kim wrote:
> On Mon, Aug 05, 2024 at 04:31:34PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Mon, Aug 05, 2024 at 11:56:56AM -0700, Namhyung Kim wrote:
> > > On Mon, Aug 05, 2024 at 12:03:14PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > On Fri, Aug 02, 2024 at 10:37:52AM -0700, Namhyung Kim wrote:
> > > > > + * The BPF program returns 1 to accept the sample or 0 to drop it.
> > > > > + * The 'dropped' map is to keep how many samples it dropped by the filter and
> > > > > + * it will be reported as lost samples.
> > > > 
> > > > I think there is value in reporting how many were filtered out, I'm just
> > > > unsure about reporting it as "lost" samples, as lost has another
> > > > semantic associated, i.e. ring buffer was full or couldn't process it
> > > > for some other resource starvation issue, no?
> > > 
> > > Then we need a way to save the information.  It could be a new record
> > > type (PERF_RECORD_DROPPED_SAMPLES), a new misc flag in the lost samples
> > 
> > I guess "PERF_RECORD_FILTERED_SAMPLES" would be better, more precise,
> > wdyt?
> > 
> > > record or a header field.  I prefer the misc flag.
> > 
> > I think we can have both filtered and lost samples, so I would prefer
> > the new record type.
> 
> I think we can have two LOST_SAMPLES records then - one with the new
> misc flag for BPF and the other (without the flag) for the usual lost
> samples.  This would require minimal changes IMHO.

I've realized that I already added PERF_RECORD_MISC_LOST_SAMPLES_BPF in
the commit 27c6f2455b29f ("perf record: Record dropped sample count"). :)

I'll add that to the event stats.

Thanks,
Namhyung


      reply	other threads:[~2024-08-13 23:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 17:37 [PATCH] perf bpf-filter: Support multiple events properly Namhyung Kim
2024-08-05 15:03 ` Arnaldo Carvalho de Melo
2024-08-05 18:56   ` Namhyung Kim
2024-08-05 19:31     ` Arnaldo Carvalho de Melo
2024-08-05 21:12       ` Namhyung Kim
2024-08-13 23:33         ` Namhyung Kim [this message]

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=ZrvtYf2BG1hQlLGM@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=song@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;
as well as URLs for NNTP newsgroup(s).