xref: /openbmc/linux/include/trace/events/fscache.h (revision 5d00e426f95e7ea036fec2a0aceb3f71d6dbdf92)
11e1236b8SDavid Howells /* SPDX-License-Identifier: GPL-2.0-or-later */
21e1236b8SDavid Howells /* FS-Cache tracepoints
31e1236b8SDavid Howells  *
41e1236b8SDavid Howells  * Copyright (C) 2021 Red Hat, Inc. All Rights Reserved.
51e1236b8SDavid Howells  * Written by David Howells (dhowells@redhat.com)
61e1236b8SDavid Howells  */
71e1236b8SDavid Howells #undef TRACE_SYSTEM
81e1236b8SDavid Howells #define TRACE_SYSTEM fscache
91e1236b8SDavid Howells 
101e1236b8SDavid Howells #if !defined(_TRACE_FSCACHE_H) || defined(TRACE_HEADER_MULTI_READ)
111e1236b8SDavid Howells #define _TRACE_FSCACHE_H
121e1236b8SDavid Howells 
131e1236b8SDavid Howells #include <linux/fscache.h>
141e1236b8SDavid Howells #include <linux/tracepoint.h>
151e1236b8SDavid Howells 
161e1236b8SDavid Howells /*
171e1236b8SDavid Howells  * Define enums for tracing information.
181e1236b8SDavid Howells  */
191e1236b8SDavid Howells #ifndef __FSCACHE_DECLARE_TRACE_ENUMS_ONCE_ONLY
201e1236b8SDavid Howells #define __FSCACHE_DECLARE_TRACE_ENUMS_ONCE_ONLY
211e1236b8SDavid Howells 
229549332dSDavid Howells enum fscache_cache_trace {
239549332dSDavid Howells 	fscache_cache_collision,
249549332dSDavid Howells 	fscache_cache_get_acquire,
259549332dSDavid Howells 	fscache_cache_new_acquire,
2662ab6335SDavid Howells 	fscache_cache_put_alloc_volume,
279549332dSDavid Howells 	fscache_cache_put_cache,
289549332dSDavid Howells 	fscache_cache_put_prep_failed,
299549332dSDavid Howells 	fscache_cache_put_relinquish,
3062ab6335SDavid Howells 	fscache_cache_put_volume,
3162ab6335SDavid Howells };
3262ab6335SDavid Howells 
3362ab6335SDavid Howells enum fscache_volume_trace {
3462ab6335SDavid Howells 	fscache_volume_collision,
3562ab6335SDavid Howells 	fscache_volume_get_cookie,
3662ab6335SDavid Howells 	fscache_volume_get_create_work,
3762ab6335SDavid Howells 	fscache_volume_get_hash_collision,
3862ab6335SDavid Howells 	fscache_volume_free,
3962ab6335SDavid Howells 	fscache_volume_new_acquire,
4062ab6335SDavid Howells 	fscache_volume_put_cookie,
4162ab6335SDavid Howells 	fscache_volume_put_create_work,
4262ab6335SDavid Howells 	fscache_volume_put_hash_collision,
4362ab6335SDavid Howells 	fscache_volume_put_relinquish,
4462ab6335SDavid Howells 	fscache_volume_see_create_work,
4562ab6335SDavid Howells 	fscache_volume_see_hash_wake,
46e6acd329SDavid Howells 	fscache_volume_wait_create_work,
479549332dSDavid Howells };
489549332dSDavid Howells 
497f3283abSDavid Howells enum fscache_cookie_trace {
507f3283abSDavid Howells 	fscache_cookie_collision,
517f3283abSDavid Howells 	fscache_cookie_discard,
527f3283abSDavid Howells 	fscache_cookie_get_end_access,
537f3283abSDavid Howells 	fscache_cookie_get_hash_collision,
547f3283abSDavid Howells 	fscache_cookie_new_acquire,
557f3283abSDavid Howells 	fscache_cookie_put_hash_collision,
567f3283abSDavid Howells 	fscache_cookie_put_over_queued,
577f3283abSDavid Howells 	fscache_cookie_put_relinquish,
587f3283abSDavid Howells 	fscache_cookie_put_withdrawn,
597f3283abSDavid Howells 	fscache_cookie_put_work,
607f3283abSDavid Howells 	fscache_cookie_see_active,
617f3283abSDavid Howells 	fscache_cookie_see_relinquish,
627f3283abSDavid Howells 	fscache_cookie_see_withdraw,
637f3283abSDavid Howells 	fscache_cookie_see_work,
647f3283abSDavid Howells };
657f3283abSDavid Howells 
6623e12e28SDavid Howells enum fscache_access_trace {
67bfa22da3SDavid Howells 	fscache_access_acquire_volume,
68bfa22da3SDavid Howells 	fscache_access_acquire_volume_end,
6923e12e28SDavid Howells 	fscache_access_cache_pin,
7023e12e28SDavid Howells 	fscache_access_cache_unpin,
71*5d00e426SDavid Howells 	fscache_access_lookup_cookie_end,
72*5d00e426SDavid Howells 	fscache_access_lookup_cookie_end_failed,
73bfa22da3SDavid Howells 	fscache_access_relinquish_volume,
74bfa22da3SDavid Howells 	fscache_access_relinquish_volume_end,
7523e12e28SDavid Howells 	fscache_access_unlive,
7623e12e28SDavid Howells };
7723e12e28SDavid Howells 
781e1236b8SDavid Howells #endif
791e1236b8SDavid Howells 
801e1236b8SDavid Howells /*
811e1236b8SDavid Howells  * Declare tracing information enums and their string mappings for display.
821e1236b8SDavid Howells  */
839549332dSDavid Howells #define fscache_cache_traces						\
849549332dSDavid Howells 	EM(fscache_cache_collision,		"*COLLIDE*")		\
859549332dSDavid Howells 	EM(fscache_cache_get_acquire,		"GET acq  ")		\
869549332dSDavid Howells 	EM(fscache_cache_new_acquire,		"NEW acq  ")		\
8762ab6335SDavid Howells 	EM(fscache_cache_put_alloc_volume,	"PUT alvol")		\
889549332dSDavid Howells 	EM(fscache_cache_put_cache,		"PUT cache")		\
899549332dSDavid Howells 	EM(fscache_cache_put_prep_failed,	"PUT pfail")		\
9062ab6335SDavid Howells 	EM(fscache_cache_put_relinquish,	"PUT relnq")		\
9162ab6335SDavid Howells 	E_(fscache_cache_put_volume,		"PUT vol  ")
9262ab6335SDavid Howells 
9362ab6335SDavid Howells #define fscache_volume_traces						\
9462ab6335SDavid Howells 	EM(fscache_volume_collision,		"*COLLIDE*")		\
9562ab6335SDavid Howells 	EM(fscache_volume_get_cookie,		"GET cook ")		\
9662ab6335SDavid Howells 	EM(fscache_volume_get_create_work,	"GET creat")		\
9762ab6335SDavid Howells 	EM(fscache_volume_get_hash_collision,	"GET hcoll")		\
9862ab6335SDavid Howells 	EM(fscache_volume_free,			"FREE     ")		\
9962ab6335SDavid Howells 	EM(fscache_volume_new_acquire,		"NEW acq  ")		\
10062ab6335SDavid Howells 	EM(fscache_volume_put_cookie,		"PUT cook ")		\
10162ab6335SDavid Howells 	EM(fscache_volume_put_create_work,	"PUT creat")		\
10262ab6335SDavid Howells 	EM(fscache_volume_put_hash_collision,	"PUT hcoll")		\
10362ab6335SDavid Howells 	EM(fscache_volume_put_relinquish,	"PUT relnq")		\
10462ab6335SDavid Howells 	EM(fscache_volume_see_create_work,	"SEE creat")		\
105bfa22da3SDavid Howells 	EM(fscache_volume_see_hash_wake,	"SEE hwake")		\
106bfa22da3SDavid Howells 	E_(fscache_volume_wait_create_work,	"WAIT crea")
1071e1236b8SDavid Howells 
1087f3283abSDavid Howells #define fscache_cookie_traces						\
1097f3283abSDavid Howells 	EM(fscache_cookie_collision,		"*COLLIDE*")		\
1107f3283abSDavid Howells 	EM(fscache_cookie_discard,		"DISCARD  ")		\
1117f3283abSDavid Howells 	EM(fscache_cookie_get_hash_collision,	"GET hcoll")		\
1127f3283abSDavid Howells 	EM(fscache_cookie_get_end_access,	"GQ  endac")		\
1137f3283abSDavid Howells 	EM(fscache_cookie_new_acquire,		"NEW acq  ")		\
1147f3283abSDavid Howells 	EM(fscache_cookie_put_hash_collision,	"PUT hcoll")		\
1157f3283abSDavid Howells 	EM(fscache_cookie_put_over_queued,	"PQ  overq")		\
1167f3283abSDavid Howells 	EM(fscache_cookie_put_relinquish,	"PUT relnq")		\
1177f3283abSDavid Howells 	EM(fscache_cookie_put_withdrawn,	"PUT wthdn")		\
1187f3283abSDavid Howells 	EM(fscache_cookie_put_work,		"PQ  work ")		\
1197f3283abSDavid Howells 	EM(fscache_cookie_see_active,		"-   activ")		\
1207f3283abSDavid Howells 	EM(fscache_cookie_see_relinquish,	"-   x-rlq")		\
1217f3283abSDavid Howells 	EM(fscache_cookie_see_withdraw,		"-   x-wth")		\
1227f3283abSDavid Howells 	E_(fscache_cookie_see_work,		"-   work ")
1237f3283abSDavid Howells 
12423e12e28SDavid Howells #define fscache_access_traces		\
125bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume,	"BEGIN acq_vol")	\
126bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume_end,	"END   acq_vol")	\
12723e12e28SDavid Howells 	EM(fscache_access_cache_pin,		"PIN   cache  ")	\
12823e12e28SDavid Howells 	EM(fscache_access_cache_unpin,		"UNPIN cache  ")	\
129*5d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end,	"END   lookup ")	\
130*5d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end_failed,"END   lookupf")	\
131bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume,	"BEGIN rlq_vol")	\
132bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume_end,"END   rlq_vol")	\
13323e12e28SDavid Howells 	E_(fscache_access_unlive,		"END   unlive ")
13423e12e28SDavid Howells 
1351e1236b8SDavid Howells /*
1361e1236b8SDavid Howells  * Export enum symbols via userspace.
1371e1236b8SDavid Howells  */
1381e1236b8SDavid Howells #undef EM
1391e1236b8SDavid Howells #undef E_
1401e1236b8SDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a);
1411e1236b8SDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a);
1421e1236b8SDavid Howells 
1439549332dSDavid Howells fscache_cache_traces;
14462ab6335SDavid Howells fscache_volume_traces;
1457f3283abSDavid Howells fscache_cookie_traces;
14623e12e28SDavid Howells fscache_access_traces;
1479549332dSDavid Howells 
1481e1236b8SDavid Howells /*
1491e1236b8SDavid Howells  * Now redefine the EM() and E_() macros to map the enums to the strings that
1501e1236b8SDavid Howells  * will be printed in the output.
1511e1236b8SDavid Howells  */
1521e1236b8SDavid Howells #undef EM
1531e1236b8SDavid Howells #undef E_
1541e1236b8SDavid Howells #define EM(a, b)	{ a, b },
1551e1236b8SDavid Howells #define E_(a, b)	{ a, b }
1561e1236b8SDavid Howells 
1571e1236b8SDavid Howells 
1589549332dSDavid Howells TRACE_EVENT(fscache_cache,
1599549332dSDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
1609549332dSDavid Howells 		     int usage,
1619549332dSDavid Howells 		     enum fscache_cache_trace where),
1629549332dSDavid Howells 
1639549332dSDavid Howells 	    TP_ARGS(cache_debug_id, usage, where),
1649549332dSDavid Howells 
1659549332dSDavid Howells 	    TP_STRUCT__entry(
1669549332dSDavid Howells 		    __field(unsigned int,		cache		)
1679549332dSDavid Howells 		    __field(int,			usage		)
1689549332dSDavid Howells 		    __field(enum fscache_cache_trace,	where		)
1699549332dSDavid Howells 			     ),
1709549332dSDavid Howells 
1719549332dSDavid Howells 	    TP_fast_assign(
1729549332dSDavid Howells 		    __entry->cache	= cache_debug_id;
1739549332dSDavid Howells 		    __entry->usage	= usage;
1749549332dSDavid Howells 		    __entry->where	= where;
1759549332dSDavid Howells 			   ),
1769549332dSDavid Howells 
1779549332dSDavid Howells 	    TP_printk("C=%08x %s r=%d",
1789549332dSDavid Howells 		      __entry->cache,
1799549332dSDavid Howells 		      __print_symbolic(__entry->where, fscache_cache_traces),
1809549332dSDavid Howells 		      __entry->usage)
1819549332dSDavid Howells 	    );
1829549332dSDavid Howells 
18362ab6335SDavid Howells TRACE_EVENT(fscache_volume,
18462ab6335SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
18562ab6335SDavid Howells 		     int usage,
18662ab6335SDavid Howells 		     enum fscache_volume_trace where),
18762ab6335SDavid Howells 
18862ab6335SDavid Howells 	    TP_ARGS(volume_debug_id, usage, where),
18962ab6335SDavid Howells 
19062ab6335SDavid Howells 	    TP_STRUCT__entry(
19162ab6335SDavid Howells 		    __field(unsigned int,		volume		)
19262ab6335SDavid Howells 		    __field(int,			usage		)
19362ab6335SDavid Howells 		    __field(enum fscache_volume_trace,	where		)
19462ab6335SDavid Howells 			     ),
19562ab6335SDavid Howells 
19662ab6335SDavid Howells 	    TP_fast_assign(
19762ab6335SDavid Howells 		    __entry->volume	= volume_debug_id;
19862ab6335SDavid Howells 		    __entry->usage	= usage;
19962ab6335SDavid Howells 		    __entry->where	= where;
20062ab6335SDavid Howells 			   ),
20162ab6335SDavid Howells 
20262ab6335SDavid Howells 	    TP_printk("V=%08x %s u=%d",
20362ab6335SDavid Howells 		      __entry->volume,
20462ab6335SDavid Howells 		      __print_symbolic(__entry->where, fscache_volume_traces),
20562ab6335SDavid Howells 		      __entry->usage)
20662ab6335SDavid Howells 	    );
20762ab6335SDavid Howells 
2087f3283abSDavid Howells TRACE_EVENT(fscache_cookie,
2097f3283abSDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
2107f3283abSDavid Howells 		     int ref,
2117f3283abSDavid Howells 		     enum fscache_cookie_trace where),
2127f3283abSDavid Howells 
2137f3283abSDavid Howells 	    TP_ARGS(cookie_debug_id, ref, where),
2147f3283abSDavid Howells 
2157f3283abSDavid Howells 	    TP_STRUCT__entry(
2167f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
2177f3283abSDavid Howells 		    __field(int,			ref		)
2187f3283abSDavid Howells 		    __field(enum fscache_cookie_trace,	where		)
2197f3283abSDavid Howells 			     ),
2207f3283abSDavid Howells 
2217f3283abSDavid Howells 	    TP_fast_assign(
2227f3283abSDavid Howells 		    __entry->cookie	= cookie_debug_id;
2237f3283abSDavid Howells 		    __entry->ref	= ref;
2247f3283abSDavid Howells 		    __entry->where	= where;
2257f3283abSDavid Howells 			   ),
2267f3283abSDavid Howells 
2277f3283abSDavid Howells 	    TP_printk("c=%08x %s r=%d",
2287f3283abSDavid Howells 		      __entry->cookie,
2297f3283abSDavid Howells 		      __print_symbolic(__entry->where, fscache_cookie_traces),
2307f3283abSDavid Howells 		      __entry->ref)
2317f3283abSDavid Howells 	    );
2327f3283abSDavid Howells 
23323e12e28SDavid Howells TRACE_EVENT(fscache_access_cache,
23423e12e28SDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
23523e12e28SDavid Howells 		     int ref,
23623e12e28SDavid Howells 		     int n_accesses,
23723e12e28SDavid Howells 		     enum fscache_access_trace why),
23823e12e28SDavid Howells 
23923e12e28SDavid Howells 	    TP_ARGS(cache_debug_id, ref, n_accesses, why),
24023e12e28SDavid Howells 
24123e12e28SDavid Howells 	    TP_STRUCT__entry(
24223e12e28SDavid Howells 		    __field(unsigned int,		cache		)
24323e12e28SDavid Howells 		    __field(int,			ref		)
24423e12e28SDavid Howells 		    __field(int,			n_accesses	)
24523e12e28SDavid Howells 		    __field(enum fscache_access_trace,	why		)
24623e12e28SDavid Howells 			     ),
24723e12e28SDavid Howells 
24823e12e28SDavid Howells 	    TP_fast_assign(
24923e12e28SDavid Howells 		    __entry->cache	= cache_debug_id;
25023e12e28SDavid Howells 		    __entry->ref	= ref;
25123e12e28SDavid Howells 		    __entry->n_accesses	= n_accesses;
25223e12e28SDavid Howells 		    __entry->why	= why;
25323e12e28SDavid Howells 			   ),
25423e12e28SDavid Howells 
25523e12e28SDavid Howells 	    TP_printk("C=%08x %s r=%d a=%d",
25623e12e28SDavid Howells 		      __entry->cache,
25723e12e28SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
25823e12e28SDavid Howells 		      __entry->ref,
25923e12e28SDavid Howells 		      __entry->n_accesses)
26023e12e28SDavid Howells 	    );
26123e12e28SDavid Howells 
262e6acd329SDavid Howells TRACE_EVENT(fscache_access_volume,
263e6acd329SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
264e6acd329SDavid Howells 		     unsigned int cookie_debug_id,
265e6acd329SDavid Howells 		     int ref,
266e6acd329SDavid Howells 		     int n_accesses,
267e6acd329SDavid Howells 		     enum fscache_access_trace why),
268e6acd329SDavid Howells 
269e6acd329SDavid Howells 	    TP_ARGS(volume_debug_id, cookie_debug_id, ref, n_accesses, why),
270e6acd329SDavid Howells 
271e6acd329SDavid Howells 	    TP_STRUCT__entry(
272e6acd329SDavid Howells 		    __field(unsigned int,		volume		)
273e6acd329SDavid Howells 		    __field(unsigned int,		cookie		)
274e6acd329SDavid Howells 		    __field(int,			ref		)
275e6acd329SDavid Howells 		    __field(int,			n_accesses	)
276e6acd329SDavid Howells 		    __field(enum fscache_access_trace,	why		)
277e6acd329SDavid Howells 			     ),
278e6acd329SDavid Howells 
279e6acd329SDavid Howells 	    TP_fast_assign(
280e6acd329SDavid Howells 		    __entry->volume	= volume_debug_id;
281e6acd329SDavid Howells 		    __entry->cookie	= cookie_debug_id;
282e6acd329SDavid Howells 		    __entry->ref	= ref;
283e6acd329SDavid Howells 		    __entry->n_accesses	= n_accesses;
284e6acd329SDavid Howells 		    __entry->why	= why;
285e6acd329SDavid Howells 			   ),
286e6acd329SDavid Howells 
287e6acd329SDavid Howells 	    TP_printk("V=%08x c=%08x %s r=%d a=%d",
288e6acd329SDavid Howells 		      __entry->volume,
289e6acd329SDavid Howells 		      __entry->cookie,
290e6acd329SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
291e6acd329SDavid Howells 		      __entry->ref,
292e6acd329SDavid Howells 		      __entry->n_accesses)
293e6acd329SDavid Howells 	    );
294e6acd329SDavid Howells 
295a7733fb6SDavid Howells TRACE_EVENT(fscache_access,
296a7733fb6SDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
297a7733fb6SDavid Howells 		     int ref,
298a7733fb6SDavid Howells 		     int n_accesses,
299a7733fb6SDavid Howells 		     enum fscache_access_trace why),
300a7733fb6SDavid Howells 
301a7733fb6SDavid Howells 	    TP_ARGS(cookie_debug_id, ref, n_accesses, why),
302a7733fb6SDavid Howells 
303a7733fb6SDavid Howells 	    TP_STRUCT__entry(
304a7733fb6SDavid Howells 		    __field(unsigned int,		cookie		)
305a7733fb6SDavid Howells 		    __field(int,			ref		)
306a7733fb6SDavid Howells 		    __field(int,			n_accesses	)
307a7733fb6SDavid Howells 		    __field(enum fscache_access_trace,	why		)
308a7733fb6SDavid Howells 			     ),
309a7733fb6SDavid Howells 
310a7733fb6SDavid Howells 	    TP_fast_assign(
311a7733fb6SDavid Howells 		    __entry->cookie	= cookie_debug_id;
312a7733fb6SDavid Howells 		    __entry->ref	= ref;
313a7733fb6SDavid Howells 		    __entry->n_accesses	= n_accesses;
314a7733fb6SDavid Howells 		    __entry->why	= why;
315a7733fb6SDavid Howells 			   ),
316a7733fb6SDavid Howells 
317a7733fb6SDavid Howells 	    TP_printk("c=%08x %s r=%d a=%d",
318a7733fb6SDavid Howells 		      __entry->cookie,
319a7733fb6SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
320a7733fb6SDavid Howells 		      __entry->ref,
321a7733fb6SDavid Howells 		      __entry->n_accesses)
322a7733fb6SDavid Howells 	    );
323a7733fb6SDavid Howells 
3247f3283abSDavid Howells TRACE_EVENT(fscache_acquire,
3257f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie),
3267f3283abSDavid Howells 
3277f3283abSDavid Howells 	    TP_ARGS(cookie),
3287f3283abSDavid Howells 
3297f3283abSDavid Howells 	    TP_STRUCT__entry(
3307f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3317f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3327f3283abSDavid Howells 		    __field(int,			v_ref		)
3337f3283abSDavid Howells 		    __field(int,			v_n_cookies	)
3347f3283abSDavid Howells 			     ),
3357f3283abSDavid Howells 
3367f3283abSDavid Howells 	    TP_fast_assign(
3377f3283abSDavid Howells 		    __entry->cookie		= cookie->debug_id;
3387f3283abSDavid Howells 		    __entry->volume		= cookie->volume->debug_id;
3397f3283abSDavid Howells 		    __entry->v_ref		= refcount_read(&cookie->volume->ref);
3407f3283abSDavid Howells 		    __entry->v_n_cookies	= atomic_read(&cookie->volume->n_cookies);
3417f3283abSDavid Howells 			   ),
3427f3283abSDavid Howells 
3437f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x vr=%d vc=%d",
3447f3283abSDavid Howells 		      __entry->cookie,
3457f3283abSDavid Howells 		      __entry->volume, __entry->v_ref, __entry->v_n_cookies)
3467f3283abSDavid Howells 	    );
3477f3283abSDavid Howells 
3487f3283abSDavid Howells TRACE_EVENT(fscache_relinquish,
3497f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie, bool retire),
3507f3283abSDavid Howells 
3517f3283abSDavid Howells 	    TP_ARGS(cookie, retire),
3527f3283abSDavid Howells 
3537f3283abSDavid Howells 	    TP_STRUCT__entry(
3547f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3557f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3567f3283abSDavid Howells 		    __field(int,			ref		)
3577f3283abSDavid Howells 		    __field(int,			n_active	)
3587f3283abSDavid Howells 		    __field(u8,				flags		)
3597f3283abSDavid Howells 		    __field(bool,			retire		)
3607f3283abSDavid Howells 			     ),
3617f3283abSDavid Howells 
3627f3283abSDavid Howells 	    TP_fast_assign(
3637f3283abSDavid Howells 		    __entry->cookie	= cookie->debug_id;
3647f3283abSDavid Howells 		    __entry->volume	= cookie->volume->debug_id;
3657f3283abSDavid Howells 		    __entry->ref	= refcount_read(&cookie->ref);
3667f3283abSDavid Howells 		    __entry->n_active	= atomic_read(&cookie->n_active);
3677f3283abSDavid Howells 		    __entry->flags	= cookie->flags;
3687f3283abSDavid Howells 		    __entry->retire	= retire;
3697f3283abSDavid Howells 			   ),
3707f3283abSDavid Howells 
3717f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x r=%d U=%d f=%02x rt=%u",
3727f3283abSDavid Howells 		      __entry->cookie, __entry->volume, __entry->ref,
3737f3283abSDavid Howells 		      __entry->n_active, __entry->flags, __entry->retire)
3747f3283abSDavid Howells 	    );
3757f3283abSDavid Howells 
3761e1236b8SDavid Howells #endif /* _TRACE_FSCACHE_H */
3771e1236b8SDavid Howells 
3781e1236b8SDavid Howells /* This part must be outside protection */
3791e1236b8SDavid Howells #include <trace/define_trace.h>
380