diff options
author | Dave Chinner <dchinner@redhat.com> | 2011-07-08 00:14:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:44:27 -0400 |
commit | 095760730c1047c69159ce88021a7fa3833502c8 (patch) | |
tree | 7cee34087a3e0d3d14691075b0ea614846c87d7c /include | |
parent | a9049376ee05bf966bfe2b081b5071326856890a (diff) |
vmscan: add shrink_slab tracepoints
It is impossible to understand what the shrinkers are actually doing
without instrumenting the code, so add a some tracepoints to allow
insight to be gained.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/trace/events/vmscan.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index b2c33bd955fa..36851f7f13da 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -179,6 +179,83 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_re | |||
179 | TP_ARGS(nr_reclaimed) | 179 | TP_ARGS(nr_reclaimed) |
180 | ); | 180 | ); |
181 | 181 | ||
182 | TRACE_EVENT(mm_shrink_slab_start, | ||
183 | TP_PROTO(struct shrinker *shr, struct shrink_control *sc, | ||
184 | long nr_objects_to_shrink, unsigned long pgs_scanned, | ||
185 | unsigned long lru_pgs, unsigned long cache_items, | ||
186 | unsigned long long delta, unsigned long total_scan), | ||
187 | |||
188 | TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs, | ||
189 | cache_items, delta, total_scan), | ||
190 | |||
191 | TP_STRUCT__entry( | ||
192 | __field(struct shrinker *, shr) | ||
193 | __field(void *, shrink) | ||
194 | __field(long, nr_objects_to_shrink) | ||
195 | __field(gfp_t, gfp_flags) | ||
196 | __field(unsigned long, pgs_scanned) | ||
197 | __field(unsigned long, lru_pgs) | ||
198 | __field(unsigned long, cache_items) | ||
199 | __field(unsigned long long, delta) | ||
200 | __field(unsigned long, total_scan) | ||
201 | ), | ||
202 | |||
203 | TP_fast_assign( | ||
204 | __entry->shr = shr; | ||
205 | __entry->shrink = shr->shrink; | ||
206 | __entry->nr_objects_to_shrink = nr_objects_to_shrink; | ||
207 | __entry->gfp_flags = sc->gfp_mask; | ||
208 | __entry->pgs_scanned = pgs_scanned; | ||
209 | __entry->lru_pgs = lru_pgs; | ||
210 | __entry->cache_items = cache_items; | ||
211 | __entry->delta = delta; | ||
212 | __entry->total_scan = total_scan; | ||
213 | ), | ||
214 | |||
215 | TP_printk("%pF %p: objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld", | ||
216 | __entry->shrink, | ||
217 | __entry->shr, | ||
218 | __entry->nr_objects_to_shrink, | ||
219 | show_gfp_flags(__entry->gfp_flags), | ||
220 | __entry->pgs_scanned, | ||
221 | __entry->lru_pgs, | ||
222 | __entry->cache_items, | ||
223 | __entry->delta, | ||
224 | __entry->total_scan) | ||
225 | ); | ||
226 | |||
227 | TRACE_EVENT(mm_shrink_slab_end, | ||
228 | TP_PROTO(struct shrinker *shr, int shrinker_retval, | ||
229 | long unused_scan_cnt, long new_scan_cnt), | ||
230 | |||
231 | TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt), | ||
232 | |||
233 | TP_STRUCT__entry( | ||
234 | __field(struct shrinker *, shr) | ||
235 | __field(void *, shrink) | ||
236 | __field(long, unused_scan) | ||
237 | __field(long, new_scan) | ||
238 | __field(int, retval) | ||
239 | __field(long, total_scan) | ||
240 | ), | ||
241 | |||
242 | TP_fast_assign( | ||
243 | __entry->shr = shr; | ||
244 | __entry->shrink = shr->shrink; | ||
245 | __entry->unused_scan = unused_scan_cnt; | ||
246 | __entry->new_scan = new_scan_cnt; | ||
247 | __entry->retval = shrinker_retval; | ||
248 | __entry->total_scan = new_scan_cnt - unused_scan_cnt; | ||
249 | ), | ||
250 | |||
251 | TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d", | ||
252 | __entry->shrink, | ||
253 | __entry->shr, | ||
254 | __entry->unused_scan, | ||
255 | __entry->new_scan, | ||
256 | __entry->total_scan, | ||
257 | __entry->retval) | ||
258 | ); | ||
182 | 259 | ||
183 | DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, | 260 | DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, |
184 | 261 | ||