summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2016-02-19 13:59:54 -0500
committerSteven Rostedt <rostedt@goodmis.org>2016-03-08 11:19:28 -0500
commit633f6f58af445022e38417599a4789b5fc510b71 (patch)
treec24dc87ea783d645110972446756835ef55e41ca
parentd39cdd2036a63eef17a14efbd969405ca5612886 (diff)
tracing: Remove duplicate checks for online CPUs
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>
-rw-r--r--include/trace/events/kmem.h42
-rw-r--r--include/trace/events/tlb.h4
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,
140 TP_ARGS(call_site, ptr) 140 TP_ARGS(call_site, ptr)
141); 141);
142 142
143DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free, 143DEFINE_EVENT(kmem_free, kmem_cache_free,
144 144
145 TP_PROTO(unsigned long call_site, const void *ptr), 145 TP_PROTO(unsigned long call_site, const void *ptr),
146 146
147 TP_ARGS(call_site, ptr), 147 TP_ARGS(call_site, ptr)
148
149 /*
150 * This trace can be potentially called from an offlined cpu.
151 * Since trace points use RCU and RCU should not be used from
152 * offline cpus, filter such calls out.
153 * While this trace can be called from a preemptable section,
154 * it has no impact on the condition since tasks can migrate
155 * only from online cpus to other online cpus. Thus its safe
156 * to use raw_smp_processor_id.
157 */
158 TP_CONDITION(cpu_online(raw_smp_processor_id()))
159); 148);
160 149
161TRACE_EVENT_CONDITION(mm_page_free, 150TRACE_EVENT(mm_page_free,
162 151
163 TP_PROTO(struct page *page, unsigned int order), 152 TP_PROTO(struct page *page, unsigned int order),
164 153
165 TP_ARGS(page, order), 154 TP_ARGS(page, order),
166 155
167
168 /*
169 * This trace can be potentially called from an offlined cpu.
170 * Since trace points use RCU and RCU should not be used from
171 * offline cpus, filter such calls out.
172 * While this trace can be called from a preemptable section,
173 * it has no impact on the condition since tasks can migrate
174 * only from online cpus to other online cpus. Thus its safe
175 * to use raw_smp_processor_id.
176 */
177 TP_CONDITION(cpu_online(raw_smp_processor_id())),
178
179 TP_STRUCT__entry( 156 TP_STRUCT__entry(
180 __field( unsigned long, pfn ) 157 __field( unsigned long, pfn )
181 __field( unsigned int, order ) 158 __field( unsigned int, order )
@@ -276,23 +253,12 @@ DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked,
276 TP_ARGS(page, order, migratetype) 253 TP_ARGS(page, order, migratetype)
277); 254);
278 255
279TRACE_EVENT_CONDITION(mm_page_pcpu_drain, 256TRACE_EVENT(mm_page_pcpu_drain,
280 257
281 TP_PROTO(struct page *page, unsigned int order, int migratetype), 258 TP_PROTO(struct page *page, unsigned int order, int migratetype),
282 259
283 TP_ARGS(page, order, migratetype), 260 TP_ARGS(page, order, migratetype),
284 261
285 /*
286 * This trace can be potentially called from an offlined cpu.
287 * Since trace points use RCU and RCU should not be used from
288 * offline cpus, filter such calls out.
289 * While this trace can be called from a preemptable section,
290 * it has no impact on the condition since tasks can migrate
291 * only from online cpus to other online cpus. Thus its safe
292 * to use raw_smp_processor_id.
293 */
294 TP_CONDITION(cpu_online(raw_smp_processor_id())),
295
296 TP_STRUCT__entry( 262 TP_STRUCT__entry(
297 __field( unsigned long, pfn ) 263 __field( unsigned long, pfn )
298 __field( unsigned int, order ) 264 __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
34#define EM(a,b) { a, b }, 34#define EM(a,b) { a, b },
35#define EMe(a,b) { a, b } 35#define EMe(a,b) { a, b }
36 36
37TRACE_EVENT_CONDITION(tlb_flush, 37TRACE_EVENT(tlb_flush,
38 38
39 TP_PROTO(int reason, unsigned long pages), 39 TP_PROTO(int reason, unsigned long pages),
40 TP_ARGS(reason, pages), 40 TP_ARGS(reason, pages),
41 41
42 TP_CONDITION(cpu_online(smp_processor_id())),
43
44 TP_STRUCT__entry( 42 TP_STRUCT__entry(
45 __field( int, reason) 43 __field( int, reason)
46 __field(unsigned long, pages) 44 __field(unsigned long, pages)