mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@redhat.com, eranian@google.com,
	linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	torvalds@linux-foundation.org, rostedt@goodmis.org,
	peterz@infradead.org, acme@redhat.com, vincent.weaver@maine.edu,
	acme@kernel.org, namhyung@kernel.org, mingo@kernel.org
Subject: [tip:perf/core] ftrace/perf: Check sample types only for sampling events
Date: Thu, 31 Mar 2016 02:25:42 -0700	[thread overview]
Message-ID: <tip-0a74c5b3d20d2a8693848b6ae4f1a97624f5b781@git.kernel.org> (raw)
In-Reply-To: <1458138873-1553-2-git-send-email-jolsa@kernel.org>

Commit-ID:  0a74c5b3d20d2a8693848b6ae4f1a97624f5b781
Gitweb:     http://git.kernel.org/tip/0a74c5b3d20d2a8693848b6ae4f1a97624f5b781
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Wed, 16 Mar 2016 15:34:29 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 31 Mar 2016 10:30:45 +0200

ftrace/perf: Check sample types only for sampling events

Currently we check sample type for ftrace:function events
even if it's not created as a sampling event. That prevents
creating ftrace_function event in counting mode.

Make sure we check sample types only for sampling events.

Before:
  $ sudo perf stat -e ftrace:function ls
  ...

   Performance counter stats for 'ls':

     <not supported>      ftrace:function

         0.001983662 seconds time elapsed

After:
  $ sudo perf stat -e ftrace:function ls
  ...

   Performance counter stats for 'ls':

              44,498      ftrace:function

         0.037534722 seconds time elapsed

Suggested-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1458138873-1553-2-git-send-email-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/trace/trace_event_perf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 00df25f..e11108f 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -47,6 +47,9 @@ static int perf_trace_event_perm(struct trace_event_call *tp_event,
 		if (perf_paranoid_tracepoint_raw() && !capable(CAP_SYS_ADMIN))
 			return -EPERM;
 
+		if (!is_sampling_event(p_event))
+			return 0;
+
 		/*
 		 * We don't allow user space callchains for  function trace
 		 * event, due to issues with page faults while tracing page

  parent reply	other threads:[~2016-03-31  9:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 14:34 [PATCHv2 0/5] ftrace perf: Fixes and speedup Jiri Olsa
2016-03-16 14:34 ` [PATCH 1/5] ftrace perf: Check sample types only for sampling events Jiri Olsa
2016-03-18 14:27   ` Steven Rostedt
2016-03-31  9:25   ` tip-bot for Jiri Olsa [this message]
2016-03-16 14:34 ` [PATCH 2/5] ftrace perf: Move exclude_kernel tracepoint check to init event Jiri Olsa
2016-03-18 14:28   ` Steven Rostedt
2016-03-23 10:41   ` Peter Zijlstra
2016-03-24  9:56     ` Jiri Olsa
2016-03-24 10:49       ` Peter Zijlstra
2016-03-24 12:25         ` Jiri Olsa
2016-03-24 13:00           ` Peter Zijlstra
2016-03-24 13:30             ` Jiri Olsa
2016-03-16 14:34 ` [PATCH 3/5] ftrace perf: Use ftrace_ops::private to store event pointer Jiri Olsa
2016-03-18 14:28   ` Steven Rostedt
2016-03-23 14:26   ` Peter Zijlstra
2016-03-24  9:47     ` Jiri Olsa
2016-03-24 10:40       ` Peter Zijlstra
2016-03-16 14:34 ` [PATCH 4/5] ftrace: Make ftrace_hash_rec_enable return update bool Jiri Olsa
2016-03-17  0:23   ` Namhyung Kim
2016-03-16 14:34 ` [PATCH 5/5] ftrace: Update dynamic ftrace calls only if necessary Jiri Olsa
2016-03-17  0:25   ` Namhyung Kim
2016-03-18 14:27   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0a74c5b3d20d2a8693848b6ae4f1a97624f5b781@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.weaver@maine.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome