All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: lokesh jaliminche <lokesh.jaliminche@gmail.com>
Cc: SeongJae Park <sj@kernel.org>, damon@lists.linux.dev
Subject: Re: Regarding DAMON sysfs usage to get memory access stats
Date: Fri, 26 Apr 2024 13:04:08 -0700	[thread overview]
Message-ID: <20240426200408.100431-1-sj@kernel.org> (raw)
In-Reply-To: <CAKJOkCr86bMoOgxnJQu8Ry-W-2XHYn_xgyZWL4pTPCgcGK3_rg@mail.gmail.com>

Hi Lokesh,


Sorry for late reply.  Somehow I missed this mail.

On Mon, 22 Apr 2024 17:51:21 -0700 lokesh jaliminche <lokesh.jaliminche@gmail.com> wrote:

> Hi Everyone,
> 
> I am currently experimenting with DAMON to gather memory access
> statistics for virtual address ranges associated with specific
> processes. I have followed the detailed instructions provided in the
> usage documentation, but it's unclear where to find the resulting
> memory access statistics.
>  Any pointers on where to get these statistics?
> 
> Steps
> # cd /sys/kernel/mm/damon/admin/
> # echo 1 > kdamonds/nr_kdamonds && echo 1 > kdamonds/0/contexts/nr_contexts
> # echo vaddr > kdamonds/0/contexts/0/operations
> # echo 1 > kdamonds/0/contexts/0/targets/nr_targets
> # echo $(pidof masim) > kdamonds/0/contexts/0/targets/0/pid_target
> # echo on > kdamonds/0/state

After the above steps, you can get the monitoring results from 'tried_regions'
directory[1] of the sysfs interface, or by collecting damon:damon_aggregatred
tracepoint[2].

However, I'd recommend using the user-space tool, 'damo'[3], if you could.  It
provides more human-friendly interface and visualization of the monitoring
results.  For example, the above step could be reduced to single command like
below:

    $ sudo damo start $(pidof masim)

Then you could show the monitoring results snapshot in realtime like below:

    $ sudo damo show
    0   addr [4.000 GiB   , 16.245 GiB ) (12.245 GiB ) access 0 %   age 7 m 32.100 s
    1   addr [16.245 GiB  , 28.529 GiB ) (12.284 GiB ) access 0 %   age 12 m 40.500 s
    2   addr [28.529 GiB  , 40.800 GiB ) (12.271 GiB ) access 0 %   age 15 m 10.100 s
    3   addr [40.800 GiB  , 52.866 GiB ) (12.066 GiB ) access 0 %   age 15 m 58.600 s
    4   addr [52.866 GiB  , 65.121 GiB ) (12.255 GiB ) access 0 %   age 16 m 15.900 s
    5   addr [65.121 GiB  , 77.312 GiB ) (12.191 GiB ) access 0 %   age 16 m 22.400 s
    6   addr [77.312 GiB  , 89.537 GiB ) (12.225 GiB ) access 0 %   age 16 m 24.200 s
    7   addr [89.537 GiB  , 101.824 GiB) (12.287 GiB ) access 0 %   age 16 m 25 s
    8   addr [101.824 GiB , 126.938 GiB) (25.114 GiB ) access 0 %   age 16 m 25.300 s
    total size: 122.938 GiB

The above is only a small part of the features of the tool.  You can get more
details of the tool from its usage document[4].

[1] https://docs.kernel.org/admin-guide/mm/damon/usage.html#sysfs-schemes-tried-regions
[2] https://docs.kernel.org/admin-guide/mm/damon/usage.html#tracepoints-for-monitoring-results
[3] https://github.com/awslabs/damo
[4] https://github.com/awslabs/damo/blob/next/USAGE.md


Thanks,
SJ

> 
> Thanks & Regards,
> Lokesh

  reply	other threads:[~2024-04-26 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23  0:51 Regarding DAMON sysfs usage to get memory access stats lokesh jaliminche
2024-04-26 20:04 ` SeongJae Park [this message]
2024-04-27 21:18   ` lokesh jaliminche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240426200408.100431-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=lokesh.jaliminche@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.