Re: [PATCH 1/3] Add a new field to struct shrinker
From: Rik van Riel
Date: Sat Jul 23 2016 - 15:43:54 EST
On Fri, 2016-07-22 at 21:05 -0700, Tony Jones wrote:
> On 07/22/2016 06:27 PM, Tony Jones wrote:
> > On 07/20/2016 07:54 AM, Michal Hocko wrote:
> >
> > > > Michal, just to make sure I understand you correctly, do you
> > > > mean that we
> > > > could infer the names of the shrinkers by looking at the names
> > > > of their callbacks?
> > >
> > > Yes, %ps can then be used for the name of the shrinker structure
> > > (assuming it is available).
> >
> > This is fine for emitting via the ftrace /sys interface,ÂÂbut in
> > order to have the data [name] getÂ
> > marshalled thru to perf (for example) you need to add it to the
> > TP_fast_assign entry.
> >
> > tony
>
> Unfortunately, %ps/%pF doesn't do much (re:ÂÂMichal's comment
> "assuming it is available"):
>
> -ÂÂÂÂÂÂÂ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("%pF %p(%ps): nid: %d objects to shrink %ld
> gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld
> total_scan %ld",
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__entry->shrink,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__entry->shr,
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__entry->shr,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__entry->nid,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ__entry->nr_objects_to_shrink,
>
> # cat trace_pipe
> ÂÂÂÂÂÂÂÂÂÂÂÂbash-1917ÂÂ[003] ...1ÂÂ2925.941062: mm_shrink_slab_start:
> super_cache_scan+0x0/0x1a0 ffff88042bb60cc0(0xffff88042bb60cc0): nid:
> 0 objects to shrink 0 gfp_flags GFP_KERNEL pgs_scanned 1000 lru_pgs
> 1000 cache items 4 delta 7 total_scan 7
>
>
> Otherwise what I was suggesting was something like this to ensure it
> was correctly marshaled for perf/etc:
>
Janani,
it may make sense to have the code Tony posted be part of
your patch series. Just have both of your Signed-off-by:
lines on that patch.
--
All Rights Reversed.Attachment:
signature.asc
Description: This is a digitally signed message part