Re: [PATCH v3 1/8] perf bpf-filter: Make filters map a single entry hashmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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) {




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux