lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  4 May 2010 14:38:40 +0200
From:	Tejun Heo <tj@...nel.org>
To:	mingo@...e.hu, peterz@...radead.org, efault@....de, avi@...hat.com,
	paulus@...ba.org, acme@...hat.com, linux-kernel@...r.kernel.org
Cc:	Tejun Heo <tj@...nel.org>
Subject: [PATCH 08/12] sched: add switch_in and tick tracepoints

Define and add sched_switch_in and sched_tick tracepoints.  Both are
colocated with perf event functions.  These will be used to make perf
use tracepoints.

Signed-off-by: Tejun Heo <tj@...nel.org>
---
 include/trace/events/sched.h |   14 ++++++++++++++
 kernel/sched.c               |    4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index cfceb0b..2bed8de 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -220,6 +220,20 @@ DECLARE_EVENT_CLASS(sched_process_template,
 );
 
 /*
+ * Tracepoint for task switch in:
+ */
+DEFINE_EVENT(sched_process_template, sched_switch_in,
+	     TP_PROTO(struct task_struct *p),
+	     TP_ARGS(p));
+
+/*
+ * Tracepoint for scheduler tick:
+ */
+DEFINE_EVENT(sched_process_template, sched_tick,
+	     TP_PROTO(struct task_struct *p),
+	     TP_ARGS(p));
+
+/*
  * Tracepoint for freeing a task:
  */
 DEFINE_EVENT(sched_process_template, sched_process_free,
diff --git a/kernel/sched.c b/kernel/sched.c
index 1acec30..f70f9d7 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2827,7 +2827,7 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
 	finish_arch_switch(prev);
 	finish_lock_switch(rq, prev);
 
-	SCHED_EVENT(NONE, sched_in, in, SE_ARGS(current));
+	SCHED_EVENT(switch_in, sched_in, in, SE_ARGS(current));
 	if (mm)
 		mmdrop(mm);
 	if (unlikely(prev_state == TASK_DEAD)) {
@@ -3529,7 +3529,7 @@ void scheduler_tick(void)
 	curr->sched_class->task_tick(rq, curr, 0);
 	raw_spin_unlock(&rq->lock);
 
-	SCHED_EVENT(NONE, tick, NONE, SE_ARGS(curr));
+	SCHED_EVENT(tick, tick, NONE, SE_ARGS(curr));
 
 #ifdef CONFIG_SMP
 	rq->idle_at_tick = idle_cpu(cpu);
-- 
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ