diff mbox series

[PATCHv2,2/4] perf evsel: Print warning for excluding kernel mode instruction tracing

Message ID 523a5af43615b804aa1211a3f27e06226d7159bc.1614624041.git.saiprakash.ranjan@codeaurora.org
State New
Headers show
Series None | expand

Commit Message

Sai Prakash Ranjan March 1, 2021, 7:04 p.m. UTC
Add a warning message to check CONFIG_EXCLUDE_KERNEL_HW_ITRACE kernel
config which excludes kernel mode instruction tracing to help perf tool
users identify the perf event open failure when they attempt kernel mode
tracing with this config enabled.

Tested-by: Denis Nikitin <denik@chromium.org>
Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
---
 tools/perf/util/evsel.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Doug Anderson March 1, 2021, 10:43 p.m. UTC | #1
Hi,

On Mon, Mar 1, 2021 at 11:05 AM Sai Prakash Ranjan
<saiprakash.ranjan@codeaurora.org> wrote:
>
> Add a warning message to check CONFIG_EXCLUDE_KERNEL_HW_ITRACE kernel
> config which excludes kernel mode instruction tracing to help perf tool
> users identify the perf event open failure when they attempt kernel mode
> tracing with this config enabled.
>
> Tested-by: Denis Nikitin <denik@chromium.org>
> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> ---
>  tools/perf/util/evsel.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

I'm not really knowledgeable at all about the perf subsystem so my
review doesn't hold a lot of weight.  However, Sai's patch seems sane
to me.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Sai Prakash Ranjan March 2, 2021, 6:45 a.m. UTC | #2
Hi

On 2021-03-02 04:13, Doug Anderson wrote:
> Hi,
> 
> On Mon, Mar 1, 2021 at 11:05 AM Sai Prakash Ranjan
> <saiprakash.ranjan@codeaurora.org> wrote:
>> 
>> Add a warning message to check CONFIG_EXCLUDE_KERNEL_HW_ITRACE kernel
>> config which excludes kernel mode instruction tracing to help perf 
>> tool
>> users identify the perf event open failure when they attempt kernel 
>> mode
>> tracing with this config enabled.
>> 
>> Tested-by: Denis Nikitin <denik@chromium.org>
>> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
>> ---
>>  tools/perf/util/evsel.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> I'm not really knowledgeable at all about the perf subsystem so my
> review doesn't hold a lot of weight.  However, Sai's patch seems sane
> to me.
> 
> Reviewed-by: Douglas Anderson <dianders@chromium.org>

Thanks for the review, I carefully modified all the patch commit 
messages
to change the config and wording from CONFIG_EXCLUDE_KERNEL_HW_ITRACE to
CONFIG_EXCLUDE_KERNEL_PMU_TRACE but missed this commit message. I will
fix this up in v3, but will hold off posting v3 till I get some feedback
on other patches.

Thanks,
Sai
diff mbox series

Patch

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 1bf76864c4f2..3f584128a590 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2672,7 +2672,8 @@  int evsel__open_strerror(struct evsel *evsel, struct target *target,
 		 ">= 1: Disallow CPU event access\n"
 		 ">= 2: Disallow kernel profiling\n"
 		 "To make the adjusted perf_event_paranoid setting permanent preserve it\n"
-		 "in /etc/sysctl.conf (e.g. kernel.perf_event_paranoid = <setting>)",
+		 "in /etc/sysctl.conf (e.g. kernel.perf_event_paranoid = <setting>)\n\n"
+		 "Also check CONFIG_EXCLUDE_KERNEL_PMU_TRACE if kernel mode tracing is allowed.",
 		 perf_event_paranoid());
 	case ENOENT:
 		return scnprintf(msg, size, "The %s event is not supported.", evsel__name(evsel));