Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2654134pxb; Tue, 24 Aug 2021 04:35:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc1JdmEjIIRugvmOthU+Hke5Xizj6KJv++orCgxldxUDGJn2VKmheHi8ETpzP8BZAH4MXi X-Received: by 2002:a17:906:4a8e:: with SMTP id x14mr8617317eju.389.1629804911304; Tue, 24 Aug 2021 04:35:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629804911; cv=none; d=google.com; s=arc-20160816; b=bFCq7QIMdgKqd5uhzWGIJ0+YPJ95y6u3cDje+pVqc3lLdxJbqccabalG+yiNNjhq19 r40jawdRnKUPSdpd7J3Vt+Oc2hE4nkNWJfPoc8drjOQSb8T2rfCA8f7CXz8MeSqIiKx3 1w7KPVkGU6EY+r8YD1QTWNCot1Z5wHkmZsbmCjU1PWLqBgWZolQ+ejwpAA85N8QRrd/A AA+J6DejaX1xp/5UlejbD7NHYq6wU2ka2fC34kyAOVd7KaGBKYkWnKzBiZS1b54cnRVt +RJQdZvN519jDfDUu66kEXsJ13rbd4A4qDdO4Jt404Rcfpt70k1Z3ysrsrbXtSZYAGVD 2NiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4DXvdN5Je/o6na7RsjQfMKd0MSHmdj3a0FLf0NHnXF4=; b=sMNnmy/ePgw7+P6+6KCyjcSJebyaZaYIkah94ETwg+OcifD1UgQMkB8hDs7kbTICKp jPN0Mjs76DM02Q/ri7rY8LfrsdRpyDxICMrxWzOmBPsS2MaKVxJLQhKWcOPazUTa1c7j 141+w5hqqsvYrvY2icZixwPRZIwvmVUCieZnWDeoWToYmrkqyjEKR5DULx+yaHRFTauq QbGUlxJshmU4zsRVqkyIXYX5pf4Kbd/mVEbCjk6aEV8M3aKvfvwtti3JsFTFwtdEiCG6 lIDqxf+IvU3Fb0A2Anc/V2CfXs20XJ7JcLi3C9n90Z3H7VdOy4aK2rpZlsF5YYe7UoGJ O3Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I7nz3ZSd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s26si17072059edw.496.2021.08.24.04.34.48; Tue, 24 Aug 2021 04:35:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I7nz3ZSd; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236771AbhHXLbL (ORCPT + 99 others); Tue, 24 Aug 2021 07:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236900AbhHXLbB (ORCPT ); Tue, 24 Aug 2021 07:31:01 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBB91C061796; Tue, 24 Aug 2021 04:30:16 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id n18so19498459pgm.12; Tue, 24 Aug 2021 04:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4DXvdN5Je/o6na7RsjQfMKd0MSHmdj3a0FLf0NHnXF4=; b=I7nz3ZSdlWOuLXhdOJF5Rx2EBPYnF9BmEI6gv4sNYvnUeRm2nt4sZK9hzxrP70k2ce 4/iWIKrJdeE/drPzVX3a95aKmVF6IR7MEJzgTCeVZ5RVlyfFX6EN3I/KFrLjFKiRrWfI uGgYPIpbA3yYFrMsmOG3/TuVecfuHxjQCxCy0MsnDCBKxy5r5s8YpBudpYLnexi+t6DB f07Acbp+GhXSwZZYwbr6ai93Syc6nDXdQc/uS0Y0bIeg1V8zyGDBLxetYPPy6GbZyZB0 sHnBphE9U1nECcLG3o/vM1B3jaDcMjAD3WeliGlSydf8HGkmPRmi2Lh6jmcK3gONOKtq G8uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4DXvdN5Je/o6na7RsjQfMKd0MSHmdj3a0FLf0NHnXF4=; b=kF6nrHUiC32MwQjjhsGMrFg3jf51L1ox1Sob0LN1mTZoalj+aO2bqCJSqdLuvXAVFY lAL/tkfYE+qlPv7uvTQS+cmfD4dwnp+kqYmOigEQmLohhlxg0x/1nuMZC16YuFCJT9At HtoS0r7sAqxFJb9oFOoLA2m4kR2/s6lRx6j4YouetpFfPKc2d0VCxdajwa5wcmZXB2H3 2Jj63oa7jTKOqkD0CN4XQNkQ7t7v5VkTS3zT+fUDSl74XZaHUqNtlbnRMvT4xERSrTfw yg1KNpb6aYJ9I0TOiaig+9oKyX26U0RbBPjEADaWDGMhOLibalnsWRiQ3f1i7K7iJiP2 eIsA== X-Gm-Message-State: AOAM530wIlzJFnRsYSDbolq3WQe1tqb/p3pcm5jmxm9hwNOAZ7/iTi4m ReznOrKpBtPfaeAxLpsAXL0= X-Received: by 2002:a65:5a89:: with SMTP id c9mr36569268pgt.274.1629804616302; Tue, 24 Aug 2021 04:30:16 -0700 (PDT) Received: from localhost.localdomain ([45.77.24.247]) by smtp.gmail.com with ESMTPSA id on15sm2128732pjb.19.2021.08.24.04.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 04:30:15 -0700 (PDT) From: Yafang Shao To: mingo@redhat.com, peterz@infradead.org, mgorman@suse.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, achaiken@aurora.tech Cc: lkp@intel.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Yafang Shao Subject: [PATCH v3 6/7] sched, rt: support sched_stat_runtime tracepoint for RT sched class Date: Tue, 24 Aug 2021 11:29:45 +0000 Message-Id: <20210824112946.9324-7-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210824112946.9324-1-laoar.shao@gmail.com> References: <20210824112946.9324-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The runtime of a RT task has already been there, so we only need to add a tracepoint. One difference between fair task and RT task is that there is no vruntime in RT task. To reuse the sched_stat_runtime tracepoint, '0' is passed as vruntime for RT task. The output of this tracepoint for RT task as follows, stress-9748 [039] d.h. 113.519352: sched_stat_runtime: comm=stress pid=9748 runtime=997573 [ns] vruntime=0 [ns] stress-9748 [039] d.h. 113.520352: sched_stat_runtime: comm=stress pid=9748 runtime=997627 [ns] vruntime=0 [ns] stress-9748 [039] d.h. 113.521352: sched_stat_runtime: comm=stress pid=9748 runtime=998203 [ns] vruntime=0 [ns] Signed-off-by: Yafang Shao Cc: Mel Gorman Cc: Alison Chaiken --- kernel/sched/rt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 95a7c3ad2dc3..5d251112e51c 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1012,6 +1012,8 @@ static void update_curr_rt(struct rq *rq) schedstat_set(curr->stats.exec_max, max(curr->stats.exec_max, delta_exec)); + trace_sched_stat_runtime(curr, delta_exec, 0); + curr->se.sum_exec_runtime += delta_exec; account_group_exec_runtime(curr, delta_exec); -- 2.18.2