From patchwork Thu Dec 9 16:33:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: haoxin X-Patchwork-Id: 12667021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBB44C433EF for ; Thu, 9 Dec 2021 16:33:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 599F66B0072; Thu, 9 Dec 2021 11:33:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 549506B0073; Thu, 9 Dec 2021 11:33:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 438D86B0074; Thu, 9 Dec 2021 11:33:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 330806B0072 for ; Thu, 9 Dec 2021 11:33:43 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E8450824556B for ; Thu, 9 Dec 2021 16:33:32 +0000 (UTC) X-FDA: 78898801464.10.888F2AF Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by imf24.hostedemail.com (Postfix) with ESMTP id 508DE180003 for ; Thu, 9 Dec 2021 16:33:30 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0V-4XSLS_1639067604; Received: from localhost.localdomain(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0V-4XSLS_1639067604) by smtp.aliyun-inc.com(127.0.0.1); Fri, 10 Dec 2021 00:33:27 +0800 From: Xin Hao To: sj@kernel.org Cc: xhao@linux.alibaba.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH V1 2/2] mm/damon: Modify the display form of damon tracepoint Date: Fri, 10 Dec 2021 00:33:17 +0800 Message-Id: <1e019e8ffe8c040376ec59e918d301058cc58ade.1639066954.git.xhao@linux.alibaba.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 508DE180003 X-Stat-Signature: 86hbo83mgdpg8s9psuay7htu86xbbqxk Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of xhao@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=xhao@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-HE-Tag: 1639067610-396103 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000177, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When I use the perf command to record damon monitor data, like below. # perf record -e damon:damon_aggregated # perf script ...target_id=18446462667479739520 nr_regions=13 281472805928960-281472942936064... ...target_id=18446462667479739520 nr_regions=13 281472942936064-281473080008704... ...target_id=18446462667479739520 nr_regions=13 281473080008704-281473216634880... From a user's point of view, the 'target_id' and 'damon_region' which displays in decimal are not very friendly, So there do some changes, keep the 'target_id' display consistent with 'dbgfs/target_ids' interface and 'damon_region' is displayed in hexadecimal, just like below. # perf record -e damon:damon_aggregated # perf script ...target_id=5522 nr_regions=14 ffff716a3000-ffff79893000... ...target_id=5522 nr_regions=14 ffff79893000-ffff819dc000... ...target_id=5522 nr_regions=14 ffff819dc000-ffff89bd9000... Signed-off-by: Xin Hao --- include/trace/events/damon.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.31.0 diff --git a/include/trace/events/damon.h b/include/trace/events/damon.h index 99ffa601e351..67de51814f4c 100644 --- a/include/trace/events/damon.h +++ b/include/trace/events/damon.h @@ -17,7 +17,7 @@ TRACE_EVENT(damon_aggregated, TP_ARGS(t, r, nr_regions), TP_STRUCT__entry( - __field(unsigned long, target_id) + __field(int, target_id) __field(unsigned int, nr_regions) __field(unsigned long, start) __field(unsigned long, end) @@ -26,7 +26,7 @@ TRACE_EVENT(damon_aggregated, ), TP_fast_assign( - __entry->target_id = t->id; + __entry->target_id = (int)pid_vnr((struct pid *)t->id); __entry->nr_regions = nr_regions; __entry->start = r->ar.start; __entry->end = r->ar.end; @@ -34,7 +34,7 @@ TRACE_EVENT(damon_aggregated, __entry->age = r->age; ), - TP_printk("target_id=%lu nr_regions=%u %lu-%lu: %u %u", + TP_printk("target_id=%u nr_regions=%u %lx-%lx: %u %u", __entry->target_id, __entry->nr_regions, __entry->start, __entry->end, __entry->nr_accesses, __entry->age)