summaryrefslogtreecommitdiff
path: root/include/trace/events/fscache.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace/events/fscache.h')
-rw-r--r--include/trace/events/fscache.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/trace/events/fscache.h b/include/trace/events/fscache.h
index 9286e1c4b2ac..734966bc49e1 100644
--- a/include/trace/events/fscache.h
+++ b/include/trace/events/fscache.h
@@ -62,6 +62,12 @@ enum fscache_cookie_trace {
fscache_cookie_see_work,
};
+enum fscache_access_trace {
+ fscache_access_cache_pin,
+ fscache_access_cache_unpin,
+ fscache_access_unlive,
+};
+
#endif
/*
@@ -107,6 +113,11 @@ enum fscache_cookie_trace {
EM(fscache_cookie_see_withdraw, "- x-wth") \
E_(fscache_cookie_see_work, "- work ")
+#define fscache_access_traces \
+ EM(fscache_access_cache_pin, "PIN cache ") \
+ EM(fscache_access_cache_unpin, "UNPIN cache ") \
+ E_(fscache_access_unlive, "END unlive ")
+
/*
* Export enum symbols via userspace.
*/
@@ -118,6 +129,7 @@ enum fscache_cookie_trace {
fscache_cache_traces;
fscache_volume_traces;
fscache_cookie_traces;
+fscache_access_traces;
/*
* Now redefine the EM() and E_() macros to map the enums to the strings that
@@ -204,6 +216,35 @@ TRACE_EVENT(fscache_cookie,
__entry->ref)
);
+TRACE_EVENT(fscache_access_cache,
+ TP_PROTO(unsigned int cache_debug_id,
+ int ref,
+ int n_accesses,
+ enum fscache_access_trace why),
+
+ TP_ARGS(cache_debug_id, ref, n_accesses, why),
+
+ TP_STRUCT__entry(
+ __field(unsigned int, cache )
+ __field(int, ref )
+ __field(int, n_accesses )
+ __field(enum fscache_access_trace, why )
+ ),
+
+ TP_fast_assign(
+ __entry->cache = cache_debug_id;
+ __entry->ref = ref;
+ __entry->n_accesses = n_accesses;
+ __entry->why = why;
+ ),
+
+ TP_printk("C=%08x %s r=%d a=%d",
+ __entry->cache,
+ __print_symbolic(__entry->why, fscache_access_traces),
+ __entry->ref,
+ __entry->n_accesses)
+ );
+
TRACE_EVENT(fscache_acquire,
TP_PROTO(struct fscache_cookie *cookie),