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 v3 1/8] perf bpf-filter: Make filters map a single entry hashmap
Date: Wed, 24 Jul 2024 13:14:23 -0700 [thread overview]
Message-ID: <ZqFgnwK5ZSjmEAQj@google.com> (raw)
In-Reply-To: <ZqFOE9PkW39h2mHs@x1>
On Wed, Jul 24, 2024 at 03:55:15PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Jul 03, 2024 at 03:30:28PM -0700, Namhyung Kim wrote:
> > And the value is now an array. This is to support multiple filter
> > entries in the map later.
>
> > No functional changes intended.
>
> > +++ b/tools/perf/util/bpf-filter.c
> > @@ -93,71 +93,102 @@ static int check_sample_flags(struct evsel *evsel, struct perf_bpf_filter_expr *
> >
> > int perf_bpf_filter__prepare(struct evsel *evsel)
> > {
> > - int i, x, y, fd;
> > + int i, x, y, fd, ret;
> > struct sample_filter_bpf *skel;
> > struct bpf_program *prog;
> > struct bpf_link *link;
> > struct perf_bpf_filter_expr *expr;
> > + struct perf_bpf_filter_entry *entry;
> > +
> > + entry = calloc(MAX_FILTERS, sizeof(*entry));
> > + if (entry == NULL)
> > + return -1;
>
> I'm changing this to -ENOMEM since you use errno values in the other
> failure cases, ok?
Sure thing!
Thanks,
Namhyung
>
> This:
>
> diff --git a/tools/perf/util/bpf-filter.c b/tools/perf/util/bpf-filter.c
> index 2510832d83f95e03..e98bacf41a248ced 100644
> --- a/tools/perf/util/bpf-filter.c
> +++ b/tools/perf/util/bpf-filter.c
> @@ -102,7 +102,7 @@ int perf_bpf_filter__prepare(struct evsel *evsel)
>
> entry = calloc(MAX_FILTERS, sizeof(*entry));
> if (entry == NULL)
> - return -1;
> + return -ENOMEM;
>
> skel = sample_filter_bpf__open_and_load();
> if (!skel) {
next prev parent reply other threads:[~2024-07-24 20:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 22:30 [PATCHSET v3 0/8] perf record: Use a pinned BPF program for filter Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 1/8] perf bpf-filter: Make filters map a single entry hashmap Namhyung Kim
2024-07-24 18:55 ` Arnaldo Carvalho de Melo
2024-07-24 20:14 ` Namhyung Kim [this message]
2024-07-24 19:32 ` Arnaldo Carvalho de Melo
2024-07-24 20:20 ` Namhyung Kim
2024-07-24 21:39 ` Arnaldo Carvalho de Melo
2024-07-26 1:41 ` Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 2/8] perf bpf-filter: Pass 'target' to perf_bpf_filter__prepare() Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 3/8] perf bpf-filter: Split per-task filter use case Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 4/8] perf bpf-filter: Support pin/unpin BPF object Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 5/8] perf bpf-filter: Support separate lost counts for each filter Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 6/8] perf record: Fix a potential error handling issue Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 7/8] perf record: Add --setup-filter option Namhyung Kim
2024-07-03 22:30 ` [PATCH v3 8/8] perf test: Update sample filtering test Namhyung Kim
2024-07-31 14:10 ` Arnaldo Carvalho de Melo
2024-08-01 0:12 ` Namhyung Kim
2024-08-01 15:05 ` Arnaldo Carvalho de Melo
2024-08-01 22:22 ` Namhyung Kim
2024-08-02 17:43 ` Namhyung Kim
2024-07-23 23:48 ` [PATCHSET v3 0/8] perf record: Use a pinned BPF program for filter Namhyung Kim
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=ZqFgnwK5ZSjmEAQj@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).