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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191106163357.GM30214@krava>
Date:   Wed, 6 Nov 2019 17:33:57 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <andi@...stfloor.org>
Cc:     acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH v4 6/9] perf stat: Factor out open error handling

On Mon, Nov 04, 2019 at 04:25:19PM -0800, Andi Kleen wrote:

SNIP

>  				goto try_again;
>  			}
>  
> -			/*
> -			 * PPC returns ENXIO for HW counters until 2.6.37
> -			 * (behavior changed with commit b0a873e).
> -			 */
> -			if (errno == EINVAL || errno == ENOSYS ||
> -			    errno == ENOENT || errno == EOPNOTSUPP ||
> -			    errno == ENXIO) {
> -				if (verbose > 0)
> -					ui__warning("%s event is not supported by the kernel.\n",
> -						    perf_evsel__name(counter));
> -				counter->supported = false;
> -
> -				if ((counter->leader != counter) ||
> -				    !(counter->leader->core.nr_members > 1))
> -					continue;
> -			} else if (perf_evsel__fallback(counter, errno, msg, sizeof(msg))) {
> -                                if (verbose > 0)
> -                                        ui__warning("%s\n", msg);
> -                                goto try_again;
> -			} else if (target__has_per_thread(&target) &&
> -				   evsel_list->core.threads &&
> -				   evsel_list->core.threads->err_thread != -1) {
> -				/*
> -				 * For global --per-thread case, skip current
> -				 * error thread.
> -				 */
> -				if (!thread_map__remove(evsel_list->core.threads,
> -							evsel_list->core.threads->err_thread)) {
> -					evsel_list->core.threads->err_thread = -1;
> -					goto try_again;
> -				}
> +			switch (stat_handle_error(counter)) {
> +			case COUNTER_FATAL:
> +				return -1;
> +			case COUNTER_RETRY:
> +				goto try_again;
> +			case COUNTER_SKIP:
> +				continue;
> +			default:
> +				break;
>  			}

great, looks good, thanks

jirka

> -
> -			perf_evsel__open_strerror(counter, &target,
> -						  errno, msg, sizeof(msg));
> -			ui__error("%s\n", msg);
> -
> -			if (child_pid != -1)
> -				kill(child_pid, SIGTERM);
> -
> -			return -1;
>  		}
>  		counter->supported = true;
>  
> -- 
> 2.23.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ