Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: report refcount domain in tracepoints

Now that we've broken out the startblock and shared/cow domain in the
incore refcount extent record structure, update the tracepoints to
report the domain.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>

+43 -9
+4
fs/xfs/libxfs/xfs_types.h
··· 171 171 XFS_REFC_DOMAIN_COW, 172 172 }; 173 173 174 + #define XFS_REFC_DOMAIN_STRINGS \ 175 + { XFS_REFC_DOMAIN_SHARED, "shared" }, \ 176 + { XFS_REFC_DOMAIN_COW, "cow" } 177 + 174 178 struct xfs_refcount_irec { 175 179 xfs_agblock_t rc_startblock; /* starting block number */ 176 180 xfs_extlen_t rc_blockcount; /* count of free blocks */
+39 -9
fs/xfs/xfs_trace.h
··· 799 799 TRACE_DEFINE_ENUM(PE_SIZE_PMD); 800 800 TRACE_DEFINE_ENUM(PE_SIZE_PUD); 801 801 802 + TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_SHARED); 803 + TRACE_DEFINE_ENUM(XFS_REFC_DOMAIN_COW); 804 + 802 805 TRACE_EVENT(xfs_filemap_fault, 803 806 TP_PROTO(struct xfs_inode *ip, enum page_entry_size pe_size, 804 807 bool write_fault), ··· 2928 2925 TP_STRUCT__entry( 2929 2926 __field(dev_t, dev) 2930 2927 __field(xfs_agnumber_t, agno) 2928 + __field(enum xfs_refc_domain, domain) 2931 2929 __field(xfs_agblock_t, startblock) 2932 2930 __field(xfs_extlen_t, blockcount) 2933 2931 __field(xfs_nlink_t, refcount) ··· 2936 2932 TP_fast_assign( 2937 2933 __entry->dev = mp->m_super->s_dev; 2938 2934 __entry->agno = agno; 2935 + __entry->domain = irec->rc_domain; 2939 2936 __entry->startblock = irec->rc_startblock; 2940 2937 __entry->blockcount = irec->rc_blockcount; 2941 2938 __entry->refcount = irec->rc_refcount; 2942 2939 ), 2943 - TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u", 2940 + TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u", 2944 2941 MAJOR(__entry->dev), MINOR(__entry->dev), 2945 2942 __entry->agno, 2943 + __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS), 2946 2944 __entry->startblock, 2947 2945 __entry->blockcount, 2948 2946 __entry->refcount) ··· 2964 2958 TP_STRUCT__entry( 2965 2959 __field(dev_t, dev) 2966 2960 __field(xfs_agnumber_t, agno) 2961 + __field(enum xfs_refc_domain, domain) 2967 2962 __field(xfs_agblock_t, startblock) 2968 2963 __field(xfs_extlen_t, blockcount) 2969 2964 __field(xfs_nlink_t, refcount) ··· 2973 2966 TP_fast_assign( 2974 2967 __entry->dev = mp->m_super->s_dev; 2975 2968 __entry->agno = agno; 2969 + __entry->domain = irec->rc_domain; 2976 2970 __entry->startblock = irec->rc_startblock; 2977 2971 __entry->blockcount = irec->rc_blockcount; 2978 2972 __entry->refcount = irec->rc_refcount; 2979 2973 __entry->agbno = agbno; 2980 2974 ), 2981 - TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x", 2975 + TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x", 2982 2976 MAJOR(__entry->dev), MINOR(__entry->dev), 2983 2977 __entry->agno, 2978 + __print_symbolic(__entry->domain, XFS_REFC_DOMAIN_STRINGS), 2984 2979 __entry->startblock, 2985 2980 __entry->blockcount, 2986 2981 __entry->refcount, ··· 3003 2994 TP_STRUCT__entry( 3004 2995 __field(dev_t, dev) 3005 2996 __field(xfs_agnumber_t, agno) 2997 + __field(enum xfs_refc_domain, i1_domain) 3006 2998 __field(xfs_agblock_t, i1_startblock) 3007 2999 __field(xfs_extlen_t, i1_blockcount) 3008 3000 __field(xfs_nlink_t, i1_refcount) 3001 + __field(enum xfs_refc_domain, i2_domain) 3009 3002 __field(xfs_agblock_t, i2_startblock) 3010 3003 __field(xfs_extlen_t, i2_blockcount) 3011 3004 __field(xfs_nlink_t, i2_refcount) ··· 3015 3004 TP_fast_assign( 3016 3005 __entry->dev = mp->m_super->s_dev; 3017 3006 __entry->agno = agno; 3007 + __entry->i1_domain = i1->rc_domain; 3018 3008 __entry->i1_startblock = i1->rc_startblock; 3019 3009 __entry->i1_blockcount = i1->rc_blockcount; 3020 3010 __entry->i1_refcount = i1->rc_refcount; 3011 + __entry->i2_domain = i2->rc_domain; 3021 3012 __entry->i2_startblock = i2->rc_startblock; 3022 3013 __entry->i2_blockcount = i2->rc_blockcount; 3023 3014 __entry->i2_refcount = i2->rc_refcount; 3024 3015 ), 3025 - TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- " 3026 - "agbno 0x%x fsbcount 0x%x refcount %u", 3016 + TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- " 3017 + "dom %s agbno 0x%x fsbcount 0x%x refcount %u", 3027 3018 MAJOR(__entry->dev), MINOR(__entry->dev), 3028 3019 __entry->agno, 3020 + __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS), 3029 3021 __entry->i1_startblock, 3030 3022 __entry->i1_blockcount, 3031 3023 __entry->i1_refcount, 3024 + __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS), 3032 3025 __entry->i2_startblock, 3033 3026 __entry->i2_blockcount, 3034 3027 __entry->i2_refcount) ··· 3053 3038 TP_STRUCT__entry( 3054 3039 __field(dev_t, dev) 3055 3040 __field(xfs_agnumber_t, agno) 3041 + __field(enum xfs_refc_domain, i1_domain) 3056 3042 __field(xfs_agblock_t, i1_startblock) 3057 3043 __field(xfs_extlen_t, i1_blockcount) 3058 3044 __field(xfs_nlink_t, i1_refcount) 3045 + __field(enum xfs_refc_domain, i2_domain) 3059 3046 __field(xfs_agblock_t, i2_startblock) 3060 3047 __field(xfs_extlen_t, i2_blockcount) 3061 3048 __field(xfs_nlink_t, i2_refcount) ··· 3066 3049 TP_fast_assign( 3067 3050 __entry->dev = mp->m_super->s_dev; 3068 3051 __entry->agno = agno; 3052 + __entry->i1_domain = i1->rc_domain; 3069 3053 __entry->i1_startblock = i1->rc_startblock; 3070 3054 __entry->i1_blockcount = i1->rc_blockcount; 3071 3055 __entry->i1_refcount = i1->rc_refcount; 3056 + __entry->i2_domain = i2->rc_domain; 3072 3057 __entry->i2_startblock = i2->rc_startblock; 3073 3058 __entry->i2_blockcount = i2->rc_blockcount; 3074 3059 __entry->i2_refcount = i2->rc_refcount; 3075 3060 __entry->agbno = agbno; 3076 3061 ), 3077 - TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- " 3078 - "agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x", 3062 + TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- " 3063 + "dom %s agbno 0x%x fsbcount 0x%x refcount %u @ agbno 0x%x", 3079 3064 MAJOR(__entry->dev), MINOR(__entry->dev), 3080 3065 __entry->agno, 3066 + __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS), 3081 3067 __entry->i1_startblock, 3082 3068 __entry->i1_blockcount, 3083 3069 __entry->i1_refcount, 3070 + __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS), 3084 3071 __entry->i2_startblock, 3085 3072 __entry->i2_blockcount, 3086 3073 __entry->i2_refcount, ··· 3107 3086 TP_STRUCT__entry( 3108 3087 __field(dev_t, dev) 3109 3088 __field(xfs_agnumber_t, agno) 3089 + __field(enum xfs_refc_domain, i1_domain) 3110 3090 __field(xfs_agblock_t, i1_startblock) 3111 3091 __field(xfs_extlen_t, i1_blockcount) 3112 3092 __field(xfs_nlink_t, i1_refcount) 3093 + __field(enum xfs_refc_domain, i2_domain) 3113 3094 __field(xfs_agblock_t, i2_startblock) 3114 3095 __field(xfs_extlen_t, i2_blockcount) 3115 3096 __field(xfs_nlink_t, i2_refcount) 3097 + __field(enum xfs_refc_domain, i3_domain) 3116 3098 __field(xfs_agblock_t, i3_startblock) 3117 3099 __field(xfs_extlen_t, i3_blockcount) 3118 3100 __field(xfs_nlink_t, i3_refcount) ··· 3123 3099 TP_fast_assign( 3124 3100 __entry->dev = mp->m_super->s_dev; 3125 3101 __entry->agno = agno; 3102 + __entry->i1_domain = i1->rc_domain; 3126 3103 __entry->i1_startblock = i1->rc_startblock; 3127 3104 __entry->i1_blockcount = i1->rc_blockcount; 3128 3105 __entry->i1_refcount = i1->rc_refcount; 3106 + __entry->i2_domain = i2->rc_domain; 3129 3107 __entry->i2_startblock = i2->rc_startblock; 3130 3108 __entry->i2_blockcount = i2->rc_blockcount; 3131 3109 __entry->i2_refcount = i2->rc_refcount; 3110 + __entry->i3_domain = i3->rc_domain; 3132 3111 __entry->i3_startblock = i3->rc_startblock; 3133 3112 __entry->i3_blockcount = i3->rc_blockcount; 3134 3113 __entry->i3_refcount = i3->rc_refcount; 3135 3114 ), 3136 - TP_printk("dev %d:%d agno 0x%x agbno 0x%x fsbcount 0x%x refcount %u -- " 3137 - "agbno 0x%x fsbcount 0x%x refcount %u -- " 3138 - "agbno 0x%x fsbcount 0x%x refcount %u", 3115 + TP_printk("dev %d:%d agno 0x%x dom %s agbno 0x%x fsbcount 0x%x refcount %u -- " 3116 + "dom %s agbno 0x%x fsbcount 0x%x refcount %u -- " 3117 + "dom %s agbno 0x%x fsbcount 0x%x refcount %u", 3139 3118 MAJOR(__entry->dev), MINOR(__entry->dev), 3140 3119 __entry->agno, 3120 + __print_symbolic(__entry->i1_domain, XFS_REFC_DOMAIN_STRINGS), 3141 3121 __entry->i1_startblock, 3142 3122 __entry->i1_blockcount, 3143 3123 __entry->i1_refcount, 3124 + __print_symbolic(__entry->i2_domain, XFS_REFC_DOMAIN_STRINGS), 3144 3125 __entry->i2_startblock, 3145 3126 __entry->i2_blockcount, 3146 3127 __entry->i2_refcount, 3128 + __print_symbolic(__entry->i3_domain, XFS_REFC_DOMAIN_STRINGS), 3147 3129 __entry->i3_startblock, 3148 3130 __entry->i3_blockcount, 3149 3131 __entry->i3_refcount)