From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: LKML <linux-kernel@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: [RFC patch 15/32] trace event sched remove trailing semicolon
Date: Mon, 02 May 2011 17:11:38 -0400 [thread overview]
Message-ID: <20110502213213.708193594@efficios.com> (raw)
In-Reply-To: 20110502211123.163877033@efficios.com
[-- Attachment #1: trace-event-sched-remove-semicolons.patch --]
[-- Type: text/plain, Size: 6318 bytes --]
Part of the gradual TRACE_EVENT() semicolon removal. Enables creation of array
of events, thus saving space for trace event probes. Remove the trailing
semicolons at the end of TRACE_EVENT() and DEFINE_EVENT() in scheduler
instrumentation. Put __trace_sched_switch_state() static inline declaration
within ifdef protection so the preprocessor output is not polluted when creating
an array of events.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Peter Zijlstra <peterz@infradead.org>
---
include/trace/events/sched.h | 77 ++++++++++++++++++++++---------------------
1 file changed, 41 insertions(+), 36 deletions(-)
Index: linux-2.6-lttng/include/trace/events/sched.h
===================================================================
--- linux-2.6-lttng.orig/include/trace/events/sched.h
+++ linux-2.6-lttng/include/trace/events/sched.h
@@ -7,6 +7,28 @@
#include <linux/sched.h>
#include <linux/tracepoint.h>
+#ifndef _TRACE_SCHED_DEF_
+#define _TRACE_SCHED_DEF_
+
+#ifdef CREATE_TRACE_POINTS
+static inline long __trace_sched_switch_state(struct task_struct *p)
+{
+ long state = p->state;
+
+#ifdef CONFIG_PREEMPT
+ /*
+ * For all intents and purposes a preempted task is a running task.
+ */
+ if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
+ state = TASK_RUNNING;
+#endif
+
+ return state;
+}
+#endif
+
+#endif /* _TRACE_SCHED_DEF_ */
+
/*
* Tracepoint for calling kthread_stop, performed to end a kthread:
*/
@@ -27,7 +49,7 @@ TRACE_EVENT(sched_kthread_stop,
),
TP_printk("comm=%s pid=%d", __entry->comm, __entry->pid)
-);
+)
/*
* Tracepoint for the return value of the kthread stopping:
@@ -47,7 +69,7 @@ TRACE_EVENT(sched_kthread_stop_ret,
),
TP_printk("ret=%d", __entry->ret)
-);
+)
/*
* Tracepoint for waking up a task:
@@ -77,35 +99,18 @@ DECLARE_EVENT_CLASS(sched_wakeup_templat
TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d",
__entry->comm, __entry->pid, __entry->prio,
__entry->success, __entry->target_cpu)
-);
+)
DEFINE_EVENT(sched_wakeup_template, sched_wakeup,
TP_PROTO(struct task_struct *p, int success),
- TP_ARGS(p, success));
+ TP_ARGS(p, success))
/*
* Tracepoint for waking up a new task:
*/
DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
TP_PROTO(struct task_struct *p, int success),
- TP_ARGS(p, success));
-
-#ifdef CREATE_TRACE_POINTS
-static inline long __trace_sched_switch_state(struct task_struct *p)
-{
- long state = p->state;
-
-#ifdef CONFIG_PREEMPT
- /*
- * For all intents and purposes a preempted task is a running task.
- */
- if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
- state = TASK_RUNNING;
-#endif
-
- return state;
-}
-#endif
+ TP_ARGS(p, success))
/*
* Tracepoint for task switches, performed by the scheduler:
@@ -145,7 +150,7 @@ TRACE_EVENT(sched_switch,
{ 16, "Z" }, { 32, "X" }, { 64, "x" },
{ 128, "W" }) : "R",
__entry->next_comm, __entry->next_pid, __entry->next_prio)
-);
+)
/*
* Tracepoint for a task being migrated:
@@ -175,7 +180,7 @@ TRACE_EVENT(sched_migrate_task,
TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d",
__entry->comm, __entry->pid, __entry->prio,
__entry->orig_cpu, __entry->dest_cpu)
-);
+)
DECLARE_EVENT_CLASS(sched_process_template,
@@ -197,14 +202,14 @@ DECLARE_EVENT_CLASS(sched_process_templa
TP_printk("comm=%s pid=%d prio=%d",
__entry->comm, __entry->pid, __entry->prio)
-);
+)
/*
* Tracepoint for freeing a task:
*/
DEFINE_EVENT(sched_process_template, sched_process_free,
TP_PROTO(struct task_struct *p),
- TP_ARGS(p));
+ TP_ARGS(p))
/*
@@ -212,14 +217,14 @@ DEFINE_EVENT(sched_process_template, sch
*/
DEFINE_EVENT(sched_process_template, sched_process_exit,
TP_PROTO(struct task_struct *p),
- TP_ARGS(p));
+ TP_ARGS(p))
/*
* Tracepoint for waiting on task to unschedule:
*/
DEFINE_EVENT(sched_process_template, sched_wait_task,
TP_PROTO(struct task_struct *p),
- TP_ARGS(p));
+ TP_ARGS(p))
/*
* Tracepoint for a waiting task:
@@ -244,7 +249,7 @@ TRACE_EVENT(sched_process_wait,
TP_printk("comm=%s pid=%d prio=%d",
__entry->comm, __entry->pid, __entry->prio)
-);
+)
/*
* Tracepoint for do_fork:
@@ -272,7 +277,7 @@ TRACE_EVENT(sched_process_fork,
TP_printk("comm=%s pid=%d child_comm=%s child_pid=%d",
__entry->parent_comm, __entry->parent_pid,
__entry->child_comm, __entry->child_pid)
-);
+)
/*
* XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE
@@ -302,7 +307,7 @@ DECLARE_EVENT_CLASS(sched_stat_template,
TP_printk("comm=%s pid=%d delay=%Lu [ns]",
__entry->comm, __entry->pid,
(unsigned long long)__entry->delay)
-);
+)
/*
@@ -311,7 +316,7 @@ DECLARE_EVENT_CLASS(sched_stat_template,
*/
DEFINE_EVENT(sched_stat_template, sched_stat_wait,
TP_PROTO(struct task_struct *tsk, u64 delay),
- TP_ARGS(tsk, delay));
+ TP_ARGS(tsk, delay))
/*
* Tracepoint for accounting sleep time (time the task is not runnable,
@@ -319,7 +324,7 @@ DEFINE_EVENT(sched_stat_template, sched_
*/
DEFINE_EVENT(sched_stat_template, sched_stat_sleep,
TP_PROTO(struct task_struct *tsk, u64 delay),
- TP_ARGS(tsk, delay));
+ TP_ARGS(tsk, delay))
/*
* Tracepoint for accounting iowait time (time the task is not runnable
@@ -327,7 +332,7 @@ DEFINE_EVENT(sched_stat_template, sched_
*/
DEFINE_EVENT(sched_stat_template, sched_stat_iowait,
TP_PROTO(struct task_struct *tsk, u64 delay),
- TP_ARGS(tsk, delay));
+ TP_ARGS(tsk, delay))
/*
* Tracepoint for accounting runtime (time the task is executing
@@ -360,7 +365,7 @@ TRACE_EVENT(sched_stat_runtime,
__entry->comm, __entry->pid,
(unsigned long long)__entry->runtime,
(unsigned long long)__entry->vruntime)
-);
+)
/*
* Tracepoint for showing priority inheritance modifying a tasks
@@ -389,7 +394,7 @@ TRACE_EVENT(sched_pi_setprio,
TP_printk("comm=%s pid=%d oldprio=%d newprio=%d",
__entry->comm, __entry->pid,
__entry->oldprio, __entry->newprio)
-);
+)
#endif /* _TRACE_SCHED_H */
next prev parent reply other threads:[~2011-05-02 22:04 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-02 21:11 [RFC patch 00/32] TRACE_EVENT: cleanup for code-size reduction Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 02/32] trace event sample remove semicolons, specify need for ifdef around declarations Mathieu Desnoyers
2011-05-03 14:31 ` Steven Rostedt
2011-05-02 21:11 ` [RFC patch 03/32] trace event block remove semicolumns Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 04/32] trace event ext4 remove semicolons Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 05/32] trace event irq " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 06/32] trace event jbd2 " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 07/32] trace event kmem " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 08/32] trace event kvm " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 09/32] trace event lock " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 10/32] trace event mce " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 11/32] trace event module " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 12/32] trace event napi " Mathieu Desnoyers
2011-05-03 12:26 ` Neil Horman
2011-05-02 21:11 ` [RFC patch 13/32] trace event net " Mathieu Desnoyers
2011-05-03 12:27 ` Neil Horman
2011-05-02 21:11 ` [RFC patch 14/32] trace event power " Mathieu Desnoyers
2011-05-03 12:59 ` Pihet-XID, Jean
2011-05-02 21:11 ` Mathieu Desnoyers [this message]
2011-05-02 21:11 ` [RFC patch 16/32] trace event scsi " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 17/32] trace event signal " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 18/32] trace event skb " Mathieu Desnoyers
2011-05-03 12:27 ` Neil Horman
2011-05-02 21:11 ` [RFC patch 19/32] trace event syscalls " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 20/32] trace event timer " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 21/32] trace event vmscan " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 22/32] trace event workqueue " Mathieu Desnoyers
2011-05-03 8:25 ` Tejun Heo
2011-05-02 21:11 ` [RFC patch 23/32] trace event writeback " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 24/32] trace event wireless " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 25/32] trace event video gpu " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 26/32] trace event gfs2 " Mathieu Desnoyers
2011-05-03 10:14 ` Steven Whitehouse
2011-05-03 21:13 ` Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 27/32] trace event xfs " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 28/32] trace event powerpc " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 29/32] trace event asoc " Mathieu Desnoyers
2011-05-03 13:21 ` Mark Brown
2011-05-03 14:06 ` Mathieu Desnoyers
2011-05-03 14:14 ` Mark Brown
2011-05-03 14:24 ` Mark Brown
2011-05-03 14:34 ` Steven Rostedt
2011-05-03 21:29 ` Mathieu Desnoyers
2011-05-03 20:57 ` Mathieu Desnoyers
2011-05-03 21:30 ` Mathieu Desnoyers
2011-05-03 14:30 ` Steven Rostedt
2011-05-03 14:29 ` Mark Brown
2011-05-02 21:11 ` [RFC patch 30/32] trace event compaction " Mathieu Desnoyers
2011-05-02 21:11 ` [RFC patch 31/32] trace event regulator " Mathieu Desnoyers
2011-05-03 14:30 ` Mark Brown
2011-05-02 21:11 ` [RFC patch 32/32] trace event btrfs " Mathieu Desnoyers
[not found] ` <20110502213211.250108074@efficios.com>
2011-05-03 14:07 ` [RFC patch 01/32] TRACE_EVENT: gradual semicolon removal Mathieu Desnoyers
2011-05-03 14:37 ` Steven Rostedt
2011-05-03 14:53 ` Mark Brown
[not found] ` <1304422337.25414.2382.camel@gandalf.stny.rr.com>
2011-05-03 21:26 ` Mathieu Desnoyers
2011-05-03 22:01 ` Frederic Weisbecker
-- strict thread matches above, loose matches on Subject: below --
2011-05-03 23:10 [RFC patch 00/32] TRACE_EVENT: cleanup for code-size reduction (v2) Mathieu Desnoyers
2011-05-03 23:10 ` [RFC patch 15/32] trace event sched remove trailing semicolon Mathieu Desnoyers
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=20110502213213.708193594@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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