[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y/Sw9Cd5nvf/YKjA@krava>
Date: Tue, 21 Feb 2023 12:54:28 +0100
From: Jiri Olsa <olsajiri@...il.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Song Liu <song@...nel.org>,
Stephane Eranian <eranian@...gle.com>,
Ravi Bangoria <ravi.bangoria@....com>,
Leo Yan <leo.yan@...aro.org>,
James Clark <james.clark@....com>, Hao Luo <haoluo@...gle.com>,
LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH 3/8] perf record: Add BPF event filter support
On Sat, Feb 18, 2023 at 10:13:24PM -0800, Namhyung Kim wrote:
SNIP
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 8374117e66f6..6429915d376d 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -52,6 +52,7 @@
> #include "util/pmu-hybrid.h"
> #include "util/evlist-hybrid.h"
> #include "util/off_cpu.h"
> +#include "util/bpf-filter.h"
> #include "asm/bug.h"
> #include "perf.h"
> #include "cputopo.h"
> @@ -1364,6 +1365,14 @@ static int record__open(struct record *rec)
>
> session->evlist = evlist;
> perf_session__set_id_hdr_size(session);
> +
> + evlist__for_each_entry(evlist, pos) {
> + if (list_empty(&pos->bpf_filters))
> + continue;
> + rc = perf_bpf_filter__prepare(pos);
> + if (rc)
> + break;
> + }
might fit better under evlist__apply_filters ?
jirka
> out:
> return rc;
> }
> diff --git a/tools/perf/util/bpf_counter.c b/tools/perf/util/bpf_counter.c
> index eeee899fcf34..0414385794ee 100644
> --- a/tools/perf/util/bpf_counter.c
> +++ b/tools/perf/util/bpf_counter.c
> @@ -781,8 +781,7 @@ extern struct bpf_counter_ops bperf_cgrp_ops;
>
> static inline bool bpf_counter_skip(struct evsel *evsel)
> {
> - return list_empty(&evsel->bpf_counter_list) &&
> - evsel->follower_skel == NULL;
> + return evsel->bpf_counter_ops == NULL;
> }
>
SNIP
Powered by blists - more mailing lists