Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp12188pxa; Tue, 4 Aug 2020 15:05:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo0QLOLSpOMqQ6cWQ82R+CwsNIWNcXJJWOht9LRp2VkCXOHVU913/uGmVshivH0eayWH06 X-Received: by 2002:aa7:c88f:: with SMTP id p15mr23101eds.33.1596578749351; Tue, 04 Aug 2020 15:05:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596578749; cv=none; d=google.com; s=arc-20160816; b=ZKjgi6vn+gdn8YQhaPtfewT3UBl/osGOIPXc6R6Uqio6h8Ii2+b4s1nOi9ba9wg0se G4Sku21lfJsKZUyg6LI8ZFS0XBa+GWlEyE8WUbwLgXMV7UskndbUYCIGdI92ouLHAigg RyZ3qNjNogCMfy2RkfoqNSOZ02GDFTmc91XzRNm8AbQEmLVE0bLuQZxnNpmdW7kkgpJ5 o7/W3+YkSRvR918ZWyNvepdfb0xLEGxzDdGjKD0SgkZYCVdKX+C8docacja1JMYA3mcs S1fVczX41ORzj0lHLpgnTCk3UU5DCx0wIhGHpcSXaPZxMGcQOjPiSEWaqUFWXY+T0M+l ALOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ZD6Qh6A8fTHhaDwoDgmxoM/32aXxoAqbrxaQESvvk9o=; b=kBexsg03Bmn1CFVF8BbREywuXnjvTiZ/ATQbAfacsE7Vx6xO9BBDGPS0hISxNnK7HV cpJ/qaXhWAUvyQheBbcGm4qd4CZnAc52jsMbgGbQBmeUg9kkXiKvT+2QRVWzejUxas9c I3QMJdmhMgwoDESHMfysVCXvWpPR3kenom6OisoxVpEvdlTKJ+ZQqXEFg/3Vv4G4ZSZS Wj9x+fI5+gN9Y6WYKPXUzLgnfG77FsYYXYwpZREr8fzPk0xi10zfw1HiJPMQ2pwFyJRn +h3Zmo5Ft1Toihak0g4QFheqY6gxsOGds9oDG7D1R6wlseX6BDp61Y3YWmxHs6mf43Ae bFSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si39476ejo.189.2020.08.04.15.05.24; Tue, 04 Aug 2020 15:05:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728400AbgHDWCA (ORCPT + 99 others); Tue, 4 Aug 2020 18:02:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:39772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728305AbgHDWB7 (ORCPT ); Tue, 4 Aug 2020 18:01:59 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A7F67207FC; Tue, 4 Aug 2020 22:01:50 +0000 (UTC) Date: Tue, 4 Aug 2020 18:01:47 -0400 From: Steven Rostedt To: SeongJae Park Cc: , SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v19 08/15] mm/damon: Add a tracepoint Message-ID: <20200804180147.16d34809@oasis.local.home> In-Reply-To: <20200804091416.31039-9-sjpark@amazon.com> References: <20200804091416.31039-1-sjpark@amazon.com> <20200804091416.31039-9-sjpark@amazon.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Aug 2020 11:14:09 +0200 SeongJae Park wrote: > From: SeongJae Park > > This commit adds a tracepoint for DAMON. It traces the monitoring > results of each region for each aggregation interval. Using this, DAMON > can easily integrated with tracepoints supporting tools such as perf. > > Signed-off-by: SeongJae Park > Reviewed-by: Leonard Foerster > --- > include/trace/events/damon.h | 43 ++++++++++++++++++++++++++++++++++++ > mm/damon.c | 4 ++++ > 2 files changed, 47 insertions(+) > create mode 100644 include/trace/events/damon.h > > diff --git a/include/trace/events/damon.h b/include/trace/events/damon.h > new file mode 100644 > index 000000000000..2f422f4f1fb9 > --- /dev/null > +++ b/include/trace/events/damon.h > @@ -0,0 +1,43 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM damon > + > +#if !defined(_TRACE_DAMON_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_DAMON_H > + > +#include > +#include > +#include > + > +TRACE_EVENT(damon_aggregated, > + > + TP_PROTO(struct damon_target *t, struct damon_region *r, > + unsigned int nr_regions), > + > + TP_ARGS(t, r, nr_regions), > + > + TP_STRUCT__entry( > + __field(unsigned long, target_id) > + __field(unsigned int, nr_regions) > + __field(unsigned long, start) > + __field(unsigned long, end) > + __field(unsigned int, nr_accesses) > + ), > + > + TP_fast_assign( > + __entry->target_id = t->id; > + __entry->nr_regions = nr_regions; > + __entry->start = r->ar.start; > + __entry->end = r->ar.end; > + __entry->nr_accesses = r->nr_accesses; > + ), > + > + TP_printk("target_id=%lu nr_regions=%u %lu-%lu: %u", > + __entry->target_id, __entry->nr_regions, > + __entry->start, __entry->end, __entry->nr_accesses) > +); > + > +#endif /* _TRACE_DAMON_H */ > + > +/* This part must be outside protection */ > +#include > diff --git a/mm/damon.c b/mm/damon.c > index b3420ba97fd2..65e65e779313 100644 > --- a/mm/damon.c > +++ b/mm/damon.c > @@ -20,6 +20,8 @@ > > #define pr_fmt(fmt) "damon: " fmt > > +#define CREATE_TRACE_POINTS > + > #include > #include > #include > @@ -31,6 +33,7 @@ > #include > #include > #include It's best to place the #define CREATE_TRACE_POINTS here, so that it doesn't cause any side effects when including the other headers. Other than that: Reviewed-by: Steven Rostedt (VMware) -- Steve > +#include > > /* Minimal region size. Every damon_region is aligned by this. */ > #define MIN_REGION PAGE_SIZE > @@ -856,6 +859,7 @@ static void kdamond_reset_aggregated(struct damon_ctx *c) > damon_write_rbuf(c, &r->ar.end, sizeof(r->ar.end)); > damon_write_rbuf(c, &r->nr_accesses, > sizeof(r->nr_accesses)); > + trace_damon_aggregated(t, r, nr); > r->nr_accesses = 0; > } > }