From: Vlastimil Babka <vbabka@suse.cz>
To: Janani Ravichandran <janani.rvchndrn@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: riel@surriel.com, akpm@linux-foundation.org, hannes@cmpxchg.org,
vdavydov@virtuozzo.com, mhocko@suse.com,
mgorman@techsingularity.net, kirill.shutemov@linux.intel.com,
bywxiaobai@163.com
Subject: Re: [PATCH 3/3] Add name fields in shrinker tracepoint definitions
Date: Mon, 11 Jul 2016 16:18:35 +0200 [thread overview]
Message-ID: <447d8214-3c3d-cc4a-2eff-a47923fbe45f@suse.cz> (raw)
In-Reply-To: <6114f72a15d5e52984ea546ba977737221351636.1468051282.git.janani.rvchndrn@gmail.com>
On 07/09/2016 11:05 AM, Janani Ravichandran wrote:
> Currently, the mm_shrink_slab_start and mm_shrink_slab_end
> tracepoints tell us how much time was spent in a shrinker, the number of
> objects scanned, etc. But there is no information about the identity of
> the shrinker. This patch enables the trace output to display names of
> shrinkers.
>
> ---
> include/trace/events/vmscan.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
> index 0101ef3..be4c5b0 100644
> --- a/include/trace/events/vmscan.h
> +++ b/include/trace/events/vmscan.h
> @@ -189,6 +189,7 @@ TRACE_EVENT(mm_shrink_slab_start,
> cache_items, delta, total_scan),
>
> TP_STRUCT__entry(
> + __field(char *, name)
> __field(struct shrinker *, shr)
> __field(void *, shrink)
> __field(int, nid)
> @@ -202,6 +203,7 @@ TRACE_EVENT(mm_shrink_slab_start,
> ),
>
> TP_fast_assign(
> + __entry->name = shr->name;
> __entry->shr = shr;
> __entry->shrink = shr->scan_objects;
> __entry->nid = sc->nid;
> @@ -214,7 +216,8 @@ TRACE_EVENT(mm_shrink_slab_start,
> __entry->total_scan = total_scan;
> ),
>
> - TP_printk("%pF %p: nid: %d objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
> + TP_printk("name: %s %pF %p: nid: %d objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
> + __entry->name,
Is this legal to do when printing is not done via the /sys ... file
itself, but raw data is collected and then printed by e.g. trace-cmd?
How can it possibly interpret the "char *" kernel pointer?
> __entry->shrink,
> __entry->shr,
> __entry->nid,
> @@ -235,6 +238,7 @@ TRACE_EVENT(mm_shrink_slab_end,
> total_scan),
>
> TP_STRUCT__entry(
> + __field(char *, name)
> __field(struct shrinker *, shr)
> __field(int, nid)
> __field(void *, shrink)
> @@ -245,6 +249,7 @@ TRACE_EVENT(mm_shrink_slab_end,
> ),
>
> TP_fast_assign(
> + __entry->name = shr->name;
> __entry->shr = shr;
> __entry->nid = nid;
> __entry->shrink = shr->scan_objects;
> @@ -254,7 +259,8 @@ TRACE_EVENT(mm_shrink_slab_end,
> __entry->total_scan = total_scan;
> ),
>
> - TP_printk("%pF %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
> + TP_printk("name: %s %pF %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
> + __entry->name,
> __entry->shrink,
> __entry->shr,
> __entry->nid,
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-07-11 14:18 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-09 8:33 [PATCH 0/3] Add names of shrinkers and have tracepoints display them Janani Ravichandran
2016-07-09 8:43 ` [PATCH 1/3] Add a new field to struct shrinker Janani Ravichandran
2016-07-11 6:37 ` Michal Hocko
2016-07-11 14:12 ` Rik van Riel
2016-07-11 14:33 ` Michal Hocko
2016-07-20 14:41 ` Janani Ravichandran
2016-07-20 14:54 ` Michal Hocko
2016-07-23 1:27 ` Tony Jones
2016-07-23 4:05 ` Tony Jones
2016-07-23 19:43 ` Rik van Riel
2016-07-23 23:21 ` Tony Jones
2016-07-26 16:40 ` Tony Jones
2016-07-28 5:49 ` Dave Chinner
2016-07-28 10:25 ` Mel Gorman
2016-07-29 0:13 ` Dave Chinner
2016-07-29 13:00 ` Mel Gorman
2016-08-12 3:09 ` Tony Jones
2016-07-09 8:52 ` [PATCH 2/3] Update name field for all shrinker instances Janani Ravichandran
2016-07-13 0:43 ` Tony Jones
2016-07-09 9:05 ` [PATCH 3/3] Add name fields in shrinker tracepoint definitions Janani Ravichandran
2016-07-09 9:45 ` kbuild test robot
2016-07-09 16:18 ` Janani Ravichandran
2016-07-11 14:18 ` Vlastimil Babka [this message]
2016-07-13 0:35 ` Tony Jones
2016-07-13 6:16 ` Janani Ravichandran
2016-07-13 19:12 ` Tony Jones
2016-07-13 19:48 ` Rik van Riel
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=447d8214-3c3d-cc4a-2eff-a47923fbe45f@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=bywxiaobai@163.com \
--cc=hannes@cmpxchg.org \
--cc=janani.rvchndrn@gmail.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=riel@surriel.com \
--cc=vdavydov@virtuozzo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox