xref: /openbmc/linux/include/trace/events/fscache.h (revision 9af1c6c3089b294ffa240e0fbba356666698b6d0)
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,
54d24af13eSDavid Howells 	fscache_cookie_get_inval_work,
5512bb21a2SDavid Howells 	fscache_cookie_get_lru,
5612bb21a2SDavid Howells 	fscache_cookie_get_use_work,
577f3283abSDavid Howells 	fscache_cookie_new_acquire,
587f3283abSDavid Howells 	fscache_cookie_put_hash_collision,
5912bb21a2SDavid Howells 	fscache_cookie_put_lru,
607f3283abSDavid Howells 	fscache_cookie_put_over_queued,
617f3283abSDavid Howells 	fscache_cookie_put_relinquish,
627f3283abSDavid Howells 	fscache_cookie_put_withdrawn,
637f3283abSDavid Howells 	fscache_cookie_put_work,
647f3283abSDavid Howells 	fscache_cookie_see_active,
6512bb21a2SDavid Howells 	fscache_cookie_see_lru_discard,
6612bb21a2SDavid Howells 	fscache_cookie_see_lru_do_one,
677f3283abSDavid Howells 	fscache_cookie_see_relinquish,
687f3283abSDavid Howells 	fscache_cookie_see_withdraw,
697f3283abSDavid Howells 	fscache_cookie_see_work,
707f3283abSDavid Howells };
717f3283abSDavid Howells 
7223e12e28SDavid Howells enum fscache_access_trace {
73bfa22da3SDavid Howells 	fscache_access_acquire_volume,
74bfa22da3SDavid Howells 	fscache_access_acquire_volume_end,
7523e12e28SDavid Howells 	fscache_access_cache_pin,
7623e12e28SDavid Howells 	fscache_access_cache_unpin,
77d24af13eSDavid Howells 	fscache_access_invalidate_cookie,
78d24af13eSDavid Howells 	fscache_access_invalidate_cookie_end,
79d64f4554SDavid Howells 	fscache_access_io_not_live,
80d64f4554SDavid Howells 	fscache_access_io_read,
81d64f4554SDavid Howells 	fscache_access_io_wait,
82*9af1c6c3SDavid Howells 	fscache_access_io_write,
8312bb21a2SDavid Howells 	fscache_access_lookup_cookie,
845d00e426SDavid Howells 	fscache_access_lookup_cookie_end,
855d00e426SDavid Howells 	fscache_access_lookup_cookie_end_failed,
86bfa22da3SDavid Howells 	fscache_access_relinquish_volume,
87bfa22da3SDavid Howells 	fscache_access_relinquish_volume_end,
8823e12e28SDavid Howells 	fscache_access_unlive,
8923e12e28SDavid Howells };
9023e12e28SDavid Howells 
911e1236b8SDavid Howells #endif
921e1236b8SDavid Howells 
931e1236b8SDavid Howells /*
941e1236b8SDavid Howells  * Declare tracing information enums and their string mappings for display.
951e1236b8SDavid Howells  */
969549332dSDavid Howells #define fscache_cache_traces						\
979549332dSDavid Howells 	EM(fscache_cache_collision,		"*COLLIDE*")		\
989549332dSDavid Howells 	EM(fscache_cache_get_acquire,		"GET acq  ")		\
999549332dSDavid Howells 	EM(fscache_cache_new_acquire,		"NEW acq  ")		\
10062ab6335SDavid Howells 	EM(fscache_cache_put_alloc_volume,	"PUT alvol")		\
1019549332dSDavid Howells 	EM(fscache_cache_put_cache,		"PUT cache")		\
1029549332dSDavid Howells 	EM(fscache_cache_put_prep_failed,	"PUT pfail")		\
10362ab6335SDavid Howells 	EM(fscache_cache_put_relinquish,	"PUT relnq")		\
10462ab6335SDavid Howells 	E_(fscache_cache_put_volume,		"PUT vol  ")
10562ab6335SDavid Howells 
10662ab6335SDavid Howells #define fscache_volume_traces						\
10762ab6335SDavid Howells 	EM(fscache_volume_collision,		"*COLLIDE*")		\
10862ab6335SDavid Howells 	EM(fscache_volume_get_cookie,		"GET cook ")		\
10962ab6335SDavid Howells 	EM(fscache_volume_get_create_work,	"GET creat")		\
11062ab6335SDavid Howells 	EM(fscache_volume_get_hash_collision,	"GET hcoll")		\
11162ab6335SDavid Howells 	EM(fscache_volume_free,			"FREE     ")		\
11262ab6335SDavid Howells 	EM(fscache_volume_new_acquire,		"NEW acq  ")		\
11362ab6335SDavid Howells 	EM(fscache_volume_put_cookie,		"PUT cook ")		\
11462ab6335SDavid Howells 	EM(fscache_volume_put_create_work,	"PUT creat")		\
11562ab6335SDavid Howells 	EM(fscache_volume_put_hash_collision,	"PUT hcoll")		\
11662ab6335SDavid Howells 	EM(fscache_volume_put_relinquish,	"PUT relnq")		\
11762ab6335SDavid Howells 	EM(fscache_volume_see_create_work,	"SEE creat")		\
118bfa22da3SDavid Howells 	EM(fscache_volume_see_hash_wake,	"SEE hwake")		\
119bfa22da3SDavid Howells 	E_(fscache_volume_wait_create_work,	"WAIT crea")
1201e1236b8SDavid Howells 
1217f3283abSDavid Howells #define fscache_cookie_traces						\
1227f3283abSDavid Howells 	EM(fscache_cookie_collision,		"*COLLIDE*")		\
1237f3283abSDavid Howells 	EM(fscache_cookie_discard,		"DISCARD  ")		\
1247f3283abSDavid Howells 	EM(fscache_cookie_get_hash_collision,	"GET hcoll")		\
1257f3283abSDavid Howells 	EM(fscache_cookie_get_end_access,	"GQ  endac")		\
126d24af13eSDavid Howells 	EM(fscache_cookie_get_inval_work,	"GQ  inval")		\
12712bb21a2SDavid Howells 	EM(fscache_cookie_get_lru,		"GET lru  ")		\
12812bb21a2SDavid Howells 	EM(fscache_cookie_get_use_work,		"GQ  use  ")		\
1297f3283abSDavid Howells 	EM(fscache_cookie_new_acquire,		"NEW acq  ")		\
1307f3283abSDavid Howells 	EM(fscache_cookie_put_hash_collision,	"PUT hcoll")		\
13112bb21a2SDavid Howells 	EM(fscache_cookie_put_lru,		"PUT lru  ")		\
1327f3283abSDavid Howells 	EM(fscache_cookie_put_over_queued,	"PQ  overq")		\
1337f3283abSDavid Howells 	EM(fscache_cookie_put_relinquish,	"PUT relnq")		\
1347f3283abSDavid Howells 	EM(fscache_cookie_put_withdrawn,	"PUT wthdn")		\
1357f3283abSDavid Howells 	EM(fscache_cookie_put_work,		"PQ  work ")		\
1367f3283abSDavid Howells 	EM(fscache_cookie_see_active,		"-   activ")		\
13712bb21a2SDavid Howells 	EM(fscache_cookie_see_lru_discard,	"-   x-lru")		\
13812bb21a2SDavid Howells 	EM(fscache_cookie_see_lru_do_one,	"-   lrudo")		\
1397f3283abSDavid Howells 	EM(fscache_cookie_see_relinquish,	"-   x-rlq")		\
1407f3283abSDavid Howells 	EM(fscache_cookie_see_withdraw,		"-   x-wth")		\
1417f3283abSDavid Howells 	E_(fscache_cookie_see_work,		"-   work ")
1427f3283abSDavid Howells 
14323e12e28SDavid Howells #define fscache_access_traces		\
144bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume,	"BEGIN acq_vol")	\
145bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume_end,	"END   acq_vol")	\
14623e12e28SDavid Howells 	EM(fscache_access_cache_pin,		"PIN   cache  ")	\
14723e12e28SDavid Howells 	EM(fscache_access_cache_unpin,		"UNPIN cache  ")	\
148d24af13eSDavid Howells 	EM(fscache_access_invalidate_cookie,	"BEGIN inval  ")	\
149d24af13eSDavid Howells 	EM(fscache_access_invalidate_cookie_end,"END   inval  ")	\
150d64f4554SDavid Howells 	EM(fscache_access_io_not_live,		"END   io_notl")	\
151d64f4554SDavid Howells 	EM(fscache_access_io_read,		"BEGIN io_read")	\
152d64f4554SDavid Howells 	EM(fscache_access_io_wait,		"WAIT  io     ")	\
153*9af1c6c3SDavid Howells 	EM(fscache_access_io_write,		"BEGIN io_writ")	\
15412bb21a2SDavid Howells 	EM(fscache_access_lookup_cookie,	"BEGIN lookup ")	\
1555d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end,	"END   lookup ")	\
1565d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end_failed,"END   lookupf")	\
157bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume,	"BEGIN rlq_vol")	\
158bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume_end,"END   rlq_vol")	\
15923e12e28SDavid Howells 	E_(fscache_access_unlive,		"END   unlive ")
16023e12e28SDavid Howells 
1611e1236b8SDavid Howells /*
1621e1236b8SDavid Howells  * Export enum symbols via userspace.
1631e1236b8SDavid Howells  */
1641e1236b8SDavid Howells #undef EM
1651e1236b8SDavid Howells #undef E_
1661e1236b8SDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a);
1671e1236b8SDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a);
1681e1236b8SDavid Howells 
1699549332dSDavid Howells fscache_cache_traces;
17062ab6335SDavid Howells fscache_volume_traces;
1717f3283abSDavid Howells fscache_cookie_traces;
17223e12e28SDavid Howells fscache_access_traces;
1739549332dSDavid Howells 
1741e1236b8SDavid Howells /*
1751e1236b8SDavid Howells  * Now redefine the EM() and E_() macros to map the enums to the strings that
1761e1236b8SDavid Howells  * will be printed in the output.
1771e1236b8SDavid Howells  */
1781e1236b8SDavid Howells #undef EM
1791e1236b8SDavid Howells #undef E_
1801e1236b8SDavid Howells #define EM(a, b)	{ a, b },
1811e1236b8SDavid Howells #define E_(a, b)	{ a, b }
1821e1236b8SDavid Howells 
1831e1236b8SDavid Howells 
1849549332dSDavid Howells TRACE_EVENT(fscache_cache,
1859549332dSDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
1869549332dSDavid Howells 		     int usage,
1879549332dSDavid Howells 		     enum fscache_cache_trace where),
1889549332dSDavid Howells 
1899549332dSDavid Howells 	    TP_ARGS(cache_debug_id, usage, where),
1909549332dSDavid Howells 
1919549332dSDavid Howells 	    TP_STRUCT__entry(
1929549332dSDavid Howells 		    __field(unsigned int,		cache		)
1939549332dSDavid Howells 		    __field(int,			usage		)
1949549332dSDavid Howells 		    __field(enum fscache_cache_trace,	where		)
1959549332dSDavid Howells 			     ),
1969549332dSDavid Howells 
1979549332dSDavid Howells 	    TP_fast_assign(
1989549332dSDavid Howells 		    __entry->cache	= cache_debug_id;
1999549332dSDavid Howells 		    __entry->usage	= usage;
2009549332dSDavid Howells 		    __entry->where	= where;
2019549332dSDavid Howells 			   ),
2029549332dSDavid Howells 
2039549332dSDavid Howells 	    TP_printk("C=%08x %s r=%d",
2049549332dSDavid Howells 		      __entry->cache,
2059549332dSDavid Howells 		      __print_symbolic(__entry->where, fscache_cache_traces),
2069549332dSDavid Howells 		      __entry->usage)
2079549332dSDavid Howells 	    );
2089549332dSDavid Howells 
20962ab6335SDavid Howells TRACE_EVENT(fscache_volume,
21062ab6335SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
21162ab6335SDavid Howells 		     int usage,
21262ab6335SDavid Howells 		     enum fscache_volume_trace where),
21362ab6335SDavid Howells 
21462ab6335SDavid Howells 	    TP_ARGS(volume_debug_id, usage, where),
21562ab6335SDavid Howells 
21662ab6335SDavid Howells 	    TP_STRUCT__entry(
21762ab6335SDavid Howells 		    __field(unsigned int,		volume		)
21862ab6335SDavid Howells 		    __field(int,			usage		)
21962ab6335SDavid Howells 		    __field(enum fscache_volume_trace,	where		)
22062ab6335SDavid Howells 			     ),
22162ab6335SDavid Howells 
22262ab6335SDavid Howells 	    TP_fast_assign(
22362ab6335SDavid Howells 		    __entry->volume	= volume_debug_id;
22462ab6335SDavid Howells 		    __entry->usage	= usage;
22562ab6335SDavid Howells 		    __entry->where	= where;
22662ab6335SDavid Howells 			   ),
22762ab6335SDavid Howells 
22862ab6335SDavid Howells 	    TP_printk("V=%08x %s u=%d",
22962ab6335SDavid Howells 		      __entry->volume,
23062ab6335SDavid Howells 		      __print_symbolic(__entry->where, fscache_volume_traces),
23162ab6335SDavid Howells 		      __entry->usage)
23262ab6335SDavid Howells 	    );
23362ab6335SDavid Howells 
2347f3283abSDavid Howells TRACE_EVENT(fscache_cookie,
2357f3283abSDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
2367f3283abSDavid Howells 		     int ref,
2377f3283abSDavid Howells 		     enum fscache_cookie_trace where),
2387f3283abSDavid Howells 
2397f3283abSDavid Howells 	    TP_ARGS(cookie_debug_id, ref, where),
2407f3283abSDavid Howells 
2417f3283abSDavid Howells 	    TP_STRUCT__entry(
2427f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
2437f3283abSDavid Howells 		    __field(int,			ref		)
2447f3283abSDavid Howells 		    __field(enum fscache_cookie_trace,	where		)
2457f3283abSDavid Howells 			     ),
2467f3283abSDavid Howells 
2477f3283abSDavid Howells 	    TP_fast_assign(
2487f3283abSDavid Howells 		    __entry->cookie	= cookie_debug_id;
2497f3283abSDavid Howells 		    __entry->ref	= ref;
2507f3283abSDavid Howells 		    __entry->where	= where;
2517f3283abSDavid Howells 			   ),
2527f3283abSDavid Howells 
2537f3283abSDavid Howells 	    TP_printk("c=%08x %s r=%d",
2547f3283abSDavid Howells 		      __entry->cookie,
2557f3283abSDavid Howells 		      __print_symbolic(__entry->where, fscache_cookie_traces),
2567f3283abSDavid Howells 		      __entry->ref)
2577f3283abSDavid Howells 	    );
2587f3283abSDavid Howells 
25923e12e28SDavid Howells TRACE_EVENT(fscache_access_cache,
26023e12e28SDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
26123e12e28SDavid Howells 		     int ref,
26223e12e28SDavid Howells 		     int n_accesses,
26323e12e28SDavid Howells 		     enum fscache_access_trace why),
26423e12e28SDavid Howells 
26523e12e28SDavid Howells 	    TP_ARGS(cache_debug_id, ref, n_accesses, why),
26623e12e28SDavid Howells 
26723e12e28SDavid Howells 	    TP_STRUCT__entry(
26823e12e28SDavid Howells 		    __field(unsigned int,		cache		)
26923e12e28SDavid Howells 		    __field(int,			ref		)
27023e12e28SDavid Howells 		    __field(int,			n_accesses	)
27123e12e28SDavid Howells 		    __field(enum fscache_access_trace,	why		)
27223e12e28SDavid Howells 			     ),
27323e12e28SDavid Howells 
27423e12e28SDavid Howells 	    TP_fast_assign(
27523e12e28SDavid Howells 		    __entry->cache	= cache_debug_id;
27623e12e28SDavid Howells 		    __entry->ref	= ref;
27723e12e28SDavid Howells 		    __entry->n_accesses	= n_accesses;
27823e12e28SDavid Howells 		    __entry->why	= why;
27923e12e28SDavid Howells 			   ),
28023e12e28SDavid Howells 
28123e12e28SDavid Howells 	    TP_printk("C=%08x %s r=%d a=%d",
28223e12e28SDavid Howells 		      __entry->cache,
28323e12e28SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
28423e12e28SDavid Howells 		      __entry->ref,
28523e12e28SDavid Howells 		      __entry->n_accesses)
28623e12e28SDavid Howells 	    );
28723e12e28SDavid Howells 
288e6acd329SDavid Howells TRACE_EVENT(fscache_access_volume,
289e6acd329SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
290e6acd329SDavid Howells 		     unsigned int cookie_debug_id,
291e6acd329SDavid Howells 		     int ref,
292e6acd329SDavid Howells 		     int n_accesses,
293e6acd329SDavid Howells 		     enum fscache_access_trace why),
294e6acd329SDavid Howells 
295e6acd329SDavid Howells 	    TP_ARGS(volume_debug_id, cookie_debug_id, ref, n_accesses, why),
296e6acd329SDavid Howells 
297e6acd329SDavid Howells 	    TP_STRUCT__entry(
298e6acd329SDavid Howells 		    __field(unsigned int,		volume		)
299e6acd329SDavid Howells 		    __field(unsigned int,		cookie		)
300e6acd329SDavid Howells 		    __field(int,			ref		)
301e6acd329SDavid Howells 		    __field(int,			n_accesses	)
302e6acd329SDavid Howells 		    __field(enum fscache_access_trace,	why		)
303e6acd329SDavid Howells 			     ),
304e6acd329SDavid Howells 
305e6acd329SDavid Howells 	    TP_fast_assign(
306e6acd329SDavid Howells 		    __entry->volume	= volume_debug_id;
307e6acd329SDavid Howells 		    __entry->cookie	= cookie_debug_id;
308e6acd329SDavid Howells 		    __entry->ref	= ref;
309e6acd329SDavid Howells 		    __entry->n_accesses	= n_accesses;
310e6acd329SDavid Howells 		    __entry->why	= why;
311e6acd329SDavid Howells 			   ),
312e6acd329SDavid Howells 
313e6acd329SDavid Howells 	    TP_printk("V=%08x c=%08x %s r=%d a=%d",
314e6acd329SDavid Howells 		      __entry->volume,
315e6acd329SDavid Howells 		      __entry->cookie,
316e6acd329SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
317e6acd329SDavid Howells 		      __entry->ref,
318e6acd329SDavid Howells 		      __entry->n_accesses)
319e6acd329SDavid Howells 	    );
320e6acd329SDavid Howells 
321a7733fb6SDavid Howells TRACE_EVENT(fscache_access,
322a7733fb6SDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
323a7733fb6SDavid Howells 		     int ref,
324a7733fb6SDavid Howells 		     int n_accesses,
325a7733fb6SDavid Howells 		     enum fscache_access_trace why),
326a7733fb6SDavid Howells 
327a7733fb6SDavid Howells 	    TP_ARGS(cookie_debug_id, ref, n_accesses, why),
328a7733fb6SDavid Howells 
329a7733fb6SDavid Howells 	    TP_STRUCT__entry(
330a7733fb6SDavid Howells 		    __field(unsigned int,		cookie		)
331a7733fb6SDavid Howells 		    __field(int,			ref		)
332a7733fb6SDavid Howells 		    __field(int,			n_accesses	)
333a7733fb6SDavid Howells 		    __field(enum fscache_access_trace,	why		)
334a7733fb6SDavid Howells 			     ),
335a7733fb6SDavid Howells 
336a7733fb6SDavid Howells 	    TP_fast_assign(
337a7733fb6SDavid Howells 		    __entry->cookie	= cookie_debug_id;
338a7733fb6SDavid Howells 		    __entry->ref	= ref;
339a7733fb6SDavid Howells 		    __entry->n_accesses	= n_accesses;
340a7733fb6SDavid Howells 		    __entry->why	= why;
341a7733fb6SDavid Howells 			   ),
342a7733fb6SDavid Howells 
343a7733fb6SDavid Howells 	    TP_printk("c=%08x %s r=%d a=%d",
344a7733fb6SDavid Howells 		      __entry->cookie,
345a7733fb6SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
346a7733fb6SDavid Howells 		      __entry->ref,
347a7733fb6SDavid Howells 		      __entry->n_accesses)
348a7733fb6SDavid Howells 	    );
349a7733fb6SDavid Howells 
3507f3283abSDavid Howells TRACE_EVENT(fscache_acquire,
3517f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie),
3527f3283abSDavid Howells 
3537f3283abSDavid Howells 	    TP_ARGS(cookie),
3547f3283abSDavid Howells 
3557f3283abSDavid Howells 	    TP_STRUCT__entry(
3567f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3577f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3587f3283abSDavid Howells 		    __field(int,			v_ref		)
3597f3283abSDavid Howells 		    __field(int,			v_n_cookies	)
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->v_ref		= refcount_read(&cookie->volume->ref);
3667f3283abSDavid Howells 		    __entry->v_n_cookies	= atomic_read(&cookie->volume->n_cookies);
3677f3283abSDavid Howells 			   ),
3687f3283abSDavid Howells 
3697f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x vr=%d vc=%d",
3707f3283abSDavid Howells 		      __entry->cookie,
3717f3283abSDavid Howells 		      __entry->volume, __entry->v_ref, __entry->v_n_cookies)
3727f3283abSDavid Howells 	    );
3737f3283abSDavid Howells 
3747f3283abSDavid Howells TRACE_EVENT(fscache_relinquish,
3757f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie, bool retire),
3767f3283abSDavid Howells 
3777f3283abSDavid Howells 	    TP_ARGS(cookie, retire),
3787f3283abSDavid Howells 
3797f3283abSDavid Howells 	    TP_STRUCT__entry(
3807f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3817f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3827f3283abSDavid Howells 		    __field(int,			ref		)
3837f3283abSDavid Howells 		    __field(int,			n_active	)
3847f3283abSDavid Howells 		    __field(u8,				flags		)
3857f3283abSDavid Howells 		    __field(bool,			retire		)
3867f3283abSDavid Howells 			     ),
3877f3283abSDavid Howells 
3887f3283abSDavid Howells 	    TP_fast_assign(
3897f3283abSDavid Howells 		    __entry->cookie	= cookie->debug_id;
3907f3283abSDavid Howells 		    __entry->volume	= cookie->volume->debug_id;
3917f3283abSDavid Howells 		    __entry->ref	= refcount_read(&cookie->ref);
3927f3283abSDavid Howells 		    __entry->n_active	= atomic_read(&cookie->n_active);
3937f3283abSDavid Howells 		    __entry->flags	= cookie->flags;
3947f3283abSDavid Howells 		    __entry->retire	= retire;
3957f3283abSDavid Howells 			   ),
3967f3283abSDavid Howells 
3977f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x r=%d U=%d f=%02x rt=%u",
3987f3283abSDavid Howells 		      __entry->cookie, __entry->volume, __entry->ref,
3997f3283abSDavid Howells 		      __entry->n_active, __entry->flags, __entry->retire)
4007f3283abSDavid Howells 	    );
4017f3283abSDavid Howells 
402d24af13eSDavid Howells TRACE_EVENT(fscache_invalidate,
403d24af13eSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie, loff_t new_size),
404d24af13eSDavid Howells 
405d24af13eSDavid Howells 	    TP_ARGS(cookie, new_size),
406d24af13eSDavid Howells 
407d24af13eSDavid Howells 	    TP_STRUCT__entry(
408d24af13eSDavid Howells 		    __field(unsigned int,		cookie		)
409d24af13eSDavid Howells 		    __field(loff_t,			new_size	)
410d24af13eSDavid Howells 			     ),
411d24af13eSDavid Howells 
412d24af13eSDavid Howells 	    TP_fast_assign(
413d24af13eSDavid Howells 		    __entry->cookie	= cookie->debug_id;
414d24af13eSDavid Howells 		    __entry->new_size	= new_size;
415d24af13eSDavid Howells 			   ),
416d24af13eSDavid Howells 
417d24af13eSDavid Howells 	    TP_printk("c=%08x sz=%llx",
418d24af13eSDavid Howells 		      __entry->cookie, __entry->new_size)
419d24af13eSDavid Howells 	    );
420d24af13eSDavid Howells 
4211e1236b8SDavid Howells #endif /* _TRACE_FSCACHE_H */
4221e1236b8SDavid Howells 
4231e1236b8SDavid Howells /* This part must be outside protection */
4241e1236b8SDavid Howells #include <trace/define_trace.h>
425