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, 52*df98e87fSDavid 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, 61*df98e87fSDavid 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, 81d64f4554SDavid Howells fscache_access_io_not_live, 82d64f4554SDavid Howells fscache_access_io_read, 8316a96bdfSDavid Howells fscache_access_io_resize, 84d64f4554SDavid Howells fscache_access_io_wait, 859af1c6c3SDavid Howells fscache_access_io_write, 8612bb21a2SDavid Howells fscache_access_lookup_cookie, 875d00e426SDavid Howells fscache_access_lookup_cookie_end, 885d00e426SDavid Howells fscache_access_lookup_cookie_end_failed, 89bfa22da3SDavid Howells fscache_access_relinquish_volume, 90bfa22da3SDavid Howells fscache_access_relinquish_volume_end, 9123e12e28SDavid Howells fscache_access_unlive, 9223e12e28SDavid Howells }; 9323e12e28SDavid Howells 941e1236b8SDavid Howells #endif 951e1236b8SDavid Howells 961e1236b8SDavid Howells /* 971e1236b8SDavid Howells * Declare tracing information enums and their string mappings for display. 981e1236b8SDavid Howells */ 999549332dSDavid Howells #define fscache_cache_traces \ 1009549332dSDavid Howells EM(fscache_cache_collision, "*COLLIDE*") \ 1019549332dSDavid Howells EM(fscache_cache_get_acquire, "GET acq ") \ 1029549332dSDavid Howells EM(fscache_cache_new_acquire, "NEW acq ") \ 10362ab6335SDavid Howells EM(fscache_cache_put_alloc_volume, "PUT alvol") \ 1049549332dSDavid Howells EM(fscache_cache_put_cache, "PUT cache") \ 1059549332dSDavid Howells EM(fscache_cache_put_prep_failed, "PUT pfail") \ 10662ab6335SDavid Howells EM(fscache_cache_put_relinquish, "PUT relnq") \ 10762ab6335SDavid Howells E_(fscache_cache_put_volume, "PUT vol ") 10862ab6335SDavid Howells 10962ab6335SDavid Howells #define fscache_volume_traces \ 11062ab6335SDavid Howells EM(fscache_volume_collision, "*COLLIDE*") \ 11162ab6335SDavid Howells EM(fscache_volume_get_cookie, "GET cook ") \ 11262ab6335SDavid Howells EM(fscache_volume_get_create_work, "GET creat") \ 11362ab6335SDavid Howells EM(fscache_volume_get_hash_collision, "GET hcoll") \ 11462ab6335SDavid Howells EM(fscache_volume_free, "FREE ") \ 11562ab6335SDavid Howells EM(fscache_volume_new_acquire, "NEW acq ") \ 11662ab6335SDavid Howells EM(fscache_volume_put_cookie, "PUT cook ") \ 11762ab6335SDavid Howells EM(fscache_volume_put_create_work, "PUT creat") \ 11862ab6335SDavid Howells EM(fscache_volume_put_hash_collision, "PUT hcoll") \ 11962ab6335SDavid Howells EM(fscache_volume_put_relinquish, "PUT relnq") \ 12062ab6335SDavid Howells EM(fscache_volume_see_create_work, "SEE creat") \ 121bfa22da3SDavid Howells EM(fscache_volume_see_hash_wake, "SEE hwake") \ 122bfa22da3SDavid Howells E_(fscache_volume_wait_create_work, "WAIT crea") 1231e1236b8SDavid Howells 1247f3283abSDavid Howells #define fscache_cookie_traces \ 1257f3283abSDavid Howells EM(fscache_cookie_collision, "*COLLIDE*") \ 1267f3283abSDavid Howells EM(fscache_cookie_discard, "DISCARD ") \ 127*df98e87fSDavid Howells EM(fscache_cookie_get_attach_object, "GET attch") \ 1287f3283abSDavid Howells EM(fscache_cookie_get_hash_collision, "GET hcoll") \ 1297f3283abSDavid Howells EM(fscache_cookie_get_end_access, "GQ endac") \ 130d24af13eSDavid Howells EM(fscache_cookie_get_inval_work, "GQ inval") \ 13112bb21a2SDavid Howells EM(fscache_cookie_get_lru, "GET lru ") \ 13212bb21a2SDavid Howells EM(fscache_cookie_get_use_work, "GQ use ") \ 1337f3283abSDavid Howells EM(fscache_cookie_new_acquire, "NEW acq ") \ 1347f3283abSDavid Howells EM(fscache_cookie_put_hash_collision, "PUT hcoll") \ 13512bb21a2SDavid Howells EM(fscache_cookie_put_lru, "PUT lru ") \ 136*df98e87fSDavid Howells EM(fscache_cookie_put_object, "PUT obj ") \ 1377f3283abSDavid Howells EM(fscache_cookie_put_over_queued, "PQ overq") \ 1387f3283abSDavid Howells EM(fscache_cookie_put_relinquish, "PUT relnq") \ 1397f3283abSDavid Howells EM(fscache_cookie_put_withdrawn, "PUT wthdn") \ 1407f3283abSDavid Howells EM(fscache_cookie_put_work, "PQ work ") \ 1417f3283abSDavid Howells EM(fscache_cookie_see_active, "- activ") \ 14212bb21a2SDavid Howells EM(fscache_cookie_see_lru_discard, "- x-lru") \ 14312bb21a2SDavid Howells EM(fscache_cookie_see_lru_do_one, "- lrudo") \ 1447f3283abSDavid Howells EM(fscache_cookie_see_relinquish, "- x-rlq") \ 1457f3283abSDavid Howells EM(fscache_cookie_see_withdraw, "- x-wth") \ 1467f3283abSDavid Howells E_(fscache_cookie_see_work, "- work ") 1477f3283abSDavid Howells 14823e12e28SDavid Howells #define fscache_access_traces \ 149bfa22da3SDavid Howells EM(fscache_access_acquire_volume, "BEGIN acq_vol") \ 150bfa22da3SDavid Howells EM(fscache_access_acquire_volume_end, "END acq_vol") \ 15123e12e28SDavid Howells EM(fscache_access_cache_pin, "PIN cache ") \ 15223e12e28SDavid Howells EM(fscache_access_cache_unpin, "UNPIN cache ") \ 153d24af13eSDavid Howells EM(fscache_access_invalidate_cookie, "BEGIN inval ") \ 154d24af13eSDavid Howells EM(fscache_access_invalidate_cookie_end,"END inval ") \ 155d64f4554SDavid Howells EM(fscache_access_io_not_live, "END io_notl") \ 156d64f4554SDavid Howells EM(fscache_access_io_read, "BEGIN io_read") \ 15716a96bdfSDavid Howells EM(fscache_access_io_resize, "BEGIN io_resz") \ 158d64f4554SDavid Howells EM(fscache_access_io_wait, "WAIT io ") \ 1599af1c6c3SDavid Howells EM(fscache_access_io_write, "BEGIN io_writ") \ 16012bb21a2SDavid Howells EM(fscache_access_lookup_cookie, "BEGIN lookup ") \ 1615d00e426SDavid Howells EM(fscache_access_lookup_cookie_end, "END lookup ") \ 1625d00e426SDavid Howells EM(fscache_access_lookup_cookie_end_failed,"END lookupf") \ 163bfa22da3SDavid Howells EM(fscache_access_relinquish_volume, "BEGIN rlq_vol") \ 164bfa22da3SDavid Howells EM(fscache_access_relinquish_volume_end,"END rlq_vol") \ 16523e12e28SDavid Howells E_(fscache_access_unlive, "END unlive ") 16623e12e28SDavid Howells 1671e1236b8SDavid Howells /* 1681e1236b8SDavid Howells * Export enum symbols via userspace. 1691e1236b8SDavid Howells */ 1701e1236b8SDavid Howells #undef EM 1711e1236b8SDavid Howells #undef E_ 1721e1236b8SDavid Howells #define EM(a, b) TRACE_DEFINE_ENUM(a); 1731e1236b8SDavid Howells #define E_(a, b) TRACE_DEFINE_ENUM(a); 1741e1236b8SDavid Howells 1759549332dSDavid Howells fscache_cache_traces; 17662ab6335SDavid Howells fscache_volume_traces; 1777f3283abSDavid Howells fscache_cookie_traces; 17823e12e28SDavid Howells fscache_access_traces; 1799549332dSDavid Howells 1801e1236b8SDavid Howells /* 1811e1236b8SDavid Howells * Now redefine the EM() and E_() macros to map the enums to the strings that 1821e1236b8SDavid Howells * will be printed in the output. 1831e1236b8SDavid Howells */ 1841e1236b8SDavid Howells #undef EM 1851e1236b8SDavid Howells #undef E_ 1861e1236b8SDavid Howells #define EM(a, b) { a, b }, 1871e1236b8SDavid Howells #define E_(a, b) { a, b } 1881e1236b8SDavid Howells 1891e1236b8SDavid Howells 1909549332dSDavid Howells TRACE_EVENT(fscache_cache, 1919549332dSDavid Howells TP_PROTO(unsigned int cache_debug_id, 1929549332dSDavid Howells int usage, 1939549332dSDavid Howells enum fscache_cache_trace where), 1949549332dSDavid Howells 1959549332dSDavid Howells TP_ARGS(cache_debug_id, usage, where), 1969549332dSDavid Howells 1979549332dSDavid Howells TP_STRUCT__entry( 1989549332dSDavid Howells __field(unsigned int, cache ) 1999549332dSDavid Howells __field(int, usage ) 2009549332dSDavid Howells __field(enum fscache_cache_trace, where ) 2019549332dSDavid Howells ), 2029549332dSDavid Howells 2039549332dSDavid Howells TP_fast_assign( 2049549332dSDavid Howells __entry->cache = cache_debug_id; 2059549332dSDavid Howells __entry->usage = usage; 2069549332dSDavid Howells __entry->where = where; 2079549332dSDavid Howells ), 2089549332dSDavid Howells 2099549332dSDavid Howells TP_printk("C=%08x %s r=%d", 2109549332dSDavid Howells __entry->cache, 2119549332dSDavid Howells __print_symbolic(__entry->where, fscache_cache_traces), 2129549332dSDavid Howells __entry->usage) 2139549332dSDavid Howells ); 2149549332dSDavid Howells 21562ab6335SDavid Howells TRACE_EVENT(fscache_volume, 21662ab6335SDavid Howells TP_PROTO(unsigned int volume_debug_id, 21762ab6335SDavid Howells int usage, 21862ab6335SDavid Howells enum fscache_volume_trace where), 21962ab6335SDavid Howells 22062ab6335SDavid Howells TP_ARGS(volume_debug_id, usage, where), 22162ab6335SDavid Howells 22262ab6335SDavid Howells TP_STRUCT__entry( 22362ab6335SDavid Howells __field(unsigned int, volume ) 22462ab6335SDavid Howells __field(int, usage ) 22562ab6335SDavid Howells __field(enum fscache_volume_trace, where ) 22662ab6335SDavid Howells ), 22762ab6335SDavid Howells 22862ab6335SDavid Howells TP_fast_assign( 22962ab6335SDavid Howells __entry->volume = volume_debug_id; 23062ab6335SDavid Howells __entry->usage = usage; 23162ab6335SDavid Howells __entry->where = where; 23262ab6335SDavid Howells ), 23362ab6335SDavid Howells 23462ab6335SDavid Howells TP_printk("V=%08x %s u=%d", 23562ab6335SDavid Howells __entry->volume, 23662ab6335SDavid Howells __print_symbolic(__entry->where, fscache_volume_traces), 23762ab6335SDavid Howells __entry->usage) 23862ab6335SDavid Howells ); 23962ab6335SDavid Howells 2407f3283abSDavid Howells TRACE_EVENT(fscache_cookie, 2417f3283abSDavid Howells TP_PROTO(unsigned int cookie_debug_id, 2427f3283abSDavid Howells int ref, 2437f3283abSDavid Howells enum fscache_cookie_trace where), 2447f3283abSDavid Howells 2457f3283abSDavid Howells TP_ARGS(cookie_debug_id, ref, where), 2467f3283abSDavid Howells 2477f3283abSDavid Howells TP_STRUCT__entry( 2487f3283abSDavid Howells __field(unsigned int, cookie ) 2497f3283abSDavid Howells __field(int, ref ) 2507f3283abSDavid Howells __field(enum fscache_cookie_trace, where ) 2517f3283abSDavid Howells ), 2527f3283abSDavid Howells 2537f3283abSDavid Howells TP_fast_assign( 2547f3283abSDavid Howells __entry->cookie = cookie_debug_id; 2557f3283abSDavid Howells __entry->ref = ref; 2567f3283abSDavid Howells __entry->where = where; 2577f3283abSDavid Howells ), 2587f3283abSDavid Howells 2597f3283abSDavid Howells TP_printk("c=%08x %s r=%d", 2607f3283abSDavid Howells __entry->cookie, 2617f3283abSDavid Howells __print_symbolic(__entry->where, fscache_cookie_traces), 2627f3283abSDavid Howells __entry->ref) 2637f3283abSDavid Howells ); 2647f3283abSDavid Howells 26523e12e28SDavid Howells TRACE_EVENT(fscache_access_cache, 26623e12e28SDavid Howells TP_PROTO(unsigned int cache_debug_id, 26723e12e28SDavid Howells int ref, 26823e12e28SDavid Howells int n_accesses, 26923e12e28SDavid Howells enum fscache_access_trace why), 27023e12e28SDavid Howells 27123e12e28SDavid Howells TP_ARGS(cache_debug_id, ref, n_accesses, why), 27223e12e28SDavid Howells 27323e12e28SDavid Howells TP_STRUCT__entry( 27423e12e28SDavid Howells __field(unsigned int, cache ) 27523e12e28SDavid Howells __field(int, ref ) 27623e12e28SDavid Howells __field(int, n_accesses ) 27723e12e28SDavid Howells __field(enum fscache_access_trace, why ) 27823e12e28SDavid Howells ), 27923e12e28SDavid Howells 28023e12e28SDavid Howells TP_fast_assign( 28123e12e28SDavid Howells __entry->cache = cache_debug_id; 28223e12e28SDavid Howells __entry->ref = ref; 28323e12e28SDavid Howells __entry->n_accesses = n_accesses; 28423e12e28SDavid Howells __entry->why = why; 28523e12e28SDavid Howells ), 28623e12e28SDavid Howells 28723e12e28SDavid Howells TP_printk("C=%08x %s r=%d a=%d", 28823e12e28SDavid Howells __entry->cache, 28923e12e28SDavid Howells __print_symbolic(__entry->why, fscache_access_traces), 29023e12e28SDavid Howells __entry->ref, 29123e12e28SDavid Howells __entry->n_accesses) 29223e12e28SDavid Howells ); 29323e12e28SDavid Howells 294e6acd329SDavid Howells TRACE_EVENT(fscache_access_volume, 295e6acd329SDavid Howells TP_PROTO(unsigned int volume_debug_id, 296e6acd329SDavid Howells unsigned int cookie_debug_id, 297e6acd329SDavid Howells int ref, 298e6acd329SDavid Howells int n_accesses, 299e6acd329SDavid Howells enum fscache_access_trace why), 300e6acd329SDavid Howells 301e6acd329SDavid Howells TP_ARGS(volume_debug_id, cookie_debug_id, ref, n_accesses, why), 302e6acd329SDavid Howells 303e6acd329SDavid Howells TP_STRUCT__entry( 304e6acd329SDavid Howells __field(unsigned int, volume ) 305e6acd329SDavid Howells __field(unsigned int, cookie ) 306e6acd329SDavid Howells __field(int, ref ) 307e6acd329SDavid Howells __field(int, n_accesses ) 308e6acd329SDavid Howells __field(enum fscache_access_trace, why ) 309e6acd329SDavid Howells ), 310e6acd329SDavid Howells 311e6acd329SDavid Howells TP_fast_assign( 312e6acd329SDavid Howells __entry->volume = volume_debug_id; 313e6acd329SDavid Howells __entry->cookie = cookie_debug_id; 314e6acd329SDavid Howells __entry->ref = ref; 315e6acd329SDavid Howells __entry->n_accesses = n_accesses; 316e6acd329SDavid Howells __entry->why = why; 317e6acd329SDavid Howells ), 318e6acd329SDavid Howells 319e6acd329SDavid Howells TP_printk("V=%08x c=%08x %s r=%d a=%d", 320e6acd329SDavid Howells __entry->volume, 321e6acd329SDavid Howells __entry->cookie, 322e6acd329SDavid Howells __print_symbolic(__entry->why, fscache_access_traces), 323e6acd329SDavid Howells __entry->ref, 324e6acd329SDavid Howells __entry->n_accesses) 325e6acd329SDavid Howells ); 326e6acd329SDavid Howells 327a7733fb6SDavid Howells TRACE_EVENT(fscache_access, 328a7733fb6SDavid Howells TP_PROTO(unsigned int cookie_debug_id, 329a7733fb6SDavid Howells int ref, 330a7733fb6SDavid Howells int n_accesses, 331a7733fb6SDavid Howells enum fscache_access_trace why), 332a7733fb6SDavid Howells 333a7733fb6SDavid Howells TP_ARGS(cookie_debug_id, ref, n_accesses, why), 334a7733fb6SDavid Howells 335a7733fb6SDavid Howells TP_STRUCT__entry( 336a7733fb6SDavid Howells __field(unsigned int, cookie ) 337a7733fb6SDavid Howells __field(int, ref ) 338a7733fb6SDavid Howells __field(int, n_accesses ) 339a7733fb6SDavid Howells __field(enum fscache_access_trace, why ) 340a7733fb6SDavid Howells ), 341a7733fb6SDavid Howells 342a7733fb6SDavid Howells TP_fast_assign( 343a7733fb6SDavid Howells __entry->cookie = cookie_debug_id; 344a7733fb6SDavid Howells __entry->ref = ref; 345a7733fb6SDavid Howells __entry->n_accesses = n_accesses; 346a7733fb6SDavid Howells __entry->why = why; 347a7733fb6SDavid Howells ), 348a7733fb6SDavid Howells 349a7733fb6SDavid Howells TP_printk("c=%08x %s r=%d a=%d", 350a7733fb6SDavid Howells __entry->cookie, 351a7733fb6SDavid Howells __print_symbolic(__entry->why, fscache_access_traces), 352a7733fb6SDavid Howells __entry->ref, 353a7733fb6SDavid Howells __entry->n_accesses) 354a7733fb6SDavid Howells ); 355a7733fb6SDavid Howells 3567f3283abSDavid Howells TRACE_EVENT(fscache_acquire, 3577f3283abSDavid Howells TP_PROTO(struct fscache_cookie *cookie), 3587f3283abSDavid Howells 3597f3283abSDavid Howells TP_ARGS(cookie), 3607f3283abSDavid Howells 3617f3283abSDavid Howells TP_STRUCT__entry( 3627f3283abSDavid Howells __field(unsigned int, cookie ) 3637f3283abSDavid Howells __field(unsigned int, volume ) 3647f3283abSDavid Howells __field(int, v_ref ) 3657f3283abSDavid Howells __field(int, v_n_cookies ) 3667f3283abSDavid Howells ), 3677f3283abSDavid Howells 3687f3283abSDavid Howells TP_fast_assign( 3697f3283abSDavid Howells __entry->cookie = cookie->debug_id; 3707f3283abSDavid Howells __entry->volume = cookie->volume->debug_id; 3717f3283abSDavid Howells __entry->v_ref = refcount_read(&cookie->volume->ref); 3727f3283abSDavid Howells __entry->v_n_cookies = atomic_read(&cookie->volume->n_cookies); 3737f3283abSDavid Howells ), 3747f3283abSDavid Howells 3757f3283abSDavid Howells TP_printk("c=%08x V=%08x vr=%d vc=%d", 3767f3283abSDavid Howells __entry->cookie, 3777f3283abSDavid Howells __entry->volume, __entry->v_ref, __entry->v_n_cookies) 3787f3283abSDavid Howells ); 3797f3283abSDavid Howells 3807f3283abSDavid Howells TRACE_EVENT(fscache_relinquish, 3817f3283abSDavid Howells TP_PROTO(struct fscache_cookie *cookie, bool retire), 3827f3283abSDavid Howells 3837f3283abSDavid Howells TP_ARGS(cookie, retire), 3847f3283abSDavid Howells 3857f3283abSDavid Howells TP_STRUCT__entry( 3867f3283abSDavid Howells __field(unsigned int, cookie ) 3877f3283abSDavid Howells __field(unsigned int, volume ) 3887f3283abSDavid Howells __field(int, ref ) 3897f3283abSDavid Howells __field(int, n_active ) 3907f3283abSDavid Howells __field(u8, flags ) 3917f3283abSDavid Howells __field(bool, retire ) 3927f3283abSDavid Howells ), 3937f3283abSDavid Howells 3947f3283abSDavid Howells TP_fast_assign( 3957f3283abSDavid Howells __entry->cookie = cookie->debug_id; 3967f3283abSDavid Howells __entry->volume = cookie->volume->debug_id; 3977f3283abSDavid Howells __entry->ref = refcount_read(&cookie->ref); 3987f3283abSDavid Howells __entry->n_active = atomic_read(&cookie->n_active); 3997f3283abSDavid Howells __entry->flags = cookie->flags; 4007f3283abSDavid Howells __entry->retire = retire; 4017f3283abSDavid Howells ), 4027f3283abSDavid Howells 4037f3283abSDavid Howells TP_printk("c=%08x V=%08x r=%d U=%d f=%02x rt=%u", 4047f3283abSDavid Howells __entry->cookie, __entry->volume, __entry->ref, 4057f3283abSDavid Howells __entry->n_active, __entry->flags, __entry->retire) 4067f3283abSDavid Howells ); 4077f3283abSDavid Howells 408d24af13eSDavid Howells TRACE_EVENT(fscache_invalidate, 409d24af13eSDavid Howells TP_PROTO(struct fscache_cookie *cookie, loff_t new_size), 410d24af13eSDavid Howells 411d24af13eSDavid Howells TP_ARGS(cookie, new_size), 412d24af13eSDavid Howells 413d24af13eSDavid Howells TP_STRUCT__entry( 414d24af13eSDavid Howells __field(unsigned int, cookie ) 415d24af13eSDavid Howells __field(loff_t, new_size ) 416d24af13eSDavid Howells ), 417d24af13eSDavid Howells 418d24af13eSDavid Howells TP_fast_assign( 419d24af13eSDavid Howells __entry->cookie = cookie->debug_id; 420d24af13eSDavid Howells __entry->new_size = new_size; 421d24af13eSDavid Howells ), 422d24af13eSDavid Howells 423d24af13eSDavid Howells TP_printk("c=%08x sz=%llx", 424d24af13eSDavid Howells __entry->cookie, __entry->new_size) 425d24af13eSDavid Howells ); 426d24af13eSDavid Howells 42716a96bdfSDavid Howells TRACE_EVENT(fscache_resize, 42816a96bdfSDavid Howells TP_PROTO(struct fscache_cookie *cookie, loff_t new_size), 42916a96bdfSDavid Howells 43016a96bdfSDavid Howells TP_ARGS(cookie, new_size), 43116a96bdfSDavid Howells 43216a96bdfSDavid Howells TP_STRUCT__entry( 43316a96bdfSDavid Howells __field(unsigned int, cookie ) 43416a96bdfSDavid Howells __field(loff_t, old_size ) 43516a96bdfSDavid Howells __field(loff_t, new_size ) 43616a96bdfSDavid Howells ), 43716a96bdfSDavid Howells 43816a96bdfSDavid Howells TP_fast_assign( 43916a96bdfSDavid Howells __entry->cookie = cookie->debug_id; 44016a96bdfSDavid Howells __entry->old_size = cookie->object_size; 44116a96bdfSDavid Howells __entry->new_size = new_size; 44216a96bdfSDavid Howells ), 44316a96bdfSDavid Howells 44416a96bdfSDavid Howells TP_printk("c=%08x os=%08llx sz=%08llx", 44516a96bdfSDavid Howells __entry->cookie, 44616a96bdfSDavid Howells __entry->old_size, 44716a96bdfSDavid Howells __entry->new_size) 44816a96bdfSDavid Howells ); 44916a96bdfSDavid Howells 4501e1236b8SDavid Howells #endif /* _TRACE_FSCACHE_H */ 4511e1236b8SDavid Howells 4521e1236b8SDavid Howells /* This part must be outside protection */ 4531e1236b8SDavid Howells #include <trace/define_trace.h> 454