xref: /openbmc/linux/include/trace/events/fscache.h (revision 287fd611238dd4b7e32fd3a8985aa387d26c4f29)
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,
52df98e87fSDavid Howells 	fscache_cookie_get_attach_object,
537f3283abSDavid Howells 	fscache_cookie_get_end_access,
547f3283abSDavid Howells 	fscache_cookie_get_hash_collision,
55d24af13eSDavid Howells 	fscache_cookie_get_inval_work,
5612bb21a2SDavid Howells 	fscache_cookie_get_lru,
5712bb21a2SDavid Howells 	fscache_cookie_get_use_work,
587f3283abSDavid Howells 	fscache_cookie_new_acquire,
597f3283abSDavid Howells 	fscache_cookie_put_hash_collision,
6012bb21a2SDavid Howells 	fscache_cookie_put_lru,
61df98e87fSDavid Howells 	fscache_cookie_put_object,
627f3283abSDavid Howells 	fscache_cookie_put_over_queued,
637f3283abSDavid Howells 	fscache_cookie_put_relinquish,
647f3283abSDavid Howells 	fscache_cookie_put_withdrawn,
657f3283abSDavid Howells 	fscache_cookie_put_work,
667f3283abSDavid Howells 	fscache_cookie_see_active,
6712bb21a2SDavid Howells 	fscache_cookie_see_lru_discard,
6812bb21a2SDavid Howells 	fscache_cookie_see_lru_do_one,
697f3283abSDavid Howells 	fscache_cookie_see_relinquish,
707f3283abSDavid Howells 	fscache_cookie_see_withdraw,
717f3283abSDavid Howells 	fscache_cookie_see_work,
727f3283abSDavid Howells };
737f3283abSDavid Howells 
7423e12e28SDavid Howells enum fscache_access_trace {
75bfa22da3SDavid Howells 	fscache_access_acquire_volume,
76bfa22da3SDavid Howells 	fscache_access_acquire_volume_end,
7723e12e28SDavid Howells 	fscache_access_cache_pin,
7823e12e28SDavid Howells 	fscache_access_cache_unpin,
79d24af13eSDavid Howells 	fscache_access_invalidate_cookie,
80d24af13eSDavid Howells 	fscache_access_invalidate_cookie_end,
81*287fd611SDavid Howells 	fscache_access_io_end,
82d64f4554SDavid Howells 	fscache_access_io_not_live,
83d64f4554SDavid Howells 	fscache_access_io_read,
8416a96bdfSDavid Howells 	fscache_access_io_resize,
85d64f4554SDavid Howells 	fscache_access_io_wait,
869af1c6c3SDavid Howells 	fscache_access_io_write,
8712bb21a2SDavid Howells 	fscache_access_lookup_cookie,
885d00e426SDavid Howells 	fscache_access_lookup_cookie_end,
895d00e426SDavid Howells 	fscache_access_lookup_cookie_end_failed,
90bfa22da3SDavid Howells 	fscache_access_relinquish_volume,
91bfa22da3SDavid Howells 	fscache_access_relinquish_volume_end,
9223e12e28SDavid Howells 	fscache_access_unlive,
9323e12e28SDavid Howells };
9423e12e28SDavid Howells 
951e1236b8SDavid Howells #endif
961e1236b8SDavid Howells 
971e1236b8SDavid Howells /*
981e1236b8SDavid Howells  * Declare tracing information enums and their string mappings for display.
991e1236b8SDavid Howells  */
1009549332dSDavid Howells #define fscache_cache_traces						\
1019549332dSDavid Howells 	EM(fscache_cache_collision,		"*COLLIDE*")		\
1029549332dSDavid Howells 	EM(fscache_cache_get_acquire,		"GET acq  ")		\
1039549332dSDavid Howells 	EM(fscache_cache_new_acquire,		"NEW acq  ")		\
10462ab6335SDavid Howells 	EM(fscache_cache_put_alloc_volume,	"PUT alvol")		\
1059549332dSDavid Howells 	EM(fscache_cache_put_cache,		"PUT cache")		\
1069549332dSDavid Howells 	EM(fscache_cache_put_prep_failed,	"PUT pfail")		\
10762ab6335SDavid Howells 	EM(fscache_cache_put_relinquish,	"PUT relnq")		\
10862ab6335SDavid Howells 	E_(fscache_cache_put_volume,		"PUT vol  ")
10962ab6335SDavid Howells 
11062ab6335SDavid Howells #define fscache_volume_traces						\
11162ab6335SDavid Howells 	EM(fscache_volume_collision,		"*COLLIDE*")		\
11262ab6335SDavid Howells 	EM(fscache_volume_get_cookie,		"GET cook ")		\
11362ab6335SDavid Howells 	EM(fscache_volume_get_create_work,	"GET creat")		\
11462ab6335SDavid Howells 	EM(fscache_volume_get_hash_collision,	"GET hcoll")		\
11562ab6335SDavid Howells 	EM(fscache_volume_free,			"FREE     ")		\
11662ab6335SDavid Howells 	EM(fscache_volume_new_acquire,		"NEW acq  ")		\
11762ab6335SDavid Howells 	EM(fscache_volume_put_cookie,		"PUT cook ")		\
11862ab6335SDavid Howells 	EM(fscache_volume_put_create_work,	"PUT creat")		\
11962ab6335SDavid Howells 	EM(fscache_volume_put_hash_collision,	"PUT hcoll")		\
12062ab6335SDavid Howells 	EM(fscache_volume_put_relinquish,	"PUT relnq")		\
12162ab6335SDavid Howells 	EM(fscache_volume_see_create_work,	"SEE creat")		\
122bfa22da3SDavid Howells 	EM(fscache_volume_see_hash_wake,	"SEE hwake")		\
123bfa22da3SDavid Howells 	E_(fscache_volume_wait_create_work,	"WAIT crea")
1241e1236b8SDavid Howells 
1257f3283abSDavid Howells #define fscache_cookie_traces						\
1267f3283abSDavid Howells 	EM(fscache_cookie_collision,		"*COLLIDE*")		\
1277f3283abSDavid Howells 	EM(fscache_cookie_discard,		"DISCARD  ")		\
128df98e87fSDavid Howells 	EM(fscache_cookie_get_attach_object,	"GET attch")		\
1297f3283abSDavid Howells 	EM(fscache_cookie_get_hash_collision,	"GET hcoll")		\
1307f3283abSDavid Howells 	EM(fscache_cookie_get_end_access,	"GQ  endac")		\
131d24af13eSDavid Howells 	EM(fscache_cookie_get_inval_work,	"GQ  inval")		\
13212bb21a2SDavid Howells 	EM(fscache_cookie_get_lru,		"GET lru  ")		\
13312bb21a2SDavid Howells 	EM(fscache_cookie_get_use_work,		"GQ  use  ")		\
1347f3283abSDavid Howells 	EM(fscache_cookie_new_acquire,		"NEW acq  ")		\
1357f3283abSDavid Howells 	EM(fscache_cookie_put_hash_collision,	"PUT hcoll")		\
13612bb21a2SDavid Howells 	EM(fscache_cookie_put_lru,		"PUT lru  ")		\
137df98e87fSDavid Howells 	EM(fscache_cookie_put_object,		"PUT obj  ")		\
1387f3283abSDavid Howells 	EM(fscache_cookie_put_over_queued,	"PQ  overq")		\
1397f3283abSDavid Howells 	EM(fscache_cookie_put_relinquish,	"PUT relnq")		\
1407f3283abSDavid Howells 	EM(fscache_cookie_put_withdrawn,	"PUT wthdn")		\
1417f3283abSDavid Howells 	EM(fscache_cookie_put_work,		"PQ  work ")		\
1427f3283abSDavid Howells 	EM(fscache_cookie_see_active,		"-   activ")		\
14312bb21a2SDavid Howells 	EM(fscache_cookie_see_lru_discard,	"-   x-lru")		\
14412bb21a2SDavid Howells 	EM(fscache_cookie_see_lru_do_one,	"-   lrudo")		\
1457f3283abSDavid Howells 	EM(fscache_cookie_see_relinquish,	"-   x-rlq")		\
1467f3283abSDavid Howells 	EM(fscache_cookie_see_withdraw,		"-   x-wth")		\
1477f3283abSDavid Howells 	E_(fscache_cookie_see_work,		"-   work ")
1487f3283abSDavid Howells 
14923e12e28SDavid Howells #define fscache_access_traces		\
150bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume,	"BEGIN acq_vol")	\
151bfa22da3SDavid Howells 	EM(fscache_access_acquire_volume_end,	"END   acq_vol")	\
15223e12e28SDavid Howells 	EM(fscache_access_cache_pin,		"PIN   cache  ")	\
15323e12e28SDavid Howells 	EM(fscache_access_cache_unpin,		"UNPIN cache  ")	\
154d24af13eSDavid Howells 	EM(fscache_access_invalidate_cookie,	"BEGIN inval  ")	\
155d24af13eSDavid Howells 	EM(fscache_access_invalidate_cookie_end,"END   inval  ")	\
156*287fd611SDavid Howells 	EM(fscache_access_io_end,		"END   io     ")	\
157d64f4554SDavid Howells 	EM(fscache_access_io_not_live,		"END   io_notl")	\
158d64f4554SDavid Howells 	EM(fscache_access_io_read,		"BEGIN io_read")	\
15916a96bdfSDavid Howells 	EM(fscache_access_io_resize,		"BEGIN io_resz")	\
160d64f4554SDavid Howells 	EM(fscache_access_io_wait,		"WAIT  io     ")	\
1619af1c6c3SDavid Howells 	EM(fscache_access_io_write,		"BEGIN io_writ")	\
16212bb21a2SDavid Howells 	EM(fscache_access_lookup_cookie,	"BEGIN lookup ")	\
1635d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end,	"END   lookup ")	\
1645d00e426SDavid Howells 	EM(fscache_access_lookup_cookie_end_failed,"END   lookupf")	\
165bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume,	"BEGIN rlq_vol")	\
166bfa22da3SDavid Howells 	EM(fscache_access_relinquish_volume_end,"END   rlq_vol")	\
16723e12e28SDavid Howells 	E_(fscache_access_unlive,		"END   unlive ")
16823e12e28SDavid Howells 
1691e1236b8SDavid Howells /*
1701e1236b8SDavid Howells  * Export enum symbols via userspace.
1711e1236b8SDavid Howells  */
1721e1236b8SDavid Howells #undef EM
1731e1236b8SDavid Howells #undef E_
1741e1236b8SDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a);
1751e1236b8SDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a);
1761e1236b8SDavid Howells 
1779549332dSDavid Howells fscache_cache_traces;
17862ab6335SDavid Howells fscache_volume_traces;
1797f3283abSDavid Howells fscache_cookie_traces;
18023e12e28SDavid Howells fscache_access_traces;
1819549332dSDavid Howells 
1821e1236b8SDavid Howells /*
1831e1236b8SDavid Howells  * Now redefine the EM() and E_() macros to map the enums to the strings that
1841e1236b8SDavid Howells  * will be printed in the output.
1851e1236b8SDavid Howells  */
1861e1236b8SDavid Howells #undef EM
1871e1236b8SDavid Howells #undef E_
1881e1236b8SDavid Howells #define EM(a, b)	{ a, b },
1891e1236b8SDavid Howells #define E_(a, b)	{ a, b }
1901e1236b8SDavid Howells 
1911e1236b8SDavid Howells 
1929549332dSDavid Howells TRACE_EVENT(fscache_cache,
1939549332dSDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
1949549332dSDavid Howells 		     int usage,
1959549332dSDavid Howells 		     enum fscache_cache_trace where),
1969549332dSDavid Howells 
1979549332dSDavid Howells 	    TP_ARGS(cache_debug_id, usage, where),
1989549332dSDavid Howells 
1999549332dSDavid Howells 	    TP_STRUCT__entry(
2009549332dSDavid Howells 		    __field(unsigned int,		cache		)
2019549332dSDavid Howells 		    __field(int,			usage		)
2029549332dSDavid Howells 		    __field(enum fscache_cache_trace,	where		)
2039549332dSDavid Howells 			     ),
2049549332dSDavid Howells 
2059549332dSDavid Howells 	    TP_fast_assign(
2069549332dSDavid Howells 		    __entry->cache	= cache_debug_id;
2079549332dSDavid Howells 		    __entry->usage	= usage;
2089549332dSDavid Howells 		    __entry->where	= where;
2099549332dSDavid Howells 			   ),
2109549332dSDavid Howells 
2119549332dSDavid Howells 	    TP_printk("C=%08x %s r=%d",
2129549332dSDavid Howells 		      __entry->cache,
2139549332dSDavid Howells 		      __print_symbolic(__entry->where, fscache_cache_traces),
2149549332dSDavid Howells 		      __entry->usage)
2159549332dSDavid Howells 	    );
2169549332dSDavid Howells 
21762ab6335SDavid Howells TRACE_EVENT(fscache_volume,
21862ab6335SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
21962ab6335SDavid Howells 		     int usage,
22062ab6335SDavid Howells 		     enum fscache_volume_trace where),
22162ab6335SDavid Howells 
22262ab6335SDavid Howells 	    TP_ARGS(volume_debug_id, usage, where),
22362ab6335SDavid Howells 
22462ab6335SDavid Howells 	    TP_STRUCT__entry(
22562ab6335SDavid Howells 		    __field(unsigned int,		volume		)
22662ab6335SDavid Howells 		    __field(int,			usage		)
22762ab6335SDavid Howells 		    __field(enum fscache_volume_trace,	where		)
22862ab6335SDavid Howells 			     ),
22962ab6335SDavid Howells 
23062ab6335SDavid Howells 	    TP_fast_assign(
23162ab6335SDavid Howells 		    __entry->volume	= volume_debug_id;
23262ab6335SDavid Howells 		    __entry->usage	= usage;
23362ab6335SDavid Howells 		    __entry->where	= where;
23462ab6335SDavid Howells 			   ),
23562ab6335SDavid Howells 
23662ab6335SDavid Howells 	    TP_printk("V=%08x %s u=%d",
23762ab6335SDavid Howells 		      __entry->volume,
23862ab6335SDavid Howells 		      __print_symbolic(__entry->where, fscache_volume_traces),
23962ab6335SDavid Howells 		      __entry->usage)
24062ab6335SDavid Howells 	    );
24162ab6335SDavid Howells 
2427f3283abSDavid Howells TRACE_EVENT(fscache_cookie,
2437f3283abSDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
2447f3283abSDavid Howells 		     int ref,
2457f3283abSDavid Howells 		     enum fscache_cookie_trace where),
2467f3283abSDavid Howells 
2477f3283abSDavid Howells 	    TP_ARGS(cookie_debug_id, ref, where),
2487f3283abSDavid Howells 
2497f3283abSDavid Howells 	    TP_STRUCT__entry(
2507f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
2517f3283abSDavid Howells 		    __field(int,			ref		)
2527f3283abSDavid Howells 		    __field(enum fscache_cookie_trace,	where		)
2537f3283abSDavid Howells 			     ),
2547f3283abSDavid Howells 
2557f3283abSDavid Howells 	    TP_fast_assign(
2567f3283abSDavid Howells 		    __entry->cookie	= cookie_debug_id;
2577f3283abSDavid Howells 		    __entry->ref	= ref;
2587f3283abSDavid Howells 		    __entry->where	= where;
2597f3283abSDavid Howells 			   ),
2607f3283abSDavid Howells 
2617f3283abSDavid Howells 	    TP_printk("c=%08x %s r=%d",
2627f3283abSDavid Howells 		      __entry->cookie,
2637f3283abSDavid Howells 		      __print_symbolic(__entry->where, fscache_cookie_traces),
2647f3283abSDavid Howells 		      __entry->ref)
2657f3283abSDavid Howells 	    );
2667f3283abSDavid Howells 
26723e12e28SDavid Howells TRACE_EVENT(fscache_access_cache,
26823e12e28SDavid Howells 	    TP_PROTO(unsigned int cache_debug_id,
26923e12e28SDavid Howells 		     int ref,
27023e12e28SDavid Howells 		     int n_accesses,
27123e12e28SDavid Howells 		     enum fscache_access_trace why),
27223e12e28SDavid Howells 
27323e12e28SDavid Howells 	    TP_ARGS(cache_debug_id, ref, n_accesses, why),
27423e12e28SDavid Howells 
27523e12e28SDavid Howells 	    TP_STRUCT__entry(
27623e12e28SDavid Howells 		    __field(unsigned int,		cache		)
27723e12e28SDavid Howells 		    __field(int,			ref		)
27823e12e28SDavid Howells 		    __field(int,			n_accesses	)
27923e12e28SDavid Howells 		    __field(enum fscache_access_trace,	why		)
28023e12e28SDavid Howells 			     ),
28123e12e28SDavid Howells 
28223e12e28SDavid Howells 	    TP_fast_assign(
28323e12e28SDavid Howells 		    __entry->cache	= cache_debug_id;
28423e12e28SDavid Howells 		    __entry->ref	= ref;
28523e12e28SDavid Howells 		    __entry->n_accesses	= n_accesses;
28623e12e28SDavid Howells 		    __entry->why	= why;
28723e12e28SDavid Howells 			   ),
28823e12e28SDavid Howells 
28923e12e28SDavid Howells 	    TP_printk("C=%08x %s r=%d a=%d",
29023e12e28SDavid Howells 		      __entry->cache,
29123e12e28SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
29223e12e28SDavid Howells 		      __entry->ref,
29323e12e28SDavid Howells 		      __entry->n_accesses)
29423e12e28SDavid Howells 	    );
29523e12e28SDavid Howells 
296e6acd329SDavid Howells TRACE_EVENT(fscache_access_volume,
297e6acd329SDavid Howells 	    TP_PROTO(unsigned int volume_debug_id,
298e6acd329SDavid Howells 		     unsigned int cookie_debug_id,
299e6acd329SDavid Howells 		     int ref,
300e6acd329SDavid Howells 		     int n_accesses,
301e6acd329SDavid Howells 		     enum fscache_access_trace why),
302e6acd329SDavid Howells 
303e6acd329SDavid Howells 	    TP_ARGS(volume_debug_id, cookie_debug_id, ref, n_accesses, why),
304e6acd329SDavid Howells 
305e6acd329SDavid Howells 	    TP_STRUCT__entry(
306e6acd329SDavid Howells 		    __field(unsigned int,		volume		)
307e6acd329SDavid Howells 		    __field(unsigned int,		cookie		)
308e6acd329SDavid Howells 		    __field(int,			ref		)
309e6acd329SDavid Howells 		    __field(int,			n_accesses	)
310e6acd329SDavid Howells 		    __field(enum fscache_access_trace,	why		)
311e6acd329SDavid Howells 			     ),
312e6acd329SDavid Howells 
313e6acd329SDavid Howells 	    TP_fast_assign(
314e6acd329SDavid Howells 		    __entry->volume	= volume_debug_id;
315e6acd329SDavid Howells 		    __entry->cookie	= cookie_debug_id;
316e6acd329SDavid Howells 		    __entry->ref	= ref;
317e6acd329SDavid Howells 		    __entry->n_accesses	= n_accesses;
318e6acd329SDavid Howells 		    __entry->why	= why;
319e6acd329SDavid Howells 			   ),
320e6acd329SDavid Howells 
321e6acd329SDavid Howells 	    TP_printk("V=%08x c=%08x %s r=%d a=%d",
322e6acd329SDavid Howells 		      __entry->volume,
323e6acd329SDavid Howells 		      __entry->cookie,
324e6acd329SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
325e6acd329SDavid Howells 		      __entry->ref,
326e6acd329SDavid Howells 		      __entry->n_accesses)
327e6acd329SDavid Howells 	    );
328e6acd329SDavid Howells 
329a7733fb6SDavid Howells TRACE_EVENT(fscache_access,
330a7733fb6SDavid Howells 	    TP_PROTO(unsigned int cookie_debug_id,
331a7733fb6SDavid Howells 		     int ref,
332a7733fb6SDavid Howells 		     int n_accesses,
333a7733fb6SDavid Howells 		     enum fscache_access_trace why),
334a7733fb6SDavid Howells 
335a7733fb6SDavid Howells 	    TP_ARGS(cookie_debug_id, ref, n_accesses, why),
336a7733fb6SDavid Howells 
337a7733fb6SDavid Howells 	    TP_STRUCT__entry(
338a7733fb6SDavid Howells 		    __field(unsigned int,		cookie		)
339a7733fb6SDavid Howells 		    __field(int,			ref		)
340a7733fb6SDavid Howells 		    __field(int,			n_accesses	)
341a7733fb6SDavid Howells 		    __field(enum fscache_access_trace,	why		)
342a7733fb6SDavid Howells 			     ),
343a7733fb6SDavid Howells 
344a7733fb6SDavid Howells 	    TP_fast_assign(
345a7733fb6SDavid Howells 		    __entry->cookie	= cookie_debug_id;
346a7733fb6SDavid Howells 		    __entry->ref	= ref;
347a7733fb6SDavid Howells 		    __entry->n_accesses	= n_accesses;
348a7733fb6SDavid Howells 		    __entry->why	= why;
349a7733fb6SDavid Howells 			   ),
350a7733fb6SDavid Howells 
351a7733fb6SDavid Howells 	    TP_printk("c=%08x %s r=%d a=%d",
352a7733fb6SDavid Howells 		      __entry->cookie,
353a7733fb6SDavid Howells 		      __print_symbolic(__entry->why, fscache_access_traces),
354a7733fb6SDavid Howells 		      __entry->ref,
355a7733fb6SDavid Howells 		      __entry->n_accesses)
356a7733fb6SDavid Howells 	    );
357a7733fb6SDavid Howells 
3587f3283abSDavid Howells TRACE_EVENT(fscache_acquire,
3597f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie),
3607f3283abSDavid Howells 
3617f3283abSDavid Howells 	    TP_ARGS(cookie),
3627f3283abSDavid Howells 
3637f3283abSDavid Howells 	    TP_STRUCT__entry(
3647f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3657f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3667f3283abSDavid Howells 		    __field(int,			v_ref		)
3677f3283abSDavid Howells 		    __field(int,			v_n_cookies	)
3687f3283abSDavid Howells 			     ),
3697f3283abSDavid Howells 
3707f3283abSDavid Howells 	    TP_fast_assign(
3717f3283abSDavid Howells 		    __entry->cookie		= cookie->debug_id;
3727f3283abSDavid Howells 		    __entry->volume		= cookie->volume->debug_id;
3737f3283abSDavid Howells 		    __entry->v_ref		= refcount_read(&cookie->volume->ref);
3747f3283abSDavid Howells 		    __entry->v_n_cookies	= atomic_read(&cookie->volume->n_cookies);
3757f3283abSDavid Howells 			   ),
3767f3283abSDavid Howells 
3777f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x vr=%d vc=%d",
3787f3283abSDavid Howells 		      __entry->cookie,
3797f3283abSDavid Howells 		      __entry->volume, __entry->v_ref, __entry->v_n_cookies)
3807f3283abSDavid Howells 	    );
3817f3283abSDavid Howells 
3827f3283abSDavid Howells TRACE_EVENT(fscache_relinquish,
3837f3283abSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie, bool retire),
3847f3283abSDavid Howells 
3857f3283abSDavid Howells 	    TP_ARGS(cookie, retire),
3867f3283abSDavid Howells 
3877f3283abSDavid Howells 	    TP_STRUCT__entry(
3887f3283abSDavid Howells 		    __field(unsigned int,		cookie		)
3897f3283abSDavid Howells 		    __field(unsigned int,		volume		)
3907f3283abSDavid Howells 		    __field(int,			ref		)
3917f3283abSDavid Howells 		    __field(int,			n_active	)
3927f3283abSDavid Howells 		    __field(u8,				flags		)
3937f3283abSDavid Howells 		    __field(bool,			retire		)
3947f3283abSDavid Howells 			     ),
3957f3283abSDavid Howells 
3967f3283abSDavid Howells 	    TP_fast_assign(
3977f3283abSDavid Howells 		    __entry->cookie	= cookie->debug_id;
3987f3283abSDavid Howells 		    __entry->volume	= cookie->volume->debug_id;
3997f3283abSDavid Howells 		    __entry->ref	= refcount_read(&cookie->ref);
4007f3283abSDavid Howells 		    __entry->n_active	= atomic_read(&cookie->n_active);
4017f3283abSDavid Howells 		    __entry->flags	= cookie->flags;
4027f3283abSDavid Howells 		    __entry->retire	= retire;
4037f3283abSDavid Howells 			   ),
4047f3283abSDavid Howells 
4057f3283abSDavid Howells 	    TP_printk("c=%08x V=%08x r=%d U=%d f=%02x rt=%u",
4067f3283abSDavid Howells 		      __entry->cookie, __entry->volume, __entry->ref,
4077f3283abSDavid Howells 		      __entry->n_active, __entry->flags, __entry->retire)
4087f3283abSDavid Howells 	    );
4097f3283abSDavid Howells 
410d24af13eSDavid Howells TRACE_EVENT(fscache_invalidate,
411d24af13eSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie, loff_t new_size),
412d24af13eSDavid Howells 
413d24af13eSDavid Howells 	    TP_ARGS(cookie, new_size),
414d24af13eSDavid Howells 
415d24af13eSDavid Howells 	    TP_STRUCT__entry(
416d24af13eSDavid Howells 		    __field(unsigned int,		cookie		)
417d24af13eSDavid Howells 		    __field(loff_t,			new_size	)
418d24af13eSDavid Howells 			     ),
419d24af13eSDavid Howells 
420d24af13eSDavid Howells 	    TP_fast_assign(
421d24af13eSDavid Howells 		    __entry->cookie	= cookie->debug_id;
422d24af13eSDavid Howells 		    __entry->new_size	= new_size;
423d24af13eSDavid Howells 			   ),
424d24af13eSDavid Howells 
425d24af13eSDavid Howells 	    TP_printk("c=%08x sz=%llx",
426d24af13eSDavid Howells 		      __entry->cookie, __entry->new_size)
427d24af13eSDavid Howells 	    );
428d24af13eSDavid Howells 
42916a96bdfSDavid Howells TRACE_EVENT(fscache_resize,
43016a96bdfSDavid Howells 	    TP_PROTO(struct fscache_cookie *cookie, loff_t new_size),
43116a96bdfSDavid Howells 
43216a96bdfSDavid Howells 	    TP_ARGS(cookie, new_size),
43316a96bdfSDavid Howells 
43416a96bdfSDavid Howells 	    TP_STRUCT__entry(
43516a96bdfSDavid Howells 		    __field(unsigned int,		cookie		)
43616a96bdfSDavid Howells 		    __field(loff_t,			old_size	)
43716a96bdfSDavid Howells 		    __field(loff_t,			new_size	)
43816a96bdfSDavid Howells 			     ),
43916a96bdfSDavid Howells 
44016a96bdfSDavid Howells 	    TP_fast_assign(
44116a96bdfSDavid Howells 		    __entry->cookie	= cookie->debug_id;
44216a96bdfSDavid Howells 		    __entry->old_size	= cookie->object_size;
44316a96bdfSDavid Howells 		    __entry->new_size	= new_size;
44416a96bdfSDavid Howells 			   ),
44516a96bdfSDavid Howells 
44616a96bdfSDavid Howells 	    TP_printk("c=%08x os=%08llx sz=%08llx",
44716a96bdfSDavid Howells 		      __entry->cookie,
44816a96bdfSDavid Howells 		      __entry->old_size,
44916a96bdfSDavid Howells 		      __entry->new_size)
45016a96bdfSDavid Howells 	    );
45116a96bdfSDavid Howells 
4521e1236b8SDavid Howells #endif /* _TRACE_FSCACHE_H */
4531e1236b8SDavid Howells 
4541e1236b8SDavid Howells /* This part must be outside protection */
4551e1236b8SDavid Howells #include <trace/define_trace.h>
456