From: Akinobu Mita <akinobu.mita@gmail.com>
To: damon@lists.linux.dev
Cc: linux-mm@kvack.org, akinobu.mita@gmail.com,
SeongJae Park <sj@kernel.org>
Subject: [PATCH damo] _damo_records: support address range in hex format
Date: Mon, 30 Dec 2024 22:42:21 +0900 [thread overview]
Message-ID: <20241230134221.166041-2-akinobu.mita@gmail.com> (raw)
In-Reply-To: <20241230134221.166041-1-akinobu.mita@gmail.com>
In preparation for changing the display format of address ranges in
tracepoints for DAMON, if the start and end addresses of an address range
have a "0x" prefix, convert them as hexadecimal numbers.
Cc: SeongJae Park <sj@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
src/_damo_records.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/_damo_records.py b/src/_damo_records.py
index 6e541a0..55d864c 100644
--- a/src/_damo_records.py
+++ b/src/_damo_records.py
@@ -251,7 +251,7 @@ def parse_damon_aggregated_perf_script_fields(fields):
target_id = int(fields[5].split('=')[1])
nr_regions = int(fields[6].split('=')[1])
- start_addr, end_addr = [int(x) for x in fields[7][:-1].split('-')]
+ start_addr, end_addr = [int(x, 0) for x in fields[7][:-1].split('-')]
nr_accesses = int(fields[8])
if len(fields) == 10:
age = int(fields[9])
@@ -288,7 +288,7 @@ def parse_damos_before_apply_perf_script_fields(fields):
target_id = int(fields[7].split('=')[1])
nr_regions = int(fields[8].split('=')[1])
- start_addr, end_addr = [int(x) for x in fields[9][:-1].split('-')]
+ start_addr, end_addr = [int(x, 0) for x in fields[9][:-1].split('-')]
nr_accesses = int(fields[10])
age = int(fields[11])
region = _damon.DamonRegion(start_addr, end_addr, nr_accesses,
--
2.34.1
next prev parent reply other threads:[~2024-12-30 13:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-30 13:42 [PATCH] mm/damon: trace: print address range in hex Akinobu Mita
2024-12-30 13:42 ` Akinobu Mita [this message]
2024-12-30 18:35 ` [PATCH damo] _damo_records: support address range in hex format SeongJae Park
2024-12-30 18:28 ` [PATCH] mm/damon: trace: print address range in hex SeongJae Park
2024-12-30 18:39 ` SeongJae Park
2024-12-31 12:56 ` Akinobu Mita
2025-01-01 17:43 ` SeongJae Park
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=20241230134221.166041-2-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=damon@lists.linux.dev \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox