Modified 120 and 122 groups so auto-fsqa could display results correctly
[xfstests-dev.git] / 122
1 #! /bin/sh
2 # FS QA Test No. 122
3 #
4 # pv#952498
5 # Keep an eye on some of the xfs type sizes
6 # Motivation from differing ondisk types for 32 and 64 bit word versions.
7 #
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
10 #-----------------------------------------------------------------------
11 #
12 # creator
13 owner=tes@sgi.com
14
15 seq=`basename $0`
16 echo "QA output created by $seq"
17
18 here=`pwd`
19 tmp=/tmp/$$
20 status=1        # failure is the default!
21 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22
23 # get standard environment
24 . ./common.rc
25
26 # real QA test starts here
27 _supported_fs xfs
28 _supported_os Linux
29
30 cprog=$tmp.get_structs.c
31 oprog=$tmp.get_structs
32
33 cat >$cprog <<EOF
34 #include <stdio.h>
35 #include <xfs/libxlog.h>
36 EOF
37
38 cat >$tmp.ignore <<EOF
39 xfs_buf_cancel_t
40 xfs_swapext_t
41 xfs_dirops_t
42 xfs_efi_log_item_t
43 xfs_efd_log_item_t
44 xfs_iocore_t
45 xfs_ihash_t
46 xfs_chashlist_t
47 xfs_chash_t
48 xfs_iptr_t
49 xfs_dmops_t
50 xfs_qmops_t
51 xfs_ioops_t
52 xfs_mod_sb_t
53 xfs_dqtrx_t
54 xfs_dqtrxops_t
55 xfs_ail_entry_t
56 xfs_item_ops_t
57 xfs_log_busy_slot_t
58 xfs_log_busy_chunk_t
59 xfs_inode_log_format_t
60 xfs_efi_log_format_t
61 xfs_efd_log_format_t
62 xfs_perag_busy_t
63 xfs_perag_t
64 xfs_alloc_arg_t
65 xfs_attr_list_context_t
66 xfs_attr_sf_sort_t
67 xfs_bmbt_irec_t
68 xfs_bmap_free_item_t
69 xfs_bmap_free_t
70 xfs_bmalloca_t
71 xfs_btree_cur_t
72 xfs_buf_log_item_t
73 xfs_da_args_t
74 xfs_dabuf_t
75 xfs_da_state_blk_t
76 xfs_da_state_path_t
77 xfs_da_state_t
78 xfs_dinode_t
79 xfs_dir2_block_t
80 xfs_dir2_data_entry_t
81 xfs_dir2_data_union_t
82 xfs_dir2_data_t
83 xfs_dir2_put_args_t
84 xfs_dir_put_args_t
85 xfs_dir_sf_sort_t
86 xfs_extent_t
87 xfs_flock64_t
88 xfs_fsop_geom_v1_t
89 xfs_growfs_data_t
90 xfs_growfs_rt_t
91 xfs_bstime_t
92 xfs_bstat_t
93 xfs_fsop_bulkreq_t
94 xfs_inogrp_t
95 xfs_fsop_handlereq_t
96 xfs_fsop_setdm_handlereq_t
97 xfs_fsop_attrlist_handlereq_t
98 xfs_attr_multiop_t
99 xfs_fsop_attrmulti_handlereq_t
100 xfs_imap_t
101 xfs_ifork_t
102 xfs_inode_t
103 xfs_inode_log_item_t
104 xfs_log_iovec_t
105 xfs_log_callback_t
106 xfs_mount_t
107 xfs_sb_t
108 xfs_log_item_t
109 xfs_log_item_desc_t
110 xfs_log_item_chunk_t
111 xfs_trans_t
112 xfs_dirent_t
113 xfs_fsop_getparents_handlereq_t
114 EOF
115
116 echo 'int main(int argc, char *argv[]) {' >>$cprog
117
118 #
119 # Printfs of typedef sizes
120 #
121 cat /usr/include/xfs/xfs*.h | indent |\
122 sed -e 's/__attribute__ *[(][(]packed[)][)]//' |\
123 tee shit |\
124 egrep '} *xfs_.*_t' |\
125 egrep -v -f $tmp.ignore |\
126 awk '{sub(/[;,]/,"",$2); print "printf(\"sizeof(", $2, ") = %d\\n\", sizeof(", $2, "));"}' \
127 >>$cprog
128
129 #
130 # Look at offsets of key ones which differ in lengths
131 #
132
133 # xfs_sb_t
134 cat /usr/include/xfs/xfs*.h | indent |\
135 awk '
136    /typedef struct xfs_sb/ { structon = 1; next }
137    structon && $2 ~ /^sb_/ { sub(/[;,]/,"",$2)
138                              print "printf(\"offsetof(xfs_sb_t,", $2, ") = %d\\n\", offsetof(xfs_sb_t,", $2, "));"; next} 
139    structon && /}/ { structon = 0; next}
140 '>>$cprog 
141
142 echo 'return 0; }' >>$cprog
143
144 # create and run program
145 cc -o $oprog $cprog
146 eval $oprog | LC_COLLATE=POSIX sort
147
148 status=0