public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Shreyas B. Prabhu" <shreyas@linux.vnet.ibm.com>
Subject: [for-next][PATCH 02/12] tracing: Remove duplicate checks for online CPUs
Date: Wed, 09 Mar 2016 09:46:27 -0500	[thread overview]
Message-ID: <20160309144744.350974705@goodmis.org> (raw)
In-Reply-To: 20160309144625.888964064@goodmis.org

[-- Attachment #1: 0002-tracing-Remove-duplicate-checks-for-online-CPUs.patch --]
[-- Type: text/plain, Size: 4036 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

Some trace events have conditions that check if the current CPU is online or
not before recording the tracepoint. That's because certain trace events are
in locations that can be called as the CPU is going offline and when RCU no
longer monitors it (like kfree and friends). The check was added because
trace events require RCU to be active.

This is a trace event infrastructure issue and not something that individual
trace events should worry about. The tracepoint.h code now has added a check
to see if the current CPU is considered online, and it only does the
tracepoint if it is. There's no more need for individual trace events to
also include this check. It is now redundant.

Cc: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/trace/events/kmem.h | 42 ++++--------------------------------------
 include/trace/events/tlb.h  |  4 +---
 2 files changed, 5 insertions(+), 41 deletions(-)

diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index f7554fd7fc62..325b2a9b1959 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -140,42 +140,19 @@ DEFINE_EVENT(kmem_free, kfree,
 	TP_ARGS(call_site, ptr)
 );
 
-DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free,
+DEFINE_EVENT(kmem_free, kmem_cache_free,
 
 	TP_PROTO(unsigned long call_site, const void *ptr),
 
-	TP_ARGS(call_site, ptr),
-
-	/*
-	 * This trace can be potentially called from an offlined cpu.
-	 * Since trace points use RCU and RCU should not be used from
-	 * offline cpus, filter such calls out.
-	 * While this trace can be called from a preemptable section,
-	 * it has no impact on the condition since tasks can migrate
-	 * only from online cpus to other online cpus. Thus its safe
-	 * to use raw_smp_processor_id.
-	 */
-	TP_CONDITION(cpu_online(raw_smp_processor_id()))
+	TP_ARGS(call_site, ptr)
 );
 
-TRACE_EVENT_CONDITION(mm_page_free,
+TRACE_EVENT(mm_page_free,
 
 	TP_PROTO(struct page *page, unsigned int order),
 
 	TP_ARGS(page, order),
 
-
-	/*
-	 * This trace can be potentially called from an offlined cpu.
-	 * Since trace points use RCU and RCU should not be used from
-	 * offline cpus, filter such calls out.
-	 * While this trace can be called from a preemptable section,
-	 * it has no impact on the condition since tasks can migrate
-	 * only from online cpus to other online cpus. Thus its safe
-	 * to use raw_smp_processor_id.
-	 */
-	TP_CONDITION(cpu_online(raw_smp_processor_id())),
-
 	TP_STRUCT__entry(
 		__field(	unsigned long,	pfn		)
 		__field(	unsigned int,	order		)
@@ -276,23 +253,12 @@ DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked,
 	TP_ARGS(page, order, migratetype)
 );
 
-TRACE_EVENT_CONDITION(mm_page_pcpu_drain,
+TRACE_EVENT(mm_page_pcpu_drain,
 
 	TP_PROTO(struct page *page, unsigned int order, int migratetype),
 
 	TP_ARGS(page, order, migratetype),
 
-	/*
-	 * This trace can be potentially called from an offlined cpu.
-	 * Since trace points use RCU and RCU should not be used from
-	 * offline cpus, filter such calls out.
-	 * While this trace can be called from a preemptable section,
-	 * it has no impact on the condition since tasks can migrate
-	 * only from online cpus to other online cpus. Thus its safe
-	 * to use raw_smp_processor_id.
-	 */
-	TP_CONDITION(cpu_online(raw_smp_processor_id())),
-
 	TP_STRUCT__entry(
 		__field(	unsigned long,	pfn		)
 		__field(	unsigned int,	order		)
diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h
index bc8815f45f3b..9d14b1992108 100644
--- a/include/trace/events/tlb.h
+++ b/include/trace/events/tlb.h
@@ -34,13 +34,11 @@ TLB_FLUSH_REASON
 #define EM(a,b)		{ a, b },
 #define EMe(a,b)	{ a, b }
 
-TRACE_EVENT_CONDITION(tlb_flush,
+TRACE_EVENT(tlb_flush,
 
 	TP_PROTO(int reason, unsigned long pages),
 	TP_ARGS(reason, pages),
 
-	TP_CONDITION(cpu_online(smp_processor_id())),
-
 	TP_STRUCT__entry(
 		__field(	  int, reason)
 		__field(unsigned long,  pages)
-- 
2.7.0

  parent reply	other threads:[~2016-03-09 14:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 14:46 [for-next][PATCH 00/12] tracing: Various cleanups and preparation for trace event hist Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 01/12] tracing: Make tracer_flags use the right set_flag callback Steven Rostedt
2016-03-09 14:46 ` Steven Rostedt [this message]
2016-03-09 14:46 ` [for-next][PATCH 03/12] tracing: Make ftrace_event_field checking functions available Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 04/12] tracing: Make event trigger " Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 05/12] tracing: Add event record param to trigger_ops.func() Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 06/12] tracing: Add get_syscall_name() Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 07/12] tracing: Add a per-event-trigger paused field Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 08/12] tracing: Add needs_rec flag to event triggers Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 09/12] tracing: Add an unreg_all() callback to trigger commands Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 10/12] tracing: Use flags instead of bool in trigger structure Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 11/12] tracing, writeback: Replace cgroup path to cgroup ino Steven Rostedt
2016-03-09 14:46 ` [for-next][PATCH 12/12] tracing: Fix typoes in code comment and printk in trace_nop.c 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=20160309144744.350974705@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=shreyas@linux.vnet.ibm.com \
    /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