VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   35 Branches   59 Tags
b24413180f560 (Greg Kroah-Hartman  2017-11-01 15:07:57 +0100   1) /* SPDX-License-Identifier: GPL-2.0 */
d0b6e04a4cd83 (Li Zefan            2009-07-13 10:33:21 +0800   2) #undef TRACE_SYSTEM
d0b6e04a4cd83 (Li Zefan            2009-07-13 10:33:21 +0800   3) #define TRACE_SYSTEM gfs2
d0b6e04a4cd83 (Li Zefan            2009-07-13 10:33:21 +0800   4) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100   5) #if !defined(_TRACE_GFS2_H) || defined(TRACE_HEADER_MULTI_READ)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100   6) #define _TRACE_GFS2_H
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100   7) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100   8) #include <linux/tracepoint.h>
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100   9) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  10) #include <linux/fs.h>
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  11) #include <linux/buffer_head.h>
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  12) #include <linux/dlmconstants.h>
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  13) #include <linux/gfs2_ondisk.h>
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100  14) #include <linux/writeback.h>
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000  15) #include <linux/ktime.h>
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500  16) #include <linux/iomap.h>
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  17) #include "incore.h"
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  18) #include "glock.h"
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  19) #include "rgrp.h"
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  20) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  21) #define dlm_state_name(nn) { DLM_LOCK_##nn, #nn }
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  22) #define glock_trace_name(x) __print_symbolic(x,		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  23) 			    dlm_state_name(IV),		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  24) 			    dlm_state_name(NL),		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  25) 			    dlm_state_name(CR),		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  26) 			    dlm_state_name(CW),		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  27) 			    dlm_state_name(PR),		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  28) 			    dlm_state_name(PW),		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  29) 			    dlm_state_name(EX))
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  30) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  31) #define block_state_name(x) __print_symbolic(x,			\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  32) 			    { GFS2_BLKST_FREE, "free" },	\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  33) 			    { GFS2_BLKST_USED, "used" },	\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  34) 			    { GFS2_BLKST_DINODE, "dinode" },	\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  35) 			    { GFS2_BLKST_UNLINKED, "unlinked" })
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  36) 
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  37) #define TRACE_RS_DELETE  0
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  38) #define TRACE_RS_TREEDEL 1
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  39) #define TRACE_RS_INSERT  2
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  40) #define TRACE_RS_CLAIM   3
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  41) 
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  42) #define rs_func_name(x) __print_symbolic(x,	\
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  43) 					 { 0, "del " },	\
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  44) 					 { 1, "tdel" },	\
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  45) 					 { 2, "ins " },	\
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  46) 					 { 3, "clm " })
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400  47) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  48) #define show_glock_flags(flags) __print_flags(flags, "",	\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  49) 	{(1UL << GLF_LOCK),			"l" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  50) 	{(1UL << GLF_DEMOTE),			"D" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  51) 	{(1UL << GLF_PENDING_DEMOTE),		"d" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  52) 	{(1UL << GLF_DEMOTE_IN_PROGRESS),	"p" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  53) 	{(1UL << GLF_DIRTY),			"y" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  54) 	{(1UL << GLF_LFLUSH),			"f" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  55) 	{(1UL << GLF_INVALIDATE_IN_PROGRESS),	"i" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  56) 	{(1UL << GLF_REPLY_PENDING),		"r" },		\
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  57) 	{(1UL << GLF_INITIAL),			"I" },		\
7b5e3d5fcf0d6 (Steven Whitehouse   2010-09-03 09:39:20 +0100  58) 	{(1UL << GLF_FROZEN),			"F" },		\
627c10b7e471b (Steven Whitehouse   2011-04-14 14:09:52 +0100  59) 	{(1UL << GLF_LRU),			"L" },		\
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000  60) 	{(1UL << GLF_OBJECT),			"o" },		\
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000  61) 	{(1UL << GLF_BLOCKING),			"b" })
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  62) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  63) #ifndef NUMPTY
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  64) #define NUMPTY
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  65) static inline u8 glock_trace_state(unsigned int state)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  66) {
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  67) 	switch(state) {
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  68) 	case LM_ST_SHARED:
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  69) 		return DLM_LOCK_PR;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  70) 	case LM_ST_DEFERRED:
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  71) 		return DLM_LOCK_CW;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  72) 	case LM_ST_EXCLUSIVE:
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  73) 		return DLM_LOCK_EX;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  74) 	}
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  75) 	return DLM_LOCK_NL;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  76) }
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  77) #endif
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  78) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  79) /* Section 1 - Locking
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  80)  *
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  81)  * Objectives:
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  82)  * Latency: Remote demote request to state change
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  83)  * Latency: Local lock request to state change
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  84)  * Latency: State change to lock grant
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  85)  * Correctness: Ordering of local lock state vs. I/O requests
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  86)  * Correctness: Responses to remote demote requests
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  87)  */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  88) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  89) /* General glock state change (DLM lock request completes) */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  90) TRACE_EVENT(gfs2_glock_state_change,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  91) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  92) 	TP_PROTO(const struct gfs2_glock *gl, unsigned int new_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  93) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  94) 	TP_ARGS(gl, new_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  95) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  96) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  97) 		__field(	dev_t,	dev			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  98) 		__field(	u64,	glnum			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100  99) 		__field(	u32,	gltype			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 100) 		__field(	u8,	cur_state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 101) 		__field(	u8,	new_state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 102) 		__field(	u8,	dmt_state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 103) 		__field(	u8,	tgt_state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 104) 		__field(	unsigned long,	flags		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 105) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 106) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 107) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 108) 		__entry->dev		= gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 109) 		__entry->glnum		= gl->gl_name.ln_number;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 110) 		__entry->gltype		= gl->gl_name.ln_type;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 111) 		__entry->cur_state	= glock_trace_state(gl->gl_state);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 112) 		__entry->new_state	= glock_trace_state(new_state);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 113) 		__entry->tgt_state	= glock_trace_state(gl->gl_target);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 114) 		__entry->dmt_state	= glock_trace_state(gl->gl_demote_state);
627c10b7e471b (Steven Whitehouse   2011-04-14 14:09:52 +0100 115) 		__entry->flags		= gl->gl_flags | (gl->gl_object ? (1UL<<GLF_OBJECT) : 0);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 116) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 117) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 118) 	TP_printk("%u,%u glock %d:%lld state %s to %s tgt:%s dmt:%s flags:%s",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 119) 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->gltype,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 120) 		 (unsigned long long)__entry->glnum,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 121) 		  glock_trace_name(__entry->cur_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 122) 		  glock_trace_name(__entry->new_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 123) 		  glock_trace_name(__entry->tgt_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 124) 		  glock_trace_name(__entry->dmt_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 125) 		  show_glock_flags(__entry->flags))
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 126) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 127) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 128) /* State change -> unlocked, glock is being deallocated */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 129) TRACE_EVENT(gfs2_glock_put,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 130) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 131) 	TP_PROTO(const struct gfs2_glock *gl),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 132) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 133) 	TP_ARGS(gl),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 134) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 135) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 136) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 137) 		__field(	u64,	glnum			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 138) 		__field(	u32,	gltype			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 139) 		__field(	u8,	cur_state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 140) 		__field(	unsigned long,	flags		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 141) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 142) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 143) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 144) 		__entry->dev		= gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 145) 		__entry->gltype		= gl->gl_name.ln_type;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 146) 		__entry->glnum		= gl->gl_name.ln_number;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 147) 		__entry->cur_state	= glock_trace_state(gl->gl_state);
627c10b7e471b (Steven Whitehouse   2011-04-14 14:09:52 +0100 148) 		__entry->flags		= gl->gl_flags  | (gl->gl_object ? (1UL<<GLF_OBJECT) : 0);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 149) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 150) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 151) 	TP_printk("%u,%u glock %d:%lld state %s => %s flags:%s",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 152) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 153)                   __entry->gltype, (unsigned long long)__entry->glnum,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 154)                   glock_trace_name(__entry->cur_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 155) 		  glock_trace_name(DLM_LOCK_IV),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 156) 		  show_glock_flags(__entry->flags))
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 157) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 158) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 159) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 160) /* Callback (local or remote) requesting lock demotion */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 161) TRACE_EVENT(gfs2_demote_rq,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 162) 
7bd8b2eb32c40 (Steven Whitehouse   2013-04-10 10:32:05 +0100 163) 	TP_PROTO(const struct gfs2_glock *gl, bool remote),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 164) 
7bd8b2eb32c40 (Steven Whitehouse   2013-04-10 10:32:05 +0100 165) 	TP_ARGS(gl, remote),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 166) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 167) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 168) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 169) 		__field(	u64,	glnum			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 170) 		__field(	u32,	gltype			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 171) 		__field(	u8,	cur_state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 172) 		__field(	u8,	dmt_state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 173) 		__field(	unsigned long,	flags		)
7bd8b2eb32c40 (Steven Whitehouse   2013-04-10 10:32:05 +0100 174) 		__field(	bool,	remote			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 175) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 176) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 177) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 178) 		__entry->dev		= gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 179) 		__entry->gltype		= gl->gl_name.ln_type;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 180) 		__entry->glnum		= gl->gl_name.ln_number;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 181) 		__entry->cur_state	= glock_trace_state(gl->gl_state);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 182) 		__entry->dmt_state	= glock_trace_state(gl->gl_demote_state);
627c10b7e471b (Steven Whitehouse   2011-04-14 14:09:52 +0100 183) 		__entry->flags		= gl->gl_flags  | (gl->gl_object ? (1UL<<GLF_OBJECT) : 0);
7bd8b2eb32c40 (Steven Whitehouse   2013-04-10 10:32:05 +0100 184) 		__entry->remote		= remote;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 185) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 186) 
7bd8b2eb32c40 (Steven Whitehouse   2013-04-10 10:32:05 +0100 187) 	TP_printk("%u,%u glock %d:%lld demote %s to %s flags:%s %s",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 188) 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->gltype,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 189) 		  (unsigned long long)__entry->glnum,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 190)                   glock_trace_name(__entry->cur_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 191)                   glock_trace_name(__entry->dmt_state),
7bd8b2eb32c40 (Steven Whitehouse   2013-04-10 10:32:05 +0100 192) 		  show_glock_flags(__entry->flags),
7bd8b2eb32c40 (Steven Whitehouse   2013-04-10 10:32:05 +0100 193) 		  __entry->remote ? "remote" : "local")
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 194) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 195) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 196) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 197) /* Promotion/grant of a glock */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 198) TRACE_EVENT(gfs2_promote,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 199) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 200) 	TP_PROTO(const struct gfs2_holder *gh, int first),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 201) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 202) 	TP_ARGS(gh, first),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 203) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 204) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 205) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 206) 		__field(	u64,	glnum			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 207) 		__field(	u32,	gltype			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 208) 		__field(	int,	first			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 209) 		__field(	u8,	state			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 210) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 211) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 212) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 213) 		__entry->dev	= gh->gh_gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 214) 		__entry->glnum	= gh->gh_gl->gl_name.ln_number;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 215) 		__entry->gltype	= gh->gh_gl->gl_name.ln_type;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 216) 		__entry->first	= first;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 217) 		__entry->state	= glock_trace_state(gh->gh_state);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 218) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 219) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 220) 	TP_printk("%u,%u glock %u:%llu promote %s %s",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 221) 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->gltype,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 222) 		  (unsigned long long)__entry->glnum,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 223) 		  __entry->first ? "first": "other",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 224) 		  glock_trace_name(__entry->state))
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 225) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 226) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 227) /* Queue/dequeue a lock request */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 228) TRACE_EVENT(gfs2_glock_queue,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 229) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 230) 	TP_PROTO(const struct gfs2_holder *gh, int queue),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 231) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 232) 	TP_ARGS(gh, queue),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 233) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 234) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 235) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 236) 		__field(	u64,	glnum			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 237) 		__field(	u32,	gltype			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 238) 		__field(	int,	queue			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 239) 		__field(	u8,	state			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 240) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 241) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 242) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 243) 		__entry->dev	= gh->gh_gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 244) 		__entry->glnum	= gh->gh_gl->gl_name.ln_number;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 245) 		__entry->gltype	= gh->gh_gl->gl_name.ln_type;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 246) 		__entry->queue	= queue;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 247) 		__entry->state	= glock_trace_state(gh->gh_state);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 248) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 249) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 250) 	TP_printk("%u,%u glock %u:%llu %squeue %s",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 251) 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->gltype,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 252) 		  (unsigned long long)__entry->glnum,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 253) 		  __entry->queue ? "" : "de",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 254) 		  glock_trace_name(__entry->state))
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 255) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 256) 
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 257) /* DLM sends a reply to GFS2 */
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 258) TRACE_EVENT(gfs2_glock_lock_time,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 259) 
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 260) 	TP_PROTO(const struct gfs2_glock *gl, s64 tdiff),
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 261) 
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 262) 	TP_ARGS(gl, tdiff),
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 263) 
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 264) 	TP_STRUCT__entry(
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 265) 		__field(	dev_t,	dev		)
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 266) 		__field(	u64,	glnum		)
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 267) 		__field(	u32,	gltype		)
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 268) 		__field(	int,	status		)
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 269) 		__field(	char,	flags		)
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 270) 		__field(	s64,	tdiff		)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 271) 		__field(	u64,	srtt		)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 272) 		__field(	u64,	srttvar		)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 273) 		__field(	u64,	srttb		)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 274) 		__field(	u64,	srttvarb	)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 275) 		__field(	u64,	sirt		)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 276) 		__field(	u64,	sirtvar		)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 277) 		__field(	u64,	dcount		)
4d207133e9c36 (Ben Hutchings       2015-08-27 12:51:45 -0500 278) 		__field(	u64,	qcount		)
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 279) 	),
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 280) 
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 281) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 282) 		__entry->dev            = gl->gl_name.ln_sbd->sd_vfs->s_dev;
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 283) 		__entry->glnum          = gl->gl_name.ln_number;
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 284) 		__entry->gltype         = gl->gl_name.ln_type;
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 285) 		__entry->status		= gl->gl_lksb.sb_status;
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 286) 		__entry->flags		= gl->gl_lksb.sb_flags;
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 287) 		__entry->tdiff		= tdiff;
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 288) 		__entry->srtt		= gl->gl_stats.stats[GFS2_LKS_SRTT];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 289) 		__entry->srttvar	= gl->gl_stats.stats[GFS2_LKS_SRTTVAR];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 290) 		__entry->srttb		= gl->gl_stats.stats[GFS2_LKS_SRTTB];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 291) 		__entry->srttvarb	= gl->gl_stats.stats[GFS2_LKS_SRTTVARB];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 292) 		__entry->sirt		= gl->gl_stats.stats[GFS2_LKS_SIRT];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 293) 		__entry->sirtvar	= gl->gl_stats.stats[GFS2_LKS_SIRTVAR];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 294) 		__entry->dcount		= gl->gl_stats.stats[GFS2_LKS_DCOUNT];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 295) 		__entry->qcount		= gl->gl_stats.stats[GFS2_LKS_QCOUNT];
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 296) 	),
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 297) 
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 298) 	TP_printk("%u,%u glock %d:%lld status:%d flags:%02x tdiff:%lld srtt:%lld/%lld srttb:%lld/%lld sirt:%lld/%lld dcnt:%lld qcnt:%lld",
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 299) 		  MAJOR(__entry->dev), MINOR(__entry->dev), __entry->gltype,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 300) 		  (unsigned long long)__entry->glnum,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 301) 		  __entry->status, __entry->flags,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 302) 		  (long long)__entry->tdiff,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 303) 		  (long long)__entry->srtt,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 304) 		  (long long)__entry->srttvar,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 305) 		  (long long)__entry->srttb,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 306) 		  (long long)__entry->srttvarb,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 307) 		  (long long)__entry->sirt,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 308) 		  (long long)__entry->sirtvar,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 309) 		  (long long)__entry->dcount,
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 310) 		  (long long)__entry->qcount)
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 311) );
a245769f254bb (Steven Whitehouse   2012-01-20 10:38:36 +0000 312) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 313) /* Section 2 - Log/journal
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 314)  *
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 315)  * Objectives:
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 316)  * Latency: Log flush time
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 317)  * Correctness: pin/unpin vs. disk I/O ordering
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 318)  * Performance: Log usage stats
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 319)  */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 320) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 321) /* Pin/unpin a block in the log */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 322) TRACE_EVENT(gfs2_pin,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 323) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 324) 	TP_PROTO(const struct gfs2_bufdata *bd, int pin),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 325) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 326) 	TP_ARGS(bd, pin),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 327) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 328) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 329) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 330) 		__field(	int,	pin			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 331) 		__field(	u32,	len			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 332) 		__field(	sector_t,	block		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 333) 		__field(	u64,	ino			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 334) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 335) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 336) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 337) 		__entry->dev		= bd->bd_gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 338) 		__entry->pin		= pin;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 339) 		__entry->len		= bd->bd_bh->b_size;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 340) 		__entry->block		= bd->bd_bh->b_blocknr;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 341) 		__entry->ino		= bd->bd_gl->gl_name.ln_number;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 342) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 343) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 344) 	TP_printk("%u,%u log %s %llu/%lu inode %llu",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 345) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 346) 		  __entry->pin ? "pin" : "unpin",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 347) 		  (unsigned long long)__entry->block,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 348) 		  (unsigned long)__entry->len,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 349) 		  (unsigned long long)__entry->ino)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 350) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 351) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 352) /* Flushing the log */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 353) TRACE_EVENT(gfs2_log_flush,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 354) 
805c090750a31 (Bob Peterson        2018-01-08 10:34:17 -0500 355) 	TP_PROTO(const struct gfs2_sbd *sdp, int start, u32 flags),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 356) 
805c090750a31 (Bob Peterson        2018-01-08 10:34:17 -0500 357) 	TP_ARGS(sdp, start, flags),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 358) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 359) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 360) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 361) 		__field(	int,	start			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 362) 		__field(	u64,	log_seq			)
805c090750a31 (Bob Peterson        2018-01-08 10:34:17 -0500 363) 		__field(	u32,	flags			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 364) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 365) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 366) 	TP_fast_assign(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 367) 		__entry->dev            = sdp->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 368) 		__entry->start		= start;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 369) 		__entry->log_seq	= sdp->sd_log_sequence;
805c090750a31 (Bob Peterson        2018-01-08 10:34:17 -0500 370) 		__entry->flags		= flags;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 371) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 372) 
805c090750a31 (Bob Peterson        2018-01-08 10:34:17 -0500 373) 	TP_printk("%u,%u log flush %s %llu %llx",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 374) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 375) 		  __entry->start ? "start" : "end",
805c090750a31 (Bob Peterson        2018-01-08 10:34:17 -0500 376) 		  (unsigned long long)__entry->log_seq,
805c090750a31 (Bob Peterson        2018-01-08 10:34:17 -0500 377) 		  (unsigned long long)__entry->flags)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 378) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 379) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 380) /* Reserving/releasing blocks in the log */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 381) TRACE_EVENT(gfs2_log_blocks,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 382) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 383) 	TP_PROTO(const struct gfs2_sbd *sdp, int blocks),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 384) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 385) 	TP_ARGS(sdp, blocks),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 386) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 387) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 388) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 389) 		__field(	int,	blocks			)
97c5e43d51a44 (Bob Peterson        2020-08-20 08:59:28 -0500 390) 		__field(	int,	blks_free		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 391) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 392) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 393) 	TP_fast_assign(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 394) 		__entry->dev		= sdp->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 395) 		__entry->blocks		= blocks;
97c5e43d51a44 (Bob Peterson        2020-08-20 08:59:28 -0500 396) 		__entry->blks_free	= atomic_read(&sdp->sd_log_blks_free);
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 397) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 398) 
97c5e43d51a44 (Bob Peterson        2020-08-20 08:59:28 -0500 399) 	TP_printk("%u,%u log reserve %d %d", MAJOR(__entry->dev),
97c5e43d51a44 (Bob Peterson        2020-08-20 08:59:28 -0500 400) 		  MINOR(__entry->dev), __entry->blocks, __entry->blks_free)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 401) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 402) 
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 403) /* Writing back the AIL */
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 404) TRACE_EVENT(gfs2_ail_flush,
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 405) 
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 406) 	TP_PROTO(const struct gfs2_sbd *sdp, const struct writeback_control *wbc, int start),
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 407) 
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 408) 	TP_ARGS(sdp, wbc, start),
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 409) 
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 410) 	TP_STRUCT__entry(
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 411) 		__field(	dev_t,	dev			)
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 412) 		__field(	int, start			)
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 413) 		__field(	int, sync_mode			)
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 414) 		__field(	long, nr_to_write		)
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 415) 	),
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 416) 
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 417) 	TP_fast_assign(
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 418) 		__entry->dev		= sdp->sd_vfs->s_dev;
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 419) 		__entry->start		= start;
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 420) 		__entry->sync_mode	= wbc->sync_mode;
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 421) 		__entry->nr_to_write	= wbc->nr_to_write;
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 422) 	),
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 423) 
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 424) 	TP_printk("%u,%u ail flush %s %s %ld", MAJOR(__entry->dev),
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 425) 		  MINOR(__entry->dev), __entry->start ? "start" : "end",
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 426) 		  __entry->sync_mode == WB_SYNC_ALL ? "all" : "none",
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 427) 		  __entry->nr_to_write)
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 428) );
c83ae9cad8776 (Steven Whitehouse   2011-04-18 14:18:38 +0100 429) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 430) /* Section 3 - bmap
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 431)  *
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 432)  * Objectives:
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 433)  * Latency: Bmap request time
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 434)  * Performance: Block allocator tracing
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 435)  * Correctness: Test of disard generation vs. blocks allocated
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 436)  */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 437) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 438) /* Map an extent of blocks, possibly a new allocation */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 439) TRACE_EVENT(gfs2_bmap,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 440) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 441) 	TP_PROTO(const struct gfs2_inode *ip, const struct buffer_head *bh,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 442) 		sector_t lblock, int create, int errno),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 443) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 444) 	TP_ARGS(ip, bh, lblock, create, errno),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 445) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 446) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 447) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 448) 		__field(	sector_t, lblock		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 449) 		__field(	sector_t, pblock		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 450) 		__field(	u64,	inum			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 451) 		__field(	unsigned long, state		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 452) 		__field(	u32,	len			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 453) 		__field(	int,	create			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 454) 		__field(	int,	errno			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 455) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 456) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 457) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 458) 		__entry->dev            = ip->i_gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 459) 		__entry->lblock		= lblock;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 460) 		__entry->pblock		= buffer_mapped(bh) ?  bh->b_blocknr : 0;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 461) 		__entry->inum		= ip->i_no_addr;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 462) 		__entry->state		= bh->b_state;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 463) 		__entry->len		= bh->b_size;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 464) 		__entry->create		= create;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 465) 		__entry->errno		= errno;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 466) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 467) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 468) 	TP_printk("%u,%u bmap %llu map %llu/%lu to %llu flags:%08lx %s %d",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 469) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 470) 		  (unsigned long long)__entry->inum,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 471) 		  (unsigned long long)__entry->lblock,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 472) 		  (unsigned long)__entry->len,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 473) 		  (unsigned long long)__entry->pblock,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 474) 		  __entry->state, __entry->create ? "create " : "nocreate",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 475) 		  __entry->errno)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 476) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 477) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 478) TRACE_EVENT(gfs2_iomap_start,
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 479) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 480) 	TP_PROTO(const struct gfs2_inode *ip, loff_t pos, ssize_t length,
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 481) 		 u16 flags),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 482) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 483) 	TP_ARGS(ip, pos, length, flags),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 484) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 485) 	TP_STRUCT__entry(
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 486) 		__field(        dev_t,  dev                     )
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 487) 		__field(	u64,	inum			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 488) 		__field(	loff_t, pos			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 489) 		__field(	ssize_t, length			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 490) 		__field(	u16,	flags			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 491) 	),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 492) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 493) 	TP_fast_assign(
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 494) 		__entry->dev            = ip->i_gl->gl_name.ln_sbd->sd_vfs->s_dev;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 495) 		__entry->inum		= ip->i_no_addr;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 496) 		__entry->pos		= pos;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 497) 		__entry->length		= length;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 498) 		__entry->flags		= flags;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 499) 	),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 500) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 501) 	TP_printk("%u,%u bmap %llu iomap start %llu/%lu flags:%08x",
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 502) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 503) 		  (unsigned long long)__entry->inum,
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 504) 		  (unsigned long long)__entry->pos,
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 505) 		  (unsigned long)__entry->length, (u16)__entry->flags)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 506) );
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 507) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 508) TRACE_EVENT(gfs2_iomap_end,
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 509) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 510) 	TP_PROTO(const struct gfs2_inode *ip, struct iomap *iomap, int ret),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 511) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 512) 	TP_ARGS(ip, iomap, ret),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 513) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 514) 	TP_STRUCT__entry(
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 515) 		__field(        dev_t,  dev                     )
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 516) 		__field(	u64,	inum			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 517) 		__field(	loff_t, offset			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 518) 		__field(	ssize_t, length			)
ee6ed857c8058 (Andreas Gruenbacher 2018-03-15 07:17:17 -0700 519) 		__field(	sector_t, pblock		)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 520) 		__field(	u16,	flags			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 521) 		__field(	u16,	type			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 522) 		__field(	int,	ret			)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 523) 	),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 524) 
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 525) 	TP_fast_assign(
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 526) 		__entry->dev            = ip->i_gl->gl_name.ln_sbd->sd_vfs->s_dev;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 527) 		__entry->inum		= ip->i_no_addr;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 528) 		__entry->offset		= iomap->offset;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 529) 		__entry->length		= iomap->length;
ee6ed857c8058 (Andreas Gruenbacher 2018-03-15 07:17:17 -0700 530) 		__entry->pblock		= iomap->addr == IOMAP_NULL_ADDR ? 0 :
ee6ed857c8058 (Andreas Gruenbacher 2018-03-15 07:17:17 -0700 531) 					 (iomap->addr >> ip->i_inode.i_blkbits);
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 532) 		__entry->flags		= iomap->flags;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 533) 		__entry->type		= iomap->type;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 534) 		__entry->ret		= ret;
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 535) 	),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 536) 
ee6ed857c8058 (Andreas Gruenbacher 2018-03-15 07:17:17 -0700 537) 	TP_printk("%u,%u bmap %llu iomap end %llu/%lu to %llu ty:%d flags:%08x rc:%d",
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 538) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 539) 		  (unsigned long long)__entry->inum,
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 540) 		  (unsigned long long)__entry->offset,
ee6ed857c8058 (Andreas Gruenbacher 2018-03-15 07:17:17 -0700 541) 		  (unsigned long)__entry->length,
ee6ed857c8058 (Andreas Gruenbacher 2018-03-15 07:17:17 -0700 542) 		  (long long)__entry->pblock,
ee6ed857c8058 (Andreas Gruenbacher 2018-03-15 07:17:17 -0700 543) 		  (u16)__entry->type,
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 544) 		  (u16)__entry->flags, __entry->ret)
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 545) );
3974320ca6aa6 (Bob Peterson        2017-02-16 10:27:16 -0500 546) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 547) /* Keep track of blocks as they are allocated/freed */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 548) TRACE_EVENT(gfs2_block_alloc,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 549) 
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 550) 	TP_PROTO(const struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 551) 		 u64 block, unsigned len, u8 block_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 552) 
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 553) 	TP_ARGS(ip, rgd, block, len, block_state),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 554) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 555) 	TP_STRUCT__entry(
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 556) 		__field(        dev_t,  dev                     )
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 557) 		__field(	u64,	start			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 558) 		__field(	u64,	inum			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 559) 		__field(	u32,	len			)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 560) 		__field(	u8,	block_state		)
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 561) 		__field(        u64,	rd_addr			)
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 562) 		__field(        u32,	rd_free_clone		)
07974d2a2a98b (Andreas Gruenbacher 2020-10-22 20:34:29 +0200 563) 		__field(	u32,	rd_requested		)
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 564) 		__field(	u32,	rd_reserved		)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 565) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 566) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 567) 	TP_fast_assign(
15562c439d0a1 (Bob Peterson        2015-03-16 11:52:05 -0500 568) 		__entry->dev		= rgd->rd_gl->gl_name.ln_sbd->sd_vfs->s_dev;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 569) 		__entry->start		= block;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 570) 		__entry->inum		= ip->i_no_addr;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 571) 		__entry->len		= len;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 572) 		__entry->block_state	= block_state;
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 573) 		__entry->rd_addr	= rgd->rd_addr;
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 574) 		__entry->rd_free_clone	= rgd->rd_free_clone;
07974d2a2a98b (Andreas Gruenbacher 2020-10-22 20:34:29 +0200 575) 		__entry->rd_requested	= rgd->rd_requested;
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 576) 		__entry->rd_reserved	= rgd->rd_reserved;
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 577) 	),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 578) 
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 579) 	TP_printk("%u,%u bmap %llu alloc %llu/%lu %s rg:%llu rf:%u rq:%u rr:%u",
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 580) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 581) 		  (unsigned long long)__entry->inum,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 582) 		  (unsigned long long)__entry->start,
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 583) 		  (unsigned long)__entry->len,
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 584) 		  block_state_name(__entry->block_state),
41db1ab9bed18 (Bob Peterson        2012-05-09 12:11:35 -0400 585) 		  (unsigned long long)__entry->rd_addr,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 586) 		  __entry->rd_free_clone,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 587) 		  __entry->rd_requested,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 588) 		  __entry->rd_reserved)
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 589) );
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 590) 
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 591) /* Keep track of multi-block reservations as they are allocated/freed */
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 592) TRACE_EVENT(gfs2_rs,
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 593) 
9e733d3923fb0 (Steven Whitehouse   2012-08-23 15:37:59 +0100 594) 	TP_PROTO(const struct gfs2_blkreserv *rs, u8 func),
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 595) 
9e733d3923fb0 (Steven Whitehouse   2012-08-23 15:37:59 +0100 596) 	TP_ARGS(rs, func),
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 597) 
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 598) 	TP_STRUCT__entry(
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 599) 		__field(        dev_t,  dev                     )
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 600) 		__field(	u64,	rd_addr			)
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 601) 		__field(	u32,	rd_free_clone		)
07974d2a2a98b (Andreas Gruenbacher 2020-10-22 20:34:29 +0200 602) 		__field(	u32,	rd_requested		)
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 603) 		__field(	u32,	rd_reserved		)
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 604) 		__field(	u64,	inum			)
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 605) 		__field(	u64,	start			)
07974d2a2a98b (Andreas Gruenbacher 2020-10-22 20:34:29 +0200 606) 		__field(	u32,	requested		)
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 607) 		__field(	u32,	reserved		)
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 608) 		__field(	u8,	func			)
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 609) 	),
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 610) 
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 611) 	TP_fast_assign(
c65b76b893032 (Andreas Gruenbacher 2018-10-11 18:56:40 +0200 612) 		__entry->dev		= rs->rs_rgd->rd_sbd->sd_vfs->s_dev;
c65b76b893032 (Andreas Gruenbacher 2018-10-11 18:56:40 +0200 613) 		__entry->rd_addr	= rs->rs_rgd->rd_addr;
c65b76b893032 (Andreas Gruenbacher 2018-10-11 18:56:40 +0200 614) 		__entry->rd_free_clone	= rs->rs_rgd->rd_free_clone;
07974d2a2a98b (Andreas Gruenbacher 2020-10-22 20:34:29 +0200 615) 		__entry->rd_requested	= rs->rs_rgd->rd_requested;
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 616) 		__entry->rd_reserved	= rs->rs_rgd->rd_reserved;
f85c10e24ab9f (Bob Peterson        2018-06-13 08:52:47 -0500 617) 		__entry->inum		= container_of(rs, struct gfs2_inode,
f85c10e24ab9f (Bob Peterson        2018-06-13 08:52:47 -0500 618) 						       i_res)->i_no_addr;
c65b76b893032 (Andreas Gruenbacher 2018-10-11 18:56:40 +0200 619) 		__entry->start		= rs->rs_start;
07974d2a2a98b (Andreas Gruenbacher 2020-10-22 20:34:29 +0200 620) 		__entry->requested	= rs->rs_requested;
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 621) 		__entry->reserved	= rs->rs_reserved;
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 622) 		__entry->func		= func;
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 623) 	),
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 624) 
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 625) 	TP_printk("%u,%u bmap %llu resrv %llu rg:%llu rf:%u rq:%u rr:%u %s q:%u r:%u",
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 626) 		  MAJOR(__entry->dev), MINOR(__entry->dev),
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 627) 		  (unsigned long long)__entry->inum,
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 628) 		  (unsigned long long)__entry->start,
8e2e00473598d (Bob Peterson        2012-07-19 08:12:40 -0400 629) 		  (unsigned long long)__entry->rd_addr,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 630) 		  __entry->rd_free_clone,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 631) 		  __entry->rd_requested,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 632) 		  __entry->rd_reserved,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 633) 		  rs_func_name(__entry->func),
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 634) 		  __entry->requested,
725d0e9d464d5 (Andreas Gruenbacher 2018-10-02 14:59:54 +0100 635) 		  __entry->reserved)
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 636) );
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 637) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 638) #endif /* _TRACE_GFS2_H */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 639) 
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 640) /* This part must be outside protection */
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 641) #undef TRACE_INCLUDE_PATH
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 642) #define TRACE_INCLUDE_PATH .
d0b6e04a4cd83 (Li Zefan            2009-07-13 10:33:21 +0800 643) #define TRACE_INCLUDE_FILE trace_gfs2
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 644) #include <trace/define_trace.h>
63997775b795f (Steven Whitehouse   2009-06-12 08:49:20 +0100 645)