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: Jiri Olsa <jolsa@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Kan Liang <kan.liang@linux.intel.com>, Song Liu <song@kernel.org>,
	Stephane Eranian <eranian@google.com>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	Leo Yan <leo.yan@linaro.org>, James Clark <james.clark@arm.com>,
	Hao Luo <haoluo@google.com>, LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH 2/8] perf bpf filter: Implement event sample filtering
Date: Wed, 22 Feb 2023 11:48:43 -0800	[thread overview]
Message-ID: <CAM9d7cg_bnLuYN+SnS_m6gV2qto8hVGF1oYE7gSko=TuY-dpOQ@mail.gmail.com> (raw)
In-Reply-To: <CAM9d7chrbQ+79HRJF=e3DLA7rDL-LdNw2fVW3enjJjY+E-ESsQ@mail.gmail.com>

On Sun, Feb 19, 2023 at 8:48 AM Namhyung Kim <namhyung@kernel.org> wrote:
>
> On Sun, Feb 19, 2023 at 3:14 AM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> >
> > Em Sat, Feb 18, 2023 at 10:13:23PM -0800, Namhyung Kim escreveu:
> > > The BPF program will be attached to a perf_event and be triggered when
> > > it overflows.  It'd iterate the filters map and compare the sample
> > > value according to the expression.  If any of them fails, the sample
> > > would be dropped.
> > >
> > > Also it needs to have the corresponding sample data for the expression
> > > so it compares data->sample_flags with the given value.  To access the
> > > sample data, it uses the bpf_cast_to_kern_ctx() kfunc which was added
> > > in v6.2 kernel.
> >
> >   CLANG   /tmp/build/perf/util/bpf_skel/.tmp/sample_filter.bpf.o
> > util/bpf_skel/sample_filter.bpf.c:26:19: error: no member named 'sample_flags' in 'struct perf_sample_data'
> >         if ((kctx->data->sample_flags & entry->flags) == 0)
> >              ~~~~~~~~~~  ^
> > 1 error generated.
> > make[2]: *** [Makefile.perf:1078: /tmp/build/perf/util/bpf_skel/.tmp/sample_filter.bpf.o] Error 1
> > make[1]: *** [Makefile.perf:236: sub-make] Error 2
> > make: *** [Makefile:113: install-bin] Error 2
> > make: Leaving directory '/var/home/acme/git/perf/tools/perf'
> >
> >  Performance counter stats for 'make -k BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf -C tools/perf install-bin':
>
> Hmm.. strange.  In the include/linux/perf_event.h, the
> perf_sample_data has sample_flags, but vmlinux.h doesn't.

It looks like the vmlinux.h came from the old kernel image (before v6.1).
Please try again after building the kernel.  I'll add a check to prevent
such a build error in v3.

Thanks,
Namhyung

  reply	other threads:[~2023-02-22 19:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19  6:13 [RFC/PATCHSET 0/8] perf record: Implement BPF sample filter (v2) Namhyung Kim
2023-02-19  6:13 ` [PATCH 1/8] perf bpf filter: Introduce basic BPF filter expression Namhyung Kim
2023-02-19  6:13 ` [PATCH 2/8] perf bpf filter: Implement event sample filtering Namhyung Kim
2023-02-19 11:14   ` Arnaldo Carvalho de Melo
2023-02-19 16:48     ` Namhyung Kim
2023-02-22 19:48       ` Namhyung Kim [this message]
2023-02-21 11:54   ` Jiri Olsa
2023-02-22 19:49     ` Namhyung Kim
2023-02-19  6:13 ` [PATCH 3/8] perf record: Add BPF event filter support Namhyung Kim
2023-02-21 11:54   ` Jiri Olsa
2023-02-22 19:50     ` Namhyung Kim
2023-02-19  6:13 ` [PATCH 4/8] perf record: Record dropped sample count Namhyung Kim
2023-02-21 11:54   ` Jiri Olsa
2023-02-19  6:13 ` [PATCH 5/8] perf bpf filter: Add 'pid' sample data support Namhyung Kim
2023-02-19  6:13 ` [PATCH 6/8] perf bpf filter: Add more weight " Namhyung Kim
2023-02-19  6:13 ` [PATCH 7/8] perf bpf filter: Add data_src " Namhyung Kim
2023-02-19  6:13 ` [PATCH 8/8] perf bpf filter: Add logical OR operator Namhyung Kim
2023-02-23 14:47 ` [RFC/PATCHSET 0/8] perf record: Implement BPF sample filter (v2) Arnaldo Carvalho de Melo
2023-02-23 21:49   ` Namhyung Kim
  -- strict thread matches above, loose matches on Subject: below --
2023-02-22 23:01 [RFC/PATCHSET 0/8] perf record: Implement BPF sample filter (v3) Namhyung Kim
2023-02-22 23:01 ` [PATCH 2/8] perf bpf filter: Implement event sample filtering Namhyung Kim
2023-03-07 13:03   ` Adrian Hunter
2023-03-07 20:57     ` 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='CAM9d7cg_bnLuYN+SnS_m6gV2qto8hVGF1oYE7gSko=TuY-dpOQ@mail.gmail.com' \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=eranian@google.com \
    --cc=haoluo@google.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@amd.com \
    --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).