^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* FS-Cache tracepoints
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Written by David Howells (dhowells@redhat.com)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define TRACE_SYSTEM fscache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #if !defined(_TRACE_FSCACHE_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define _TRACE_FSCACHE_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/fscache.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * Define enums for tracing information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #ifndef __FSCACHE_DECLARE_TRACE_ENUMS_ONCE_ONLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define __FSCACHE_DECLARE_TRACE_ENUMS_ONCE_ONLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) enum fscache_cookie_trace {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) fscache_cookie_collision,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) fscache_cookie_discard,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) fscache_cookie_get_acquire_parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) fscache_cookie_get_attach_object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) fscache_cookie_get_reacquire,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) fscache_cookie_get_register_netfs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) fscache_cookie_put_acquire_nobufs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) fscache_cookie_put_dup_netfs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) fscache_cookie_put_relinquish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) fscache_cookie_put_object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) fscache_cookie_put_parent,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) enum fscache_page_trace {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) fscache_page_cached,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) fscache_page_inval,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) fscache_page_maybe_release,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) fscache_page_radix_clear_store,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) fscache_page_radix_delete,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) fscache_page_radix_insert,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) fscache_page_radix_pend2store,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) fscache_page_radix_set_pend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) fscache_page_uncache,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) fscache_page_write,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) fscache_page_write_end,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) fscache_page_write_end_pend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) fscache_page_write_end_noc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) fscache_page_write_wait,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) fscache_page_trace__nr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) enum fscache_op_trace {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) fscache_op_cancel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) fscache_op_cancel_all,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) fscache_op_cancelled,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) fscache_op_completed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) fscache_op_enqueue_async,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) fscache_op_enqueue_mythread,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) fscache_op_gc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) fscache_op_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) fscache_op_put,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) fscache_op_run,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) fscache_op_signal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) fscache_op_submit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) fscache_op_submit_ex,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) fscache_op_work,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) fscache_op_trace__nr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) enum fscache_page_op_trace {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) fscache_page_op_alloc_one,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) fscache_page_op_attr_changed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) fscache_page_op_check_consistency,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) fscache_page_op_invalidate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) fscache_page_op_retr_multi,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) fscache_page_op_retr_one,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) fscache_page_op_write_one,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) fscache_page_op_trace__nr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) * Declare tracing information enums and their string mappings for display.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define fscache_cookie_traces \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) EM(fscache_cookie_collision, "*COLLISION*") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) EM(fscache_cookie_discard, "DISCARD") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) EM(fscache_cookie_get_acquire_parent, "GET prn") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) EM(fscache_cookie_get_attach_object, "GET obj") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) EM(fscache_cookie_get_reacquire, "GET raq") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) EM(fscache_cookie_get_register_netfs, "GET net") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) EM(fscache_cookie_put_acquire_nobufs, "PUT nbf") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) EM(fscache_cookie_put_dup_netfs, "PUT dnt") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) EM(fscache_cookie_put_relinquish, "PUT rlq") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) EM(fscache_cookie_put_object, "PUT obj") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) E_(fscache_cookie_put_parent, "PUT prn")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define fscache_page_traces \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) EM(fscache_page_cached, "Cached ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) EM(fscache_page_inval, "InvalPg") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) EM(fscache_page_maybe_release, "MayRels") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) EM(fscache_page_uncache, "Uncache") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) EM(fscache_page_radix_clear_store, "RxCStr ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) EM(fscache_page_radix_delete, "RxDel ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) EM(fscache_page_radix_insert, "RxIns ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) EM(fscache_page_radix_pend2store, "RxP2S ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) EM(fscache_page_radix_set_pend, "RxSPend ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) EM(fscache_page_write, "WritePg") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) EM(fscache_page_write_end, "EndPgWr") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) EM(fscache_page_write_end_pend, "EndPgWP") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) EM(fscache_page_write_end_noc, "EndPgNC") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) E_(fscache_page_write_wait, "WtOnWrt")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #define fscache_op_traces \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) EM(fscache_op_cancel, "Cancel1") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) EM(fscache_op_cancel_all, "CancelA") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) EM(fscache_op_cancelled, "Canclld") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) EM(fscache_op_completed, "Complet") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) EM(fscache_op_enqueue_async, "EnqAsyn") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) EM(fscache_op_enqueue_mythread, "EnqMyTh") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) EM(fscache_op_gc, "GC ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) EM(fscache_op_init, "Init ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) EM(fscache_op_put, "Put ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) EM(fscache_op_run, "Run ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) EM(fscache_op_signal, "Signal ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) EM(fscache_op_submit, "Submit ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) EM(fscache_op_submit_ex, "SubmitX") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) E_(fscache_op_work, "Work ")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) #define fscache_page_op_traces \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) EM(fscache_page_op_alloc_one, "Alloc1 ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) EM(fscache_page_op_attr_changed, "AttrChg") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) EM(fscache_page_op_check_consistency, "CheckCn") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) EM(fscache_page_op_invalidate, "Inval ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) EM(fscache_page_op_retr_multi, "RetrMul") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) EM(fscache_page_op_retr_one, "Retr1 ") \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) E_(fscache_page_op_write_one, "Write1 ")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) * Export enum symbols via userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) #undef EM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) #undef E_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) #define EM(a, b) TRACE_DEFINE_ENUM(a);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) #define E_(a, b) TRACE_DEFINE_ENUM(a);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) fscache_cookie_traces;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * Now redefine the EM() and E_() macros to map the enums to the strings that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * will be printed in the output.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #undef EM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #undef E_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) #define EM(a, b) { a, b },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) #define E_(a, b) { a, b }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) TRACE_EVENT(fscache_cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) TP_PROTO(struct fscache_cookie *cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) enum fscache_cookie_trace where,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) int usage),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) TP_ARGS(cookie, where, usage),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) __field(struct fscache_cookie *, parent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) __field(enum fscache_cookie_trace, where )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) __field(int, usage )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) __field(int, n_children )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) __field(int, n_active )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) __field(u8, flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) __entry->parent = cookie->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) __entry->where = where;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) __entry->usage = usage;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) __entry->n_children = atomic_read(&cookie->n_children);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) __entry->n_active = atomic_read(&cookie->n_active);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) __entry->flags = cookie->flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) TP_printk("%s c=%p u=%d p=%p Nc=%d Na=%d f=%02x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) __print_symbolic(__entry->where, fscache_cookie_traces),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) __entry->cookie, __entry->usage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) __entry->parent, __entry->n_children, __entry->n_active,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) __entry->flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) TRACE_EVENT(fscache_netfs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) TP_PROTO(struct fscache_netfs *netfs),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) TP_ARGS(netfs),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) __array(char, name, 8 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) __entry->cookie = netfs->primary_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) strncpy(__entry->name, netfs->name, 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) __entry->name[7] = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) TP_printk("c=%p n=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) __entry->cookie, __entry->name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) TRACE_EVENT(fscache_acquire,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) TP_PROTO(struct fscache_cookie *cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) TP_ARGS(cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) __field(struct fscache_cookie *, parent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) __array(char, name, 8 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) __field(int, p_usage )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) __field(int, p_n_children )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) __field(u8, p_flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) __entry->parent = cookie->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) __entry->p_usage = atomic_read(&cookie->parent->usage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) __entry->p_n_children = atomic_read(&cookie->parent->n_children);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) __entry->p_flags = cookie->parent->flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) memcpy(__entry->name, cookie->def->name, 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) __entry->name[7] = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) TP_printk("c=%p p=%p pu=%d pc=%d pf=%02x n=%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) __entry->cookie, __entry->parent, __entry->p_usage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) __entry->p_n_children, __entry->p_flags, __entry->name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) TRACE_EVENT(fscache_relinquish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) TP_PROTO(struct fscache_cookie *cookie, bool retire),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) TP_ARGS(cookie, retire),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) __field(struct fscache_cookie *, parent )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) __field(int, usage )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) __field(int, n_children )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) __field(int, n_active )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) __field(u8, flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) __field(bool, retire )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) __entry->parent = cookie->parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) __entry->usage = atomic_read(&cookie->usage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) __entry->n_children = atomic_read(&cookie->n_children);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) __entry->n_active = atomic_read(&cookie->n_active);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) __entry->flags = cookie->flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) __entry->retire = retire;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) TP_printk("c=%p u=%d p=%p Nc=%d Na=%d f=%02x r=%u",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) __entry->cookie, __entry->usage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) __entry->parent, __entry->n_children, __entry->n_active,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) __entry->flags, __entry->retire)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) TRACE_EVENT(fscache_enable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) TP_PROTO(struct fscache_cookie *cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) TP_ARGS(cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) __field(int, usage )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) __field(int, n_children )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) __field(int, n_active )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) __field(u8, flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) __entry->usage = atomic_read(&cookie->usage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) __entry->n_children = atomic_read(&cookie->n_children);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) __entry->n_active = atomic_read(&cookie->n_active);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) __entry->flags = cookie->flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) TP_printk("c=%p u=%d Nc=%d Na=%d f=%02x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) __entry->cookie, __entry->usage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) __entry->n_children, __entry->n_active, __entry->flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) TRACE_EVENT(fscache_disable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) TP_PROTO(struct fscache_cookie *cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) TP_ARGS(cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) __field(int, usage )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) __field(int, n_children )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) __field(int, n_active )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) __field(u8, flags )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) __entry->usage = atomic_read(&cookie->usage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) __entry->n_children = atomic_read(&cookie->n_children);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) __entry->n_active = atomic_read(&cookie->n_active);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) __entry->flags = cookie->flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) TP_printk("c=%p u=%d Nc=%d Na=%d f=%02x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) __entry->cookie, __entry->usage,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) __entry->n_children, __entry->n_active, __entry->flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) TRACE_EVENT(fscache_osm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) TP_PROTO(struct fscache_object *object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) const struct fscache_state *state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) bool wait, bool oob, s8 event_num),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) TP_ARGS(object, state, wait, oob, event_num),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) __field(struct fscache_object *, object )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) __array(char, state, 8 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) __field(bool, wait )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) __field(bool, oob )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) __field(s8, event_num )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) __entry->cookie = object->cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) __entry->object = object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) __entry->wait = wait;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) __entry->oob = oob;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) __entry->event_num = event_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) memcpy(__entry->state, state->short_name, 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) TP_printk("c=%p o=%p %s %s%sev=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) __entry->cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) __entry->object,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) __entry->state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) __print_symbolic(__entry->wait,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) { true, "WAIT" },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) { false, "WORK" }),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) __print_symbolic(__entry->oob,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) { true, " OOB " },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) { false, " " }),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) __entry->event_num)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) TRACE_EVENT(fscache_page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) TP_PROTO(struct fscache_cookie *cookie, struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) enum fscache_page_trace why),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) TP_ARGS(cookie, page, why),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) __field(pgoff_t, page )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) __field(enum fscache_page_trace, why )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) __entry->page = page->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) __entry->why = why;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) TP_printk("c=%p %s pg=%lx",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) __entry->cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) __print_symbolic(__entry->why, fscache_page_traces),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) __entry->page)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) TRACE_EVENT(fscache_check_page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) TP_PROTO(struct fscache_cookie *cookie, struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) void *val, int n),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) TP_ARGS(cookie, page, val, n),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) __field(void *, page )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) __field(void *, val )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) __field(int, n )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) __entry->page = page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) __entry->val = val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) __entry->n = n;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) TP_printk("c=%p pg=%p val=%p n=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) __entry->cookie, __entry->page, __entry->val, __entry->n)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) TRACE_EVENT(fscache_wake_cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) TP_PROTO(struct fscache_cookie *cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) TP_ARGS(cookie),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) TP_printk("c=%p", __entry->cookie)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) TRACE_EVENT(fscache_op,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) TP_PROTO(struct fscache_cookie *cookie, struct fscache_operation *op,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) enum fscache_op_trace why),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) TP_ARGS(cookie, op, why),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) __field(struct fscache_operation *, op )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) __field(enum fscache_op_trace, why )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) __entry->op = op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) __entry->why = why;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) TP_printk("c=%p op=%p %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) __entry->cookie, __entry->op,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) __print_symbolic(__entry->why, fscache_op_traces))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) TRACE_EVENT(fscache_page_op,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) TP_PROTO(struct fscache_cookie *cookie, struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) struct fscache_operation *op, enum fscache_page_op_trace what),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) TP_ARGS(cookie, page, op, what),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) __field(pgoff_t, page )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) __field(struct fscache_operation *, op )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) __field(enum fscache_page_op_trace, what )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) __entry->page = page ? page->index : 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) __entry->op = op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) __entry->what = what;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) TP_printk("c=%p %s pg=%lx op=%p",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) __entry->cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) __print_symbolic(__entry->what, fscache_page_op_traces),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) __entry->page, __entry->op)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) TRACE_EVENT(fscache_wrote_page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) TP_PROTO(struct fscache_cookie *cookie, struct page *page,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) struct fscache_operation *op, int ret),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) TP_ARGS(cookie, page, op, ret),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) __field(pgoff_t, page )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) __field(struct fscache_operation *, op )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) __field(int, ret )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) __entry->page = page->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) __entry->op = op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) __entry->ret = ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) TP_printk("c=%p pg=%lx op=%p ret=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) __entry->cookie, __entry->page, __entry->op, __entry->ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) TRACE_EVENT(fscache_gang_lookup,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) TP_PROTO(struct fscache_cookie *cookie, struct fscache_operation *op,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) void **results, int n, pgoff_t store_limit),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) TP_ARGS(cookie, op, results, n, store_limit),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) __field(struct fscache_cookie *, cookie )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) __field(struct fscache_operation *, op )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) __field(pgoff_t, results0 )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) __field(int, n )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) __field(pgoff_t, store_limit )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) __entry->cookie = cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) __entry->op = op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) __entry->results0 = results[0] ? ((struct page *)results[0])->index : (pgoff_t)-1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) __entry->n = n;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) __entry->store_limit = store_limit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) TP_printk("c=%p op=%p r0=%lx n=%d sl=%lx",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) __entry->cookie, __entry->op, __entry->results0, __entry->n,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) __entry->store_limit)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) #endif /* _TRACE_FSCACHE_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) #include <trace/define_trace.h>