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]
Date:	Wed, 5 Aug 2009 16:07:21 -0400
From:	Jason Baron <jbaron@...hat.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
	Chris Mason <chris.mason@...cle.com>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf: Don't list tracepoints without an id

On Wed, Aug 05, 2009 at 09:23:49PM +0200, Peter Zijlstra wrote:
> Stop perf list from displaying tracepoints without an id file.
> 
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> ---
>  tools/perf/util/parse-events.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index 7bdad8d..d00636b 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -568,6 +568,7 @@ static void print_tracepoint_events(void)
>  	struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
>  	struct stat st;
>  	char evt_path[MAXPATHLEN];
> +	int fd;
>  
>  	if (valid_debugfs_mount(debugfs_path))
>  		return;
> @@ -582,6 +583,15 @@ static void print_tracepoint_events(void)
>  			goto cleanup;
>  		for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next,
>  								evt_path, st) {
> +
> +			snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id",
> +					debugfs_path, 
> +					sys_dirent.d_name, evt_dirent.d_name);
> +			fd = open(evt_path, O_RDONLY);
> +			if (fd < 0)
> +				continue;
> +			close(fd);
> +
>  			snprintf(evt_path, MAXPATHLEN, "%s:%s",
>  				 sys_dirent.d_name, evt_dirent.d_name);
>  			fprintf(stderr, "  %-40s [%s]\n", evt_path,
> 
> 

hmmm, might be nicer to add this check to the 'for_each_event()' macro
instead...

thanks,

-Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ