* [PATCH 0/2] mm/damon: add a tracepoint for damos apply target regions
@ 2023-09-11 4:59 SeongJae Park
2023-09-11 4:59 ` [PATCH 2/2] Docs/admin-guide/mm/damon/usage: document damos_before_apply tracepoint SeongJae Park
0 siblings, 1 reply; 2+ messages in thread
From: SeongJae Park @ 2023-09-11 4:59 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, Steven Rostedt, damon, linux-mm,
linux-doc, linux-trace-kernel, linux-kernel
Changes from RFC
(https://lore.kernel.org/damon/20230827004045.49516-1-sj@kernel.org/)
- Fix the 4 byte hole (Steven Rostedt)
- Add documentation
DAMON provides damon_aggregated tracepoint to let users record full monitoring
results. Sometimes, users need to record monitoring results of specific
pattern. DAMOS tried regions directory of DAMON sysfs interface allows it, but
the interface is mainly designed for snapshots and therefore would be
inefficient for such recording. Implement yet another tracepoint for efficient
support of the usecase.
SeongJae Park (2):
mm/damon/core: add a tracepoint for damos apply target regions
Docs/admin-guide/mm/damon/usage: document damos_before_apply
tracepoint
Documentation/admin-guide/mm/damon/usage.rst | 37 ++++++++++++++++----
include/trace/events/damon.h | 37 ++++++++++++++++++++
mm/damon/core.c | 27 +++++++++++++-
3 files changed, 93 insertions(+), 8 deletions(-)
base-commit: b4c5d592acb5a939aa4f6c08543daf6e2b435343
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] Docs/admin-guide/mm/damon/usage: document damos_before_apply tracepoint
2023-09-11 4:59 [PATCH 0/2] mm/damon: add a tracepoint for damos apply target regions SeongJae Park
@ 2023-09-11 4:59 ` SeongJae Park
0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2023-09-11 4:59 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, damon, linux-mm, linux-doc,
linux-kernel
Document damos_before_apply tracepoint on the usage document.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
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
-<sysfs_schemes_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::
+<sysfs_schemes_tried_regions>`. 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 <damon_design_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 <damon_design_damos_access_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 <damon_design_age_tracking>` 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-11 4:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11 4:59 [PATCH 0/2] mm/damon: add a tracepoint for damos apply target regions SeongJae Park
2023-09-11 4:59 ` [PATCH 2/2] Docs/admin-guide/mm/damon/usage: document damos_before_apply tracepoint SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).