summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/trace/events/sched.h23
-rw-r--r--kernel/sched/fair.c6
-rw-r--r--kernel/sched/pelt.c9
3 files changed, 37 insertions, 1 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index c8c7c7efb487..520b89d384ec 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -594,6 +594,29 @@ TRACE_EVENT(sched_wake_idle_without_ipi,
594 594
595 TP_printk("cpu=%d", __entry->cpu) 595 TP_printk("cpu=%d", __entry->cpu)
596); 596);
597
598/*
599 * Following tracepoints are not exported in tracefs and provide hooking
600 * mechanisms only for testing and debugging purposes.
601 *
602 * Postfixed with _tp to make them easily identifiable in the code.
603 */
604DECLARE_TRACE(pelt_cfs_tp,
605 TP_PROTO(struct cfs_rq *cfs_rq),
606 TP_ARGS(cfs_rq));
607
608DECLARE_TRACE(pelt_rt_tp,
609 TP_PROTO(struct rq *rq),
610 TP_ARGS(rq));
611
612DECLARE_TRACE(pelt_dl_tp,
613 TP_PROTO(struct rq *rq),
614 TP_ARGS(rq));
615
616DECLARE_TRACE(pelt_irq_tp,
617 TP_PROTO(struct rq *rq),
618 TP_ARGS(rq));
619
597#endif /* _TRACE_SCHED_H */ 620#endif /* _TRACE_SCHED_H */
598 621
599/* This part must be outside protection */ 622/* This part must be outside protection */
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 461c3e9a67b2..e883d7e17e36 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3347,6 +3347,8 @@ static inline int propagate_entity_load_avg(struct sched_entity *se)
3347 update_tg_cfs_util(cfs_rq, se, gcfs_rq); 3347 update_tg_cfs_util(cfs_rq, se, gcfs_rq);
3348 update_tg_cfs_runnable(cfs_rq, se, gcfs_rq); 3348 update_tg_cfs_runnable(cfs_rq, se, gcfs_rq);
3349 3349
3350 trace_pelt_cfs_tp(cfs_rq);
3351
3350 return 1; 3352 return 1;
3351} 3353}
3352 3354
@@ -3499,6 +3501,8 @@ static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
3499 add_tg_cfs_propagate(cfs_rq, se->avg.load_sum); 3501 add_tg_cfs_propagate(cfs_rq, se->avg.load_sum);
3500 3502
3501 cfs_rq_util_change(cfs_rq, flags); 3503 cfs_rq_util_change(cfs_rq, flags);
3504
3505 trace_pelt_cfs_tp(cfs_rq);
3502} 3506}
3503 3507
3504/** 3508/**
@@ -3518,6 +3522,8 @@ static void detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
3518 add_tg_cfs_propagate(cfs_rq, -se->avg.load_sum); 3522 add_tg_cfs_propagate(cfs_rq, -se->avg.load_sum);
3519 3523
3520 cfs_rq_util_change(cfs_rq, 0); 3524 cfs_rq_util_change(cfs_rq, 0);
3525
3526 trace_pelt_cfs_tp(cfs_rq);
3521} 3527}
3522 3528
3523/* 3529/*
diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
index 42ea66b07b1d..4e961b55b5ea 100644
--- a/kernel/sched/pelt.c
+++ b/kernel/sched/pelt.c
@@ -28,6 +28,8 @@
28#include "sched.h" 28#include "sched.h"
29#include "pelt.h" 29#include "pelt.h"
30 30
31#include <trace/events/sched.h>
32
31/* 33/*
32 * Approximate: 34 * Approximate:
33 * val * y^n, where y^32 ~= 0.5 (~1 scheduling period) 35 * val * y^n, where y^32 ~= 0.5 (~1 scheduling period)
@@ -292,6 +294,7 @@ int __update_load_avg_cfs_rq(u64 now, struct cfs_rq *cfs_rq)
292 cfs_rq->curr != NULL)) { 294 cfs_rq->curr != NULL)) {
293 295
294 ___update_load_avg(&cfs_rq->avg, 1, 1); 296 ___update_load_avg(&cfs_rq->avg, 1, 1);
297 trace_pelt_cfs_tp(cfs_rq);
295 return 1; 298 return 1;
296 } 299 }
297 300
@@ -317,6 +320,7 @@ int update_rt_rq_load_avg(u64 now, struct rq *rq, int running)
317 running)) { 320 running)) {
318 321
319 ___update_load_avg(&rq->avg_rt, 1, 1); 322 ___update_load_avg(&rq->avg_rt, 1, 1);
323 trace_pelt_rt_tp(rq);
320 return 1; 324 return 1;
321 } 325 }
322 326
@@ -340,6 +344,7 @@ int update_dl_rq_load_avg(u64 now, struct rq *rq, int running)
340 running)) { 344 running)) {
341 345
342 ___update_load_avg(&rq->avg_dl, 1, 1); 346 ___update_load_avg(&rq->avg_dl, 1, 1);
347 trace_pelt_dl_tp(rq);
343 return 1; 348 return 1;
344 } 349 }
345 350
@@ -388,8 +393,10 @@ int update_irq_load_avg(struct rq *rq, u64 running)
388 1, 393 1,
389 1); 394 1);
390 395
391 if (ret) 396 if (ret) {
392 ___update_load_avg(&rq->avg_irq, 1, 1); 397 ___update_load_avg(&rq->avg_irq, 1, 1);
398 trace_pelt_irq_tp(rq);
399 }
393 400
394 return ret; 401 return ret;
395} 402}