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: <524D7296.3090407@gmail.com>
Date:	Thu, 03 Oct 2013 07:35:18 -0600
From:	David Ahern <dsahern@...il.com>
To:	Ingo Molnar <mingo@...nel.org>,
	Ramkumar Ramachandra <artagnon@...il.com>
CC:	LKML <linux-kernel@...r.kernel.org>, Jiri Olsa <jolsa@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: Re: [PATCH] perf tool: report user-friendly error from timechart

On 10/3/13 6:38 AM, Ingo Molnar wrote:
>
> * Ramkumar Ramachandra <artagnon@...il.com> wrote:
>
>> +	/* Perform a quick sanity check */
>> +	if (!is_valid_tracepoint("power:cpu_frequency")) {
>> +		fprintf(stderr, "Error:\tNo permissions to read $debugfs/tracing/events/power/cpu_frequency\n");
>> +		fprintf(stderr, "Hint:\tChange the permissions of debugfs: /sys/kernel/debug\n");
>> +		fprintf(stderr, "\tThe directory will be present if your kernel was compiled with debugfs support.\n");
>
> Is missing permissions the only way how is_valid_tracepoint() can fail?
>
> What if debugfs has the right permissions but CONFIG_TRACEPOINTS is
> disabled in the kernel?

There are a number of reasons that function can fail. The complete 
solution is to plumb various error numbers and on failure request a 
string for that failure. Take a look at util/target.[ch] as an example.

The comment applies to the perf-trace patch as well, but it gets more 
complicated to handle the error paths from perf_evsel__newtp when they 
dip into the tracepoint code

David

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