mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Claudio Scordino <claudio@evidence.eu.com>
To: linux-kernel@vger.kernel.org
Cc: peterz@infradead.org, mingo@redhat.com,
	Claudio Scordino <claudio@evidence.eu.com>,
	Juri Lelli <juri.lelli@arm.com>,
	Luca Abeni <luca.abeni@santannapisa.it>
Subject: [PATCH] sched/deadline: add GRUB bw change tracepoints
Date: Tue,  4 Jul 2017 14:29:56 +0200	[thread overview]
Message-ID: <1499171396-9662-1-git-send-email-claudio@evidence.eu.com> (raw)

This patch adds a tracepoint for tracing the total and running
bandwidths of GRUB's runqueue.

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Luca Abeni <luca.abeni@santannapisa.it>
---
 include/trace/events/sched.h | 32 ++++++++++++++++++++++++++++++++
 kernel/sched/deadline.c      | 11 +++++++++++
 2 files changed, 43 insertions(+)

diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index ae1409f..050fcb2 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -545,6 +545,38 @@ TRACE_EVENT(sched_swap_numa,
 			__entry->dst_cpu, __entry->dst_nid)
 );
 
+DECLARE_EVENT_CLASS(sched_dl_grub_template,
+
+	TP_PROTO(u64 this_bw, u64 running_bw, unsigned int cpu_id),
+
+	TP_ARGS(this_bw, running_bw, cpu_id),
+
+	TP_STRUCT__entry(
+		__field(u64,		this_bw)
+		__field(u64,		running_bw)
+		__field(u32,		cpu_id)
+	),
+
+	TP_fast_assign(
+		__entry->this_bw = this_bw;
+		__entry->running_bw = running_bw;
+		__entry->cpu_id = cpu_id;
+	),
+
+	TP_printk("total_bw=%llu running_bw=%llu cpu_id=%lu",
+		(unsigned long long)__entry->this_bw,
+		(unsigned long long)__entry->running_bw,
+		(unsigned long)__entry->cpu_id)
+);
+
+
+DEFINE_EVENT(sched_dl_grub_template, sched_dl_grub,
+
+	TP_PROTO(u64 this_bw, u64 running_bw, unsigned int cpu_id),
+
+	TP_ARGS(this_bw, running_bw, cpu_id)
+);
+
 /*
  * Tracepoint for waking a polling cpu without an IPI.
  */
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index a84299f..ae5c7ef 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -17,6 +17,7 @@
 #include "sched.h"
 
 #include <linux/slab.h>
+#include <trace/events/sched.h>
 #include <uapi/linux/sched/types.h>
 
 struct dl_bandwidth def_dl_bandwidth;
@@ -85,6 +86,8 @@ void add_running_bw(u64 dl_bw, struct dl_rq *dl_rq)
 	dl_rq->running_bw += dl_bw;
 	SCHED_WARN_ON(dl_rq->running_bw < old); /* overflow */
 	SCHED_WARN_ON(dl_rq->running_bw > dl_rq->this_bw);
+	trace_sched_dl_grub(dl_rq->this_bw, dl_rq->running_bw,
+			rq_of_dl_rq(dl_rq)->cpu);
 }
 
 static inline
@@ -97,6 +100,8 @@ void sub_running_bw(u64 dl_bw, struct dl_rq *dl_rq)
 	SCHED_WARN_ON(dl_rq->running_bw > old); /* underflow */
 	if (dl_rq->running_bw > old)
 		dl_rq->running_bw = 0;
+	trace_sched_dl_grub(dl_rq->this_bw, dl_rq->running_bw,
+			rq_of_dl_rq(dl_rq)->cpu);
 }
 
 static inline
@@ -107,6 +112,9 @@ void add_rq_bw(u64 dl_bw, struct dl_rq *dl_rq)
 	lockdep_assert_held(&(rq_of_dl_rq(dl_rq))->lock);
 	dl_rq->this_bw += dl_bw;
 	SCHED_WARN_ON(dl_rq->this_bw < old); /* overflow */
+	trace_sched_dl_grub(dl_rq->this_bw, dl_rq->running_bw,
+			rq_of_dl_rq(dl_rq)->cpu);
+
 }
 
 static inline
@@ -120,6 +128,9 @@ void sub_rq_bw(u64 dl_bw, struct dl_rq *dl_rq)
 	if (dl_rq->this_bw > old)
 		dl_rq->this_bw = 0;
 	SCHED_WARN_ON(dl_rq->running_bw > dl_rq->this_bw);
+	trace_sched_dl_grub(dl_rq->this_bw, dl_rq->running_bw,
+			rq_of_dl_rq(dl_rq)->cpu);
+
 }
 
 void dl_change_utilization(struct task_struct *p, u64 new_bw)
-- 
2.7.4

             reply	other threads:[~2017-07-04 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 12:29 Claudio Scordino [this message]
2017-07-04 12:49 ` Juri Lelli
     [not found]   ` <CAGWmfYogdmOFLOsHYnu-YO0+0L6ypuM_DmJkUQeU4rTsye_4GA@mail.gmail.com>
     [not found]     ` <CAGWmfYrayXX3Aw2Mk-wQFtw9LSYB-scFc5mdCVy=iXdN0fTfjQ@mail.gmail.com>
     [not found]       ` <CAGWmfYq2aDJekMhE6R+ALNMQwhbkAw8-BWnkbAbszpXQryTgyQ@mail.gmail.com>
2017-07-04 13:16         ` Claudio Scordino
2017-07-06  3:40 ` kbuild test robot

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=1499171396-9662-1-git-send-email-claudio@evidence.eu.com \
    --to=claudio@evidence.eu.com \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@santannapisa.it \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®