mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: add GRUB bw change tracepoints
@ 2017-07-04 12:29 Claudio Scordino
  2017-07-04 12:49 ` Juri Lelli
  2017-07-06  3:40 ` kbuild test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Claudio Scordino @ 2017-07-04 12:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, Claudio Scordino, Juri Lelli, Luca Abeni

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sched/deadline: add GRUB bw change tracepoints
  2017-07-04 12:29 [PATCH] sched/deadline: add GRUB bw change tracepoints Claudio Scordino
@ 2017-07-04 12:49 ` Juri Lelli
       [not found]   ` <CAGWmfYogdmOFLOsHYnu-YO0+0L6ypuM_DmJkUQeU4rTsye_4GA@mail.gmail.com>
  2017-07-06  3:40 ` kbuild test robot
  1 sibling, 1 reply; 4+ messages in thread
From: Juri Lelli @ 2017-07-04 12:49 UTC (permalink / raw)
  To: Claudio Scordino; +Cc: linux-kernel, peterz, mingo, Luca Abeni

Hi Claudio,

On 04/07/17 14:29, Claudio Scordino wrote:
> 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>

Don't remember signing this off.
Or if I did it was maybe for internal debugging?

Best,

- Juri

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sched/deadline: add GRUB bw change tracepoints
       [not found]       ` <CAGWmfYq2aDJekMhE6R+ALNMQwhbkAw8-BWnkbAbszpXQryTgyQ@mail.gmail.com>
@ 2017-07-04 13:16         ` Claudio Scordino
  0 siblings, 0 replies; 4+ messages in thread
From: Claudio Scordino @ 2017-07-04 13:16 UTC (permalink / raw)
  To: Juri Lelli; +Cc: Ingo Molnar, Peter Zijlstra, Luca Abeni, Linux Kernel

Ouch, you'right.

Now that I recall, you provided the first draft for internal debugging
but it was Luca who agreed to add it to the patchset. Sorry for the
mistake guys.

Best,

      Claudio

2017-07-04 15:12 GMT+02:00 Claudio Scordino <claudio@evidence.eu.com>:
> Ouch, you'right.
>
> Now that I recall, you provided the first draft for internal debugging but
> it was Luca who agreed to add it to the patchset. Sorry for the mistake
> guys.
>
> Best,
>
>       Claudio
>
>
> Il 04/lug/2017 14:49, "Juri Lelli" <juri.lelli@arm.com> ha scritto:
>
> Hi Claudio,
>
> On 04/07/17 14:29, Claudio Scordino wrote:
>> 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>
>
> Don't remember signing this off.
> Or if I did it was maybe for internal debugging?
>
> Best,
>
> - Juri
>
>



-- 
Claudio Scordino, Ph.D.
Project Manager - Funded research projects

Evidence Srl
Via Carducci 56
56010 S.Giuliano Terme - Pisa - Italy
Phone:  +39 050 99 11 122
Mobile: + 39 393 811 7491
Fax:   +39 050 99 10 812
http://www.evidence.eu.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sched/deadline: add GRUB bw change tracepoints
  2017-07-04 12:29 [PATCH] sched/deadline: add GRUB bw change tracepoints Claudio Scordino
  2017-07-04 12:49 ` Juri Lelli
@ 2017-07-06  3:40 ` kbuild test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2017-07-06  3:40 UTC (permalink / raw)
  To: Claudio Scordino
  Cc: kbuild-all, linux-kernel, peterz, mingo, Claudio Scordino,
	Juri Lelli, Luca Abeni

[-- Attachment #1: Type: text/plain, Size: 2013 bytes --]

Hi Claudio,

[auto build test ERROR on tip/auto-latest]
[cannot apply to v4.12]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Claudio-Scordino/sched-deadline-add-GRUB-bw-change-tracepoints/20170706-091701
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   kernel/sched/deadline.c: In function 'add_running_bw':
>> kernel/sched/deadline.c:90:22: error: 'struct rq' has no member named 'cpu'
       rq_of_dl_rq(dl_rq)->cpu);
                         ^
   kernel/sched/deadline.c: In function 'sub_running_bw':
   kernel/sched/deadline.c:104:22: error: 'struct rq' has no member named 'cpu'
       rq_of_dl_rq(dl_rq)->cpu);
                         ^
   kernel/sched/deadline.c: In function 'add_rq_bw':
   kernel/sched/deadline.c:116:22: error: 'struct rq' has no member named 'cpu'
       rq_of_dl_rq(dl_rq)->cpu);
                         ^
   kernel/sched/deadline.c: In function 'sub_rq_bw':
   kernel/sched/deadline.c:132:22: error: 'struct rq' has no member named 'cpu'
       rq_of_dl_rq(dl_rq)->cpu);
                         ^

vim +90 kernel/sched/deadline.c

    84	
    85		lockdep_assert_held(&(rq_of_dl_rq(dl_rq))->lock);
    86		dl_rq->running_bw += dl_bw;
    87		SCHED_WARN_ON(dl_rq->running_bw < old); /* overflow */
    88		SCHED_WARN_ON(dl_rq->running_bw > dl_rq->this_bw);
    89		trace_sched_dl_grub(dl_rq->this_bw, dl_rq->running_bw,
  > 90				rq_of_dl_rq(dl_rq)->cpu);
    91	}
    92	
    93	static inline

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-06  3:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-04 12:29 [PATCH] sched/deadline: add GRUB bw change tracepoints Claudio Scordino
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

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®