xref: /openbmc/linux/include/trace/events/fscache.h (revision 12bb21a2)
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,
54*12bb21a2SDavid Howells 	fscache_cookie_get_lru,
55*12bb21a2SDavid Howells 	fscache_cookie_get_use_work,
567f3283abSDavid Howells 	fscache_cookie_new_acquire,
577f3283abSDavid Howells 	fscache_cookie_put_hash_collision,
58*12bb21a2SDavid Howells 	fscache_cookie_put_lru,
597f3283abSDavid Howells 	fscache_cookie_put_over_queued,
607f3283abSDavid Howells 	fscache_cookie_put_relinquish,
617f3283abSDavid Howells 	fscache_cookie_put_withdrawn,
627f3283abSDavid Howells 	fscache_cookie_put_work,
637f3283abSDavid Howells 	fscache_cookie_see_active,
64*12bb21a2SDavid Howells 	fscache_cookie_see_lru_discard,
65*12bb21a2SDavid Howells 	fscache_cookie_see_lru_do_one,
667f3283abSDavid Howells 	fscache_cookie_see_relinquish,
677f3283abSDavid Howells 	fscache_cookie_see_withdraw,
687f3283abSDavid Howells 	fscache_cookie_see_work,
697f3283abSDavid Howells };
707f3283abSDavid Howells 
7123e12e28SDavid Howells enum fscache_access_trace {
72bfa22da3SDavid Howells 	fscache_access_acquire_volume,
73bfa22da3SDavid Howells 	fscache_access_acquire_volume_end,
7423e12e28SDavid Howells 	fscache_access_cache_pin,
7523e12e28SDavid Howells 	fscache_access_cache_unpin,
76*12bb21a2SDavid Howells 	fscache_access_lookup_cookie,
775d00e426SDavid Howells 	fscache_access_lookup_cookie_end,
785d00e426SDavid Howells 	fscache_access_lookup_cookie_end_failed,
79bfa22da3SDavid Howells 	fscache_access_relinquish_volume,
80bfa22da3SDavid Howells 	fscache_access_relinquish_volume_end,
8123e12e28SDavid Howells 	fscache_access_unlive,
8223e12e28SDavid Howells };
8323e12e28SDavid Howells 
841e1236b8SDavid Howells #endif
851e1236b8SDavid Howells 
861e1236b8SDavid Howells /*
871e1236b8SDavid Howells  * Declare tracing information enums and their string mappings for display.
881e1236b8SDavid Howells  */
899549332dSDavid Howells #define fscache_cache_traces						\
909549332dSDavid Howells 	EM(fscache_cache_collision,		"*COLLIDE*")		\
919549332dSDavid Howells 	EM(fscache_cache_get_acquire,		"GET acq  ")		\
929549332dSDavid Howells 	EM(fscache_cache_new_acquire,		"NEW acq  ")		\
9362ab6335SDavid Howells 	EM(fscache_cache_put_alloc_volume,	"PUT alvol")		\
949549332dSDavid Howells 	EM(fscache_cache_put_cache,		"PUT cache")		\
959549332dSDavid Howells 	EM(fscache_cache_put_prep_failed,	"PUT pfail")		\
9662ab6335SDavid Howells 	EM(fscache_cache_put_relinquish,	"PUT relnq")		\
9762ab6335SDavid Howells 	E_(fscache_cache_put_volume,		"PUT vol  ")
9862ab6335SDavid Howells 
9962ab6335SDavid Howells #define fscache_volume_traces						\
10062ab6335SDavid Howells 	EM(fscache_volume_collision,		"*COLLIDE*")		\
10162ab6335SDavid Howells 	EM(fscache_volume_get_cookie,		"GET cook ")		\
10262ab6335SDavid Howells 	EM(fscache_volume_get_create_work,	"GET creat")		\
10362ab6335SDavid Howells 	EM(fscache_volume_get_hash_collision,	"GET hcoll")		\
10462ab6335SDavid Howells 	EM(fscache_volume_free,			"FREE     ")		\
10562ab6335SDavid Howells 	EM(fscache_volume_new_acquire,		"NEW acq  ")		\
10662ab6335SDavid Howells 	EM(fscache_volume_put_cookie,		"PUT cook ")		\
10762ab6335SDavid Howells 	EM(fscache_volume_put_create_work,	"PUT creat")		\
10862ab6335SDavid Howells 	EM(fscache_volume_put_hash_collision,	"PUT hcoll")		\
10962ab6335SDavid Howells 	EM(fscache_volume_put_relinquish,	"PUT relnq")		\
11062ab6335SDavid Howells 	EM(fscache_volume_see_create_work,	"SEE creat")		\
111bfa22da3SDavid Howells 	EM(fscache_volume_see_hash_wake,	"SEE hwake")		\
112bfa22da3SDavid Howells 	E_(fscache_volume_wait_create_work,	"WAIT crea")
1131e1236b8SDavid Howells 
1147f3283abSDavid Howells #define fscache_cookie_traces						\
1157f3283abSDavid Howells 	EM(fscache_cookie_collision,		"*COLLIDE*")		\
1167f3283abSDavid Howells 	EM(fscache_cookie_discard,		"DISCARD  ")		\
1177f3283abSDavid Howells 	EM(fscache_cookie_get_hash_collision,	"GET hcoll")		\
1187f3283abSDavid Howells 	EM(fscache_cookie_get_end_access,	"GQ  endac")		\
119*12bb21a2SDavid Howells 	EM(fscache_cookie_get_lru,		"GET lru  ")		\
120*12bb21a2SDavid Howells 	EM(fscache_cookie_get_use_work,		"GQ  use  ")		\
1217f3283abSDavid Howells 	EM(fscache_cookie_new_acquire,		"NEW acq  ")		\
1227f3283abSDavid Howells 	EM(fscache_cookie_put_hash_collision,	"PUT hcoll")		\
123*12bb21a2SDavid Howells 	EM(fscache_cookie_put_lru,		"PUT lru  ")		\
1247f3283abSDavid Howells 	EM(fscache_cookie_put_over_queued,	"PQ  overq")		\
1257f3283abSDavid Howells 	EM(fscache_cookie_put_relinquish,	"PUT relnq")		\
1267f3283abSDavid Howells 	EM(fscache_cookie_put_withdrawn,	"PUT wthdn")		\
1277f3283abSDavid Howells 	EM(fscache_cookie_put_work,		"PQ  work ")		\
1287f3283abSDavid Howells 	EM(fscache_cookie_see_active,		"-   activ")		\
129*12bb21a2SDavid Howells 	EM(fscache_cookie_see_lru_discard,	"-   x-lru")		\
130*12bb21a2SDavid Howells 	EM(fscache_cookie_see_lru_do_one,	"-   lrudo")		\
1317f3283abSDavid Howells 	EM(fscache_cookie_see_relinquish,	"-   x-rlq")		\
1327f3283abSDavid Howells 	EM(fscache_cookie_see_withdraw,		"-   x-wth")		\
1337f3283abSDavid Howells 	E_(fscache_cookie_see_work,		"-   work ")
1347f3283abSDavid Howells 
13523e12e28SDavid Howells #define fscache_access_traces		\
136bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume,	"BEGIN acq_vol")	\
137bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume_end,	"END   acq_vol")	\
13823e12e28SDavid Howells 	EM(fscache_access_cache_pin,		"PIN   cache  ")	\
13923e12e28SDavid Howells 	EM(fscache_access_cache_unpin,		"UNPIN cache  ")	\
140*12bb21a2SDavid Howells 	EM(fscache_access_lookup_cookie,	"BEGIN lookup ")	\
1415d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end,	"END   lookup ")	\
1425d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end_failed,"END   lookupf")	\
143bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume,	"BEGIN rlq_vol")	\
144bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume_end,"END   rlq_vol")	\
14523e12e28SDavid Howells 	E_(fscache_access_unlive,		"END   unlive ")
14623e12e28SDavid Howells 
1471e1236b8SDavid Howells /*
1481e1236b8SDavid Howells  * Export enum symbols via userspace.
1491e1236b8SDavid Howells  */
1501e1236b8SDavid Howells #undef EM
1511e1236b8SDavid Howells #undef E_
1521e1236b8SDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a);
1531e1236b8SDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a);
1541e1236b8SDavid Howells 
1559549332dSDavid Howells fscache_cache_traces;
15662ab6335SDavid Howells fscache_volume_traces;
1577f3283abSDavid Howells fscache_cookie_traces;
15823e12e28SDavid Howells fscache_access_traces;
1599549332dSDavid Howells 
1601e1236b8SDavid Howells /*
1611e1236b8SDavid Howells  * Now redefine the EM() and E_() macros to map the enums to the strings that
1621e1236b8SDavid Howells  * will be printed in the output.
1631e1236b8SDavid Howells  */
1641e1236b8SDavid Howells #undef EM
1651e1236b8SDavid Howells #undef E_
1661e1236b8SDavid Howells #define EM(a, b)	{ a, b },
1671e1236b8SDavid Howells #define E_(a, b)	{ a, b }
1681e1236b8SDavid Howells 
1691e1236b8SDavid Howells 
1709549332dSDavid Howells TRACE_EVENT(fscache_cache,
1719549332dSDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
1729549332dSDavid Howells 		     int usage,
1739549332dSDavid Howells 		     enum fscache_cache_trace where),
1749549332dSDavid Howells 
1759549332dSDavid Howells 	    TP_ARGS(cache_debug_id, usage, where),
1769549332dSDavid Howells 
1779549332dSDavid Howells 	    TP_STRUCT__entry(
1789549332dSDavid Howells 		    __field(unsigned int,		cache		)
1799549332dSDavid Howells 		    __field(int,			usage		)
1809549332dSDavid Howells 		    __field(enum fscache_cache_trace,	where		)
1819549332dSDavid Howells 			     ),
1829549332dSDavid Howells 
1839549332dSDavid Howells 	    TP_fast_assign(
1849549332dSDavid Howells 		    __entry->cache	= cache_debug_id;
1859549332dSDavid Howells 		    __entry->usage	= usage;
1869549332dSDavid Howells 		    __entry->where	= where;
1879549332dSDavid Howells 			   ),
1889549332dSDavid Howells 
1899549332dSDavid Howells 	    TP_printk("C=%08x %s r=%d",
1909549332dSDavid Howells 		      __entry->cache,
1919549332dSDavid Howells 		      __print_symbolic(__entry->where, fscache_cache_traces),
1929549332dSDavid Howells 		      __entry->usage)
1939549332dSDavid Howells 	    );
1949549332dSDavid Howells 
19562ab6335SDavid Howells TRACE_EVENT(fscache_volume,
19662ab6335SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
19762ab6335SDavid Howells 		     int usage,
19862ab6335SDavid Howells 		     enum fscache_volume_trace where),
19962ab6335SDavid Howells 
20062ab6335SDavid Howells 	    TP_ARGS(volume_debug_id, usage, where),
20162ab6335SDavid Howells 
20262ab6335SDavid Howells 	    TP_STRUCT__entry(
20362ab6335SDavid Howells 		    __field(unsigned int,		volume		)
20462ab6335SDavid Howells 		    __field(int,			usage		)
20562ab6335SDavid Howells 		    __field(enum fscache_volume_trace,	where		)
20662ab6335SDavid Howells 			     ),
20762ab6335SDavid Howells 
20862ab6335SDavid Howells 	    TP_fast_assign(
20962ab6335SDavid Howells 		    __entry->volume	= volume_debug_id;
21062ab6335SDavid Howells 		    __entry->usage	= usage;
21162ab6335SDavid Howells 		    __entry->where	= where;
21262ab6335SDavid Howells 			   ),
21362ab6335SDavid Howells 
21462ab6335SDavid Howells 	    TP_printk("V=%08x %s u=%d",
21562ab6335SDavid Howells 		      __entry->volume,
21662ab6335SDavid Howells 		      __print_symbolic(__entry->where, fscache_volume_traces),
21762ab6335SDavid Howells 		      __entry->usage)
21862ab6335SDavid Howells 	    );
21962ab6335SDavid Howells 
2207f3283abSDavid Howells TRACE_EVENT(fscache_cookie,
2217f3283abSDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
2227f3283abSDavid Howells 		     int ref,
2237f3283abSDavid Howells 		     enum fscache_cookie_trace where),
2247f3283abSDavid Howells 
2257f3283abSDavid Howells 	    TP_ARGS(cookie_debug_id, ref, where),
2267f3283abSDavid Howells 
2277f3283abSDavid Howells 	    TP_STRUCT__entry(
2287f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
2297f3283abSDavid Howells 		    __field(int,			ref		)
2307f3283abSDavid Howells 		    __field(enum fscache_cookie_trace,	where		)
2317f3283abSDavid Howells 			     ),
2327f3283abSDavid Howells 
2337f3283abSDavid Howells 	    TP_fast_assign(
2347f3283abSDavid Howells 		    __entry->cookie	= cookie_debug_id;
2357f3283abSDavid Howells 		    __entry->ref	= ref;
2367f3283abSDavid Howells 		    __entry->where	= where;
2377f3283abSDavid Howells 			   ),
2387f3283abSDavid Howells 
2397f3283abSDavid Howells 	    TP_printk("c=%08x %s r=%d",
2407f3283abSDavid Howells 		      __entry->cookie,
2417f3283abSDavid Howells 		      __print_symbolic(__entry->where, fscache_cookie_traces),
2427f3283abSDavid Howells 		      __entry->ref)
2437f3283abSDavid Howells 	    );
2447f3283abSDavid Howells 
24523e12e28SDavid Howells TRACE_EVENT(fscache_access_cache,
24623e12e28SDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
24723e12e28SDavid Howells 		     int ref,
24823e12e28SDavid Howells 		     int n_accesses,
24923e12e28SDavid Howells 		     enum fscache_access_trace why),
25023e12e28SDavid Howells 
25123e12e28SDavid Howells 	    TP_ARGS(cache_debug_id, ref, n_accesses, why),
25223e12e28SDavid Howells 
25323e12e28SDavid Howells 	    TP_STRUCT__entry(
25423e12e28SDavid Howells 		    __field(unsigned int,		cache		)
25523e12e28SDavid Howells 		    __field(int,			ref		)
25623e12e28SDavid Howells 		    __field(int,			n_accesses	)
25723e12e28SDavid Howells 		    __field(enum fscache_access_trace,	why		)
25823e12e28SDavid Howells 			     ),
25923e12e28SDavid Howells 
26023e12e28SDavid Howells 	    TP_fast_assign(
26123e12e28SDavid Howells 		    __entry->cache	= cache_debug_id;
26223e12e28SDavid Howells 		    __entry->ref	= ref;
26323e12e28SDavid Howells 		    __entry->n_accesses	= n_accesses;
26423e12e28SDavid Howells 		    __entry->why	= why;
26523e12e28SDavid Howells 			   ),
26623e12e28SDavid Howells 
26723e12e28SDavid Howells 	    TP_printk("C=%08x %s r=%d a=%d",
26823e12e28SDavid Howells 		      __entry->cache,
26923e12e28SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
27023e12e28SDavid Howells 		      __entry->ref,
27123e12e28SDavid Howells 		      __entry->n_accesses)
27223e12e28SDavid Howells 	    );
27323e12e28SDavid Howells 
274e6acd329SDavid Howells TRACE_EVENT(fscache_access_volume,
275e6acd329SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
276e6acd329SDavid Howells 		     unsigned int cookie_debug_id,
277e6acd329SDavid Howells 		     int ref,
278e6acd329SDavid Howells 		     int n_accesses,
279e6acd329SDavid Howells 		     enum fscache_access_trace why),
280e6acd329SDavid Howells 
281e6acd329SDavid Howells 	    TP_ARGS(volume_debug_id, cookie_debug_id, ref, n_accesses, why),
282e6acd329SDavid Howells 
283e6acd329SDavid Howells 	    TP_STRUCT__entry(
284e6acd329SDavid Howells 		    __field(unsigned int,		volume		)
285e6acd329SDavid Howells 		    __field(unsigned int,		cookie		)
286e6acd329SDavid Howells 		    __field(int,			ref		)
287e6acd329SDavid Howells 		    __field(int,			n_accesses	)
288e6acd329SDavid Howells 		    __field(enum fscache_access_trace,	why		)
289e6acd329SDavid Howells 			     ),
290e6acd329SDavid Howells 
291e6acd329SDavid Howells 	    TP_fast_assign(
292e6acd329SDavid Howells 		    __entry->volume	= volume_debug_id;
293e6acd329SDavid Howells 		    __entry->cookie	= cookie_debug_id;
294e6acd329SDavid Howells 		    __entry->ref	= ref;
295e6acd329SDavid Howells 		    __entry->n_accesses	= n_accesses;
296e6acd329SDavid Howells 		    __entry->why	= why;
297e6acd329SDavid Howells 			   ),
298e6acd329SDavid Howells 
299e6acd329SDavid Howells 	    TP_printk("V=%08x c=%08x %s r=%d a=%d",
300e6acd329SDavid Howells 		      __entry->volume,
301e6acd329SDavid Howells 		      __entry->cookie,
302e6acd329SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
303e6acd329SDavid Howells 		      __entry->ref,
304e6acd329SDavid Howells 		      __entry->n_accesses)
305e6acd329SDavid Howells 	    );
306e6acd329SDavid Howells 
307a7733fb6SDavid Howells TRACE_EVENT(fscache_access,
308a7733fb6SDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
309a7733fb6SDavid Howells 		     int ref,
310a7733fb6SDavid Howells 		     int n_accesses,
311a7733fb6SDavid Howells 		     enum fscache_access_trace why),
312a7733fb6SDavid Howells 
313a7733fb6SDavid Howells 	    TP_ARGS(cookie_debug_id, ref, n_accesses, why),
314a7733fb6SDavid Howells 
315a7733fb6SDavid Howells 	    TP_STRUCT__entry(
316a7733fb6SDavid Howells 		    __field(unsigned int,		cookie		)
317a7733fb6SDavid Howells 		    __field(int,			ref		)
318a7733fb6SDavid Howells 		    __field(int,			n_accesses	)
319a7733fb6SDavid Howells 		    __field(enum fscache_access_trace,	why		)
320a7733fb6SDavid Howells 			     ),
321a7733fb6SDavid Howells 
322a7733fb6SDavid Howells 	    TP_fast_assign(
323a7733fb6SDavid Howells 		    __entry->cookie	= cookie_debug_id;
324a7733fb6SDavid Howells 		    __entry->ref	= ref;
325a7733fb6SDavid Howells 		    __entry->n_accesses	= n_accesses;
326a7733fb6SDavid Howells 		    __entry->why	= why;
327a7733fb6SDavid Howells 			   ),
328a7733fb6SDavid Howells 
329a7733fb6SDavid Howells 	    TP_printk("c=%08x %s r=%d a=%d",
330a7733fb6SDavid Howells 		      __entry->cookie,
331a7733fb6SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
332a7733fb6SDavid Howells 		      __entry->ref,
333a7733fb6SDavid Howells 		      __entry->n_accesses)
334a7733fb6SDavid Howells 	    );
335a7733fb6SDavid Howells 
3367f3283abSDavid Howells TRACE_EVENT(fscache_acquire,
3377f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie),
3387f3283abSDavid Howells 
3397f3283abSDavid Howells 	    TP_ARGS(cookie),
3407f3283abSDavid Howells 
3417f3283abSDavid Howells 	    TP_STRUCT__entry(
3427f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3437f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3447f3283abSDavid Howells 		    __field(int,			v_ref		)
3457f3283abSDavid Howells 		    __field(int,			v_n_cookies	)
3467f3283abSDavid Howells 			     ),
3477f3283abSDavid Howells 
3487f3283abSDavid Howells 	    TP_fast_assign(
3497f3283abSDavid Howells 		    __entry->cookie		= cookie->debug_id;
3507f3283abSDavid Howells 		    __entry->volume		= cookie->volume->debug_id;
3517f3283abSDavid Howells 		    __entry->v_ref		= refcount_read(&cookie->volume->ref);
3527f3283abSDavid Howells 		    __entry->v_n_cookies	= atomic_read(&cookie->volume->n_cookies);
3537f3283abSDavid Howells 			   ),
3547f3283abSDavid Howells 
3557f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x vr=%d vc=%d",
3567f3283abSDavid Howells 		      __entry->cookie,
3577f3283abSDavid Howells 		      __entry->volume, __entry->v_ref, __entry->v_n_cookies)
3587f3283abSDavid Howells 	    );
3597f3283abSDavid Howells 
3607f3283abSDavid Howells TRACE_EVENT(fscache_relinquish,
3617f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie, bool retire),
3627f3283abSDavid Howells 
3637f3283abSDavid Howells 	    TP_ARGS(cookie, retire),
3647f3283abSDavid Howells 
3657f3283abSDavid Howells 	    TP_STRUCT__entry(
3667f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3677f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3687f3283abSDavid Howells 		    __field(int,			ref		)
3697f3283abSDavid Howells 		    __field(int,			n_active	)
3707f3283abSDavid Howells 		    __field(u8,				flags		)
3717f3283abSDavid Howells 		    __field(bool,			retire		)
3727f3283abSDavid Howells 			     ),
3737f3283abSDavid Howells 
3747f3283abSDavid Howells 	    TP_fast_assign(
3757f3283abSDavid Howells 		    __entry->cookie	= cookie->debug_id;
3767f3283abSDavid Howells 		    __entry->volume	= cookie->volume->debug_id;
3777f3283abSDavid Howells 		    __entry->ref	= refcount_read(&cookie->ref);
3787f3283abSDavid Howells 		    __entry->n_active	= atomic_read(&cookie->n_active);
3797f3283abSDavid Howells 		    __entry->flags	= cookie->flags;
3807f3283abSDavid Howells 		    __entry->retire	= retire;
3817f3283abSDavid Howells 			   ),
3827f3283abSDavid Howells 
3837f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x r=%d U=%d f=%02x rt=%u",
3847f3283abSDavid Howells 		      __entry->cookie, __entry->volume, __entry->ref,
3857f3283abSDavid Howells 		      __entry->n_active, __entry->flags, __entry->retire)
3867f3283abSDavid Howells 	    );
3877f3283abSDavid Howells 
3881e1236b8SDavid Howells #endif /* _TRACE_FSCACHE_H */
3891e1236b8SDavid Howells 
3901e1236b8SDavid Howells /* This part must be outside protection */
3911e1236b8SDavid Howells #include <trace/define_trace.h>
392