Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2775371rdb; Tue, 12 Sep 2023 11:39:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDzNDMyT1XgavgEzfCTBP/pV4aFvSCqoOgjaIQPsPDlrxgZQE4NzXo4va6WragdrguJCSD X-Received: by 2002:a05:6a21:61f:b0:11d:4c79:90ee with SMTP id ll31-20020a056a21061f00b0011d4c7990eemr210421pzb.25.1694543970767; Tue, 12 Sep 2023 11:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694543970; cv=none; d=google.com; s=arc-20160816; b=LO1suOJDy2l0Bs7yhGnBQsQQu6+75ch48tIIRWBwOkUyjWkJ36j1xVSuV6+FqTq+Kl KaYXWSOicB2WG9MEyY8mlWJpZCd7XfpqhAdFsNQZ4MHPTBt64s16GHgetY8gHv5cIRVw z+ncT5LFJqyQAsl3h3SDK/XlBM+ng1jisx7nz4zfdcD/oIUgLd7wMLjAlnNTSvGz4Oob oQgLVg/aA5uac24eonhhyzi9sW41ZuF+DHZk3jaBTFuI/ataN2POtBIQGH/cKT+oWfUV T+Q1Lyz1Do4EFb8Zq0h3DRa36FY3nZih5wAKEwIJ+SAaJSpSF5c1TWS/Wpo7QTTJ17Id Nh4A== 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=uOx8ScWSHBi0cBUuCTXtnmBmYJYt+uGhSfTmXKZCMoM=; fh=jKijsxc1Z2CHKVFf4S4lB42jMLcn6gTpewOn4Tq1/VM=; b=rwyZwaJu7SS3IrPtgFoMh5Nj6flvg9GeCPaYFkqsnVDq6oBU5BYfdo7MglM0j+K8pI rW4Dd9nMG8FSg6FZL8SzxIdj/tkVXR7JTkQV7E2e/CUn2B9td3d0UsK1i8zGw5NcS7CV emLHBicFMVc5P9c5iR2yBKHcyozHsubW5BKr+O2PQQbrmjK+h0r71rnZD5Ce8OoTiCu7 jXDpq01rNq5LLso11V/u1wUeM8EjaxqvceO8mlsd4t6IfyL+yynjseBODNRZTjzLa2wx 8/Wim6diecXYZgml1EwTXCxo7S8xJngovUFd6Zg3FJLzGBtlO97YDDHXtFcNydB693ue kabA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s5JuUHrp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id w12-20020a637b0c000000b00577723d24b0si2932693pgc.46.2023.09.12.11.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 11:39:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s5JuUHrp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CA2148177307; Tue, 12 Sep 2023 11:36:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237494AbjILSgM (ORCPT + 99 others); Tue, 12 Sep 2023 14:36:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237484AbjILSgJ (ORCPT ); Tue, 12 Sep 2023 14:36:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F6AA10E9; Tue, 12 Sep 2023 11:36:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0063C433CB; Tue, 12 Sep 2023 18:36:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694543764; bh=yCdyENSSr2jBoqcU5uuhQp9Eg5ZiZzpyIfgAEWQFG08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s5JuUHrpz8KMHLkg8aMJ3PtViMENNhZOAtLD6nysZlBWl+uyrhv3zSqqpvNWONwQv QIYEUB0E3w2F8W8SuVnlt4LiU46fzpWpTcGR1gDv0470uUcu68m82Tfb5IOmyGa66v Hgdbt+Em7BmjNyVFjcxWVozqsAVTzx7b/rjX+alJW6jVjsuZIgNTXpXgyaW3GKKxeK PMHGe7U7hSnxaxc51DtQj/mkPe9NSLEC3QTWMD00ClWL2m6C6AGJPKSvg3hCYdOnHn jzuAi2lVeOsQD4elxE82Ev28fTLi035QaPSuhabGm/E8Y0dak2rqeJ+VYu3WK1UTlm /p3a8NJIx8bow== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] Docs/admin-guide/mm/damon/usage: document damos_before_apply tracepoint Date: Tue, 12 Sep 2023 18:35:59 +0000 Message-Id: <20230912183559.4733-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230912183559.4733-1-sj@kernel.org> References: <20230912183559.4733-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 12 Sep 2023 11:36:23 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Document damos_before_apply tracepoint on the usage document. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 37 ++++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 282062b6f134..6272cd36590a 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -496,15 +496,24 @@ the files as above. Above is only for an example. .. _tracepoint: -Tracepoint for Monitoring Results -================================= +Tracepoints for Monitoring Results +================================== Users can get the monitoring results via the :ref:`tried_regions -` or a tracepoint, ``damon:damon_aggregated``. -While the tried regions directory is useful for getting a snapshot, the -tracepoint is useful for getting a full record of the results. While the -monitoring is turned on, you could record the tracepoint events and show -results using tracepoint supporting tools like ``perf``. For example:: +`. The interface is useful for getting a +snapshot, but it could be inefficient for fully recording all the monitoring +results. For the purpose, two trace points, namely ``damon:damon_aggregated`` +and ``damon:damos_before_apply``, are provided. ``damon:damon_aggregated`` +provides the whole monitoring results, while ``damon:damos_before_apply`` +provides the monitoring results for regions that each DAMON-based Operation +Scheme (:ref:`DAMOS `) is gonna be applied. Hence, +``damon:damos_before_apply`` is more useful for recording internal behavior of +DAMOS, or DAMOS target access +:ref:`pattern ` based query-like efficient +monitoring results recording. + +While the monitoring is turned on, you could record the tracepoint events and +show results using tracepoint supporting tools like ``perf``. For example:: # echo on > monitor_on # perf record -e damon:damon_aggregated & @@ -527,6 +536,20 @@ counter). Finally the tenth field (``X``) shows the ``age`` of the region (refer to :ref:`design ` for more details of the counter). +If the event was ``damon:damos_beofre_apply``, the ``perf script`` output would +be somewhat like below:: + + kdamond.0 47293 [000] 80801.060214: damon:damos_before_apply: ctx_idx=0 scheme_idx=0 target_idx=0 nr_regions=11 121932607488-135128711168: 0 136 + [...] + +Each line of the output represents each monitoring region that each DAMON-based +Operation Scheme was about to be applied at the traced time. The first five +fields are as usual. It shows the index of the DAMON context (``ctx_idx=X``) +of the scheme in the list of the contexts of the context's kdamond, the index +of the scheme (``scheme_idx=X``) in the list of the schemes of the context, in +addition to the output of ``damon_aggregated`` tracepoint. + + .. _debugfs_interface: debugfs Interface (DEPRECATED!) -- 2.25.1