Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2060158pxb; Sun, 5 Sep 2021 07:39:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7eo1HWlB7SIk+qUYd/U9HzRNFo/EvmdvjCIXP1Bq3yY/ey4N32Dgh5L9Kwkfghc/TrwBy X-Received: by 2002:a05:6402:45:: with SMTP id f5mr9088756edu.68.1630852740577; Sun, 05 Sep 2021 07:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630852740; cv=none; d=google.com; s=arc-20160816; b=M8Zwu2RHwYCp/nOvVnb8uqc2BUpLkzKOVoE4m2QgA9gD19ph3D9/V9hkSdaYUiZrbl uUlrCQGfDb96ZmLk4mTAb6Z3YqL7GCMKNImh0fhv4ALQ8lOW4zXOsrlvTet2CkjIxhY/ NEG/afeIPegftdPxvqtc0k6YYhHtUhy+toN5hvU035ysk4mc8cBLk/nPV8FZkLr1ebgu P0KxOb9QuIL24Obryhuk2caGMh8T0S8FrDbEpm9i78yTTpQMoefkSekSAhOvZrjR6JcN QMpXZJ/NkPDj+/HRNrlSDrB2ugSOYIiXjUPnKz4YtiHqPWcFGXO9fmjHs1K0XE0G5x4d wyJQ== 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=Z+Lna6pojyjL2t7CGom+oCHV+V1WgsJ6KwkB2UnK7QtKVt3VS/ecFwTpek7r8D7MuM P2P/oXXUjSCIHZ/VnMByiknfi7Ic9b1WY0ZcP/wRlY/bXnayZX8xcqic79GzN4mf7lY/ 4xZk93ouOq4fMNqqeXKZq7mMnvwET1E7Mbt+vy5tscu22TCQGAMqZPg0Lso5n2tkpXuH lo0c4pv8/BrWtgi+kgv8c0CUpbietDKRQarT7UwbvIuRJvPv00egi+/YKssPeGb/XLAd awF9ThM4nm0BwZ+mRlgYFTYIb13TP8aymshEdnqFYwUffIQo2+XthlnKrXmpItnWdMLl +vDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lXNmfUcF; 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 p23si6244897edw.135.2021.09.05.07.38.36; Sun, 05 Sep 2021 07:39:00 -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=20210112 header.b=lXNmfUcF; 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 S236708AbhIEOhc (ORCPT + 99 others); Sun, 5 Sep 2021 10:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235968AbhIEOh3 (ORCPT ); Sun, 5 Sep 2021 10:37:29 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A58C061757; Sun, 5 Sep 2021 07:36:26 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 8so4051447pga.7; Sun, 05 Sep 2021 07:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4DXvdN5Je/o6na7RsjQfMKd0MSHmdj3a0FLf0NHnXF4=; b=lXNmfUcFH9Oq/SfU45zZcu6vIYtCp1x2eE4PX+2ldK3SypTLbZ2bpgD/NyHn9uu7TR hG4TNzcl1KxSoB/p63ZTNDVYriOd8YAvynND4Pmi3LMb9FP9Oxvj/uN8IxIDdEcZxNno U818Oxt5El5L7Q837RHJ6PUjeCIDoOS5tqilUA/Tfs0RtcWQ3+W0MZGxq0PNKhk1EOBx HAIyoc/meMiS8bRcm+y0OjA8LTWic1YXClWw1TnF5Qk3hWIrzDrWZ5x8GX7YbL6MWQ6J gF+1GJ7ZflX4w2C34qXb8Dqs8cqQMhSv3tG8AoB56KVYZqIisJ+uzE+8WmqjNhX1eHfi k8Cw== 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=n5LxjlkEzAltf61Qmdev4qCDoCvYFwNZ6yUzpqtVKm9j7p9SWDvcIZEY0v1J1tyg1D +pXyHwNBBY/YsJzafrYOqSa+ZCQP8QO9RdraK39J0aJqA1hJui/bhlH4wf9a5N4U78n+ ApoU0g/W2MC5ROfBxa8mAx2X530qG+vn6ktRVSzpopOZVVHvYwhd7zeXxD+HOx5pwWL9 hAOJh1y+81AZeU+x+rb4R3U/PC1fjW62RRl0QOtC7D5mFM8GhjbMNWmKgTQY/jGzp452 iMwnKrrkEnmIZMceq+HpFBzarvhSBoX6WmYYJFxb5BB0D+ZeXU+odIaNajPzHGTSzh1B sO8A== X-Gm-Message-State: AOAM532PdI9zZWoTn/oSaL0vCWp9PUatqACFGHrv1Z+UhvF8n205CDg+ 0XG0uu6j+ij3MXIl7AEgimc= X-Received: by 2002:aa7:8b07:0:b029:3c7:c29f:9822 with SMTP id f7-20020aa78b070000b02903c7c29f9822mr7878850pfd.33.1630852585996; Sun, 05 Sep 2021 07:36:25 -0700 (PDT) Received: from localhost.localdomain ([141.164.38.246]) by smtp.gmail.com with ESMTPSA id n185sm5186883pfn.171.2021.09.05.07.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Sep 2021 07:36:25 -0700 (PDT) From: Yafang Shao To: peterz@infradead.org, mingo@redhat.com, mgorman@suse.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, achaiken@aurora.tech, Yafang Shao Subject: [PATCH v4 5/8] sched, rt: support sched_stat_runtime tracepoint for RT sched class Date: Sun, 5 Sep 2021 14:35:44 +0000 Message-Id: <20210905143547.4668-6-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210905143547.4668-1-laoar.shao@gmail.com> References: <20210905143547.4668-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