summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2021-12-06 15:54:04 +0000
committerDavid Howells <dhowells@redhat.com>2022-01-11 22:13:01 +0000
commite6435f1e02f410e3507f02a37c0fbb17971ddc7c (patch)
tree43f0de2be43650ee17d48abf7a337f164395ff2a /include/trace
parente0484344c0413e1fcd5642b77d49c7648fb194ec (diff)
fscache: Add a tracepoint for cookie use/unuse
Add a tracepoint to track fscache_use/unuse_cookie(). Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164021588628.640689.12942919367404043608.stgit@warthog.procyon.org.uk/ # v4
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/fscache.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/trace/events/fscache.h b/include/trace/events/fscache.h
index 1594aefadeac..cb3fb337e880 100644
--- a/include/trace/events/fscache.h
+++ b/include/trace/events/fscache.h
@@ -71,6 +71,12 @@ enum fscache_cookie_trace {
fscache_cookie_see_work,
};
+enum fscache_active_trace {
+ fscache_active_use,
+ fscache_active_use_modify,
+ fscache_active_unuse,
+};
+
enum fscache_access_trace {
fscache_access_acquire_volume,
fscache_access_acquire_volume_end,
@@ -146,6 +152,11 @@ enum fscache_access_trace {
EM(fscache_cookie_see_withdraw, "- x-wth") \
E_(fscache_cookie_see_work, "- work ")
+#define fscache_active_traces \
+ EM(fscache_active_use, "USE ") \
+ EM(fscache_active_use_modify, "USE-m ") \
+ E_(fscache_active_unuse, "UNUSE ")
+
#define fscache_access_traces \
EM(fscache_access_acquire_volume, "BEGIN acq_vol") \
EM(fscache_access_acquire_volume_end, "END acq_vol") \
@@ -264,6 +275,39 @@ TRACE_EVENT(fscache_cookie,
__entry->ref)
);
+TRACE_EVENT(fscache_active,
+ TP_PROTO(unsigned int cookie_debug_id,
+ int ref,
+ int n_active,
+ int n_accesses,
+ enum fscache_active_trace why),
+
+ TP_ARGS(cookie_debug_id, ref, n_active, n_accesses, why),
+
+ TP_STRUCT__entry(
+ __field(unsigned int, cookie )
+ __field(int, ref )
+ __field(int, n_active )
+ __field(int, n_accesses )
+ __field(enum fscache_active_trace, why )
+ ),
+
+ TP_fast_assign(
+ __entry->cookie = cookie_debug_id;
+ __entry->ref = ref;
+ __entry->n_active = n_active;
+ __entry->n_accesses = n_accesses;
+ __entry->why = why;
+ ),
+
+ TP_printk("c=%08x %s r=%d a=%d c=%d",
+ __entry->cookie,
+ __print_symbolic(__entry->why, fscache_active_traces),
+ __entry->ref,
+ __entry->n_accesses,
+ __entry->n_active)
+ );
+
TRACE_EVENT(fscache_access_cache,
TP_PROTO(unsigned int cache_debug_id,
int ref,