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]
Date:   Mon, 11 May 2020 13:01:27 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     John Garry <john.garry@...wei.com>
Cc:     peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
        mark.rutland@....com, alexander.shishkin@...ux.intel.com,
        namhyung@...nel.org, will@...nel.org, ak@...ux.intel.com,
        linuxarm@...wei.com, linux-kernel@...r.kernel.org,
        qiangqing.zhang@....com, irogers@...gle.com, robin.murphy@....com,
        zhangshaokun@...ilicon.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH RFC v3 02/12] perf jevents: Add support for system events
 tables

On Thu, May 07, 2020 at 07:57:41PM +0800, John Garry wrote:

SNIP

>  
> +static bool is_sys_dir(char *fname)
> +{
> +	char *pos;
> +
> +	while (true) {
> +		pos = strchr(fname, '/');

would strrchr be faster? also I thought there's something like
basename function that could be usable in here?

jirka

> +
> +		if (!pos) {
> +			if (!strcmp(fname, "sys"))
> +				return true;
> +			return false;
> +		}
> +
> +		fname = pos + 1;
> +	}
> +
> +	return false;
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ