lkml.org 
[lkml]   [2013]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf tool: report user-friendly error from timechart
On 10/3/13 6:38 AM, Ingo Molnar wrote:
>
> * Ramkumar Ramachandra <artagnon@gmail.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



\
 
 \ /
  Last update: 2013-10-03 16:01    [W:0.525 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site