lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YIcwRj4WtsZln4SR@krava>
Date:   Mon, 26 Apr 2021 23:27:34 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Song Liu <song@...nel.org>
Cc:     linux-kernel@...r.kernel.org, kernel-team@...com, acme@...nel.org,
        acme@...hat.com, namhyung@...nel.org, jolsa@...nel.org,
        songliubraving@...com
Subject: Re: [PATCH v5 5/5] perf-stat: introduce bpf_counter_ops->disable()

On Sun, Apr 25, 2021 at 02:43:33PM -0700, Song Liu wrote:

SNIP

> +static inline int bpf_counter__disable(struct evsel *evsel __maybe_unused)
> +{
> +	return 0;
> +}
> +
>  static inline int bpf_counter__read(struct evsel *evsel __maybe_unused)
>  {
>  	return -EAGAIN;
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index d29a8a118973c..e71041c890102 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -17,6 +17,7 @@
>  #include "evsel.h"
>  #include "debug.h"
>  #include "units.h"
> +#include "bpf_counter.h"
>  #include <internal/lib.h> // page_size
>  #include "affinity.h"
>  #include "../perf.h"
> @@ -421,6 +422,9 @@ static void __evlist__disable(struct evlist *evlist, char *evsel_name)
>  	if (affinity__setup(&affinity) < 0)
>  		return;
>  
> +	evlist__for_each_entry(evlist, pos)
> +		bpf_counter__disable(pos);

I was wondering why you don't check evsel__is_bpf like
for the enable case.. and realized that we don't skip
bpf evsels in __evlist__enable and __evlist__disable
like we do in read_affinity_counters

so I guess there's extra affinity setup and bunch of
wrong ioctls being called?

jirka


> +
>  	/* Disable 'immediate' events last */
>  	for (imm = 0; imm <= 1; imm++) {
>  		evlist__for_each_cpu(evlist, i, cpu) {
> -- 
> 2.30.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ