Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp959593ybm; Wed, 27 May 2020 12:13:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzey5bUYSbZZuL2jMMi6eruyqxM3pWgw4U71Q51LkquCmbf9RzkxeF61Mm78wBZgrTr10kV X-Received: by 2002:a17:906:55c4:: with SMTP id z4mr7828920ejp.332.1590606786911; Wed, 27 May 2020 12:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590606786; cv=none; d=google.com; s=arc-20160816; b=M0lx13Dciy5ii3dpqL/bMqWGTuE1/s1W2vRYcOzt8b/DyfYUHy2Pe7Vi8DHLa2gYNl QsdrTsZbt1SAAG7OT2blLVUq74Yr8vnlsxd/S49kGejO8wd/9hagLIhXyqG0MuEeKLii 1cD/JsUGN3LBkB1FlbXtyC2qqT0wazBsZLMJ0AqOe/wuMMOAwOHpEyjvEGcuom5jlP8T VMdF86e8wsU/l1bL5mQQ7cLE8/FbViR5e3RoHHAjKlm3lBa99285kI80c+i04e0ATf0k 1M3wvwV/JVov3zusphhDcYTxpaw1ypzIVaToonZHlbXaE9qB5zk4K5j9GPvZASf0SyjF 6nXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=xXUzdUweT+taviYCaOLoTzqTl2U9Ll+BYCm+p4cM59I=; b=ihAP0YLYBdTNtoT4hMvScV3oS4wCU8dZn682e2mQ6Kx179dUBdCo7QQHqeQ470BrEE IUZFu2I9uqAqb0cEF5uHvyMIv77DIGywjH46l0L/u3gFPnbyvtSTReQWf2wASbdTzdH6 q6WDOuBcHBUWxo67dv2czAcFOWaLE1IKeDxhyliZ48WTJEPmjggYntHouzsqasZQZbTu 1i/3PrnKzxEANYyby7OnSF/zVDGBxl0Sk5BbxIWyMrWF2JPHfmvFYJt5QMk/6VhTgWgZ 8iCb42zKAZoXIs1qreRL+oxy3F9euuKTTK6oiSDbAyxU8AtRmcJic7icxR07o4YUWQIq XjDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si2311243edk.415.2020.05.27.12.12.44; Wed, 27 May 2020 12:13:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388698AbgE0QkB (ORCPT + 98 others); Wed, 27 May 2020 12:40:01 -0400 Received: from foss.arm.com ([217.140.110.172]:42350 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388126AbgE0QkB (ORCPT ); Wed, 27 May 2020 12:40:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9C2E830E; Wed, 27 May 2020 09:40:00 -0700 (PDT) Received: from e120877-lin.cambridge.arm.com (e120877-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3E2EC3F52E; Wed, 27 May 2020 09:39:59 -0700 (PDT) From: vincent.donnefort@arm.com To: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org Cc: linux-kernel@vger.kernel.org, patrick.bellasi@matbug.net, dietmar.eggemann@arm.com, valentin.schneider@arm.com, qais.yousef@arm.com, Vincent Donnefort Subject: [PATCH] sched/debug: Add new tracepoints to track util_est Date: Wed, 27 May 2020 17:39:14 +0100 Message-Id: <1590597554-370150-1-git-send-email-vincent.donnefort@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Donnefort The util_est signals are key elements for EAS task placement and frequency selection. Having tracepoints to track these signals enables load-tracking and schedutil testing and/or debugging by a toolkit. Signed-off-by: Vincent Donnefort diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index ed168b0..04f9a4c 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -634,6 +634,14 @@ DECLARE_TRACE(sched_overutilized_tp, TP_PROTO(struct root_domain *rd, bool overutilized), TP_ARGS(rd, overutilized)); +DECLARE_TRACE(sched_util_est_cfs_tp, + TP_PROTO(struct cfs_rq *cfs_rq), + TP_ARGS(cfs_rq)); + +DECLARE_TRACE(sched_util_est_se_tp, + TP_PROTO(struct sched_entity *se), + TP_ARGS(se)); + #endif /* _TRACE_SCHED_H */ /* This part must be outside protection */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9228236..ecff02b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -35,6 +35,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_dl_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_irq_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_se_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_overutilized_tp); +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_cfs_tp); +EXPORT_TRACEPOINT_SYMBOL_GPL(sched_util_est_se_tp); DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 174d2df..cfc0e06 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3922,6 +3922,8 @@ static inline void util_est_enqueue(struct cfs_rq *cfs_rq, enqueued = cfs_rq->avg.util_est.enqueued; enqueued += _task_util_est(p); WRITE_ONCE(cfs_rq->avg.util_est.enqueued, enqueued); + + trace_sched_util_est_cfs_tp(cfs_rq); } /* @@ -3952,6 +3954,8 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep) ue.enqueued -= min_t(unsigned int, ue.enqueued, _task_util_est(p)); WRITE_ONCE(cfs_rq->avg.util_est.enqueued, ue.enqueued); + trace_sched_util_est_cfs_tp(cfs_rq); + /* * Skip update of task's estimated utilization when the task has not * yet completed an activation, e.g. being migrated. @@ -4017,6 +4021,8 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep) ue.ewma >>= UTIL_EST_WEIGHT_SHIFT; done: WRITE_ONCE(p->se.avg.util_est, ue); + + trace_sched_util_est_se_tp(&p->se); } static inline int task_fits_capacity(struct task_struct *p, long capacity) -- 2.7.4