Refactoring pgbench.c
Main pgbench logic consists of single file pgbench.c which is 4036
lines of code as of today. This is not a small number and I think it
would be nice if it is divided into smaller files because it will make
it easier to maintain, add or change features of pgbench. I will come
up with an idea how to split pgbench.c later. In the mean time I
attached a call graph of pgbench.c generated by egypt, which we could
get a basic idea how to split and modularize pgbench.c.
BTW, while looking at pgbench.c I noticed subtle coding problems:
1) strtoint64() should be decalred as static
2)
static
void
agg_vals_init(AggVals *aggs, instr_time start)
"static" and "void" should be one line, rather than separate 2 lines
according to our coding style.
I will commit fix for these if there's no objection.
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
Attachments:
pgbench.gifimage/gifDownload
GIF89ac�� ���DBD���$"$���dbd������TRT���424���trt���
���LJL���,*,���ljl������\Z\���<:<���|z|������DFD���$&$���dfd������TVT���464���tvt������LNL���,.,���lnl������\^\���<><���|~|������ !� @ , c� ��?���������������������������������������������������������������������������������������������������������������������7;3���;n<�G������!\������N(��$0@ �����p�a�G�7 �\�����0c��I���%|h` �#2,H��F�v(]�a��-r��q��8H1�C��`�Rz)����h�m��A ��0X���c���>lh���� 8�(q!���+�"^���cO;*���# �X���
i8h1������^��u�)4`��!����^�p� )
�N<�����+��aB�!��7�t��A����]O��yf���]�}h� �������� (�*3D �F���
�|�� `�Vh��]���&�C*�
�p�5D������e��4�wA & "D@a7=�
�T��������L>��n����H� .� �
4��YJ~)��3m��=a` a�< �� �t�f�x�i�
X�#=��P �����Aw.����(�U$������@&t ���4
���&sB:��)$�����w���������,/t�
��� �9�B(�A��6���F+-(+� �F8P��0=�$�0���@K���2rB ���1���2 ����{����;�
5X`��.��lXP �����*�>,��|�: , XP�i}�0���DL��d�PA�MY�i7� �
�l�7��
���U8�P���U����t$&/�4�+d`�[ $��������>�u!M-6r�� Ae�9P�����I��u�r���%���U(��
����n��t�xY�}.4�v�`@� ���x����C!(�. �E�r�'� B���y��tA ��`�`�u4� D�������$`"�� �0��K.@q�.��w���-D`��Xq`B-L�� ����r���|�B
!�� 8��@���R ��~����L�m��o(� �`�+� P�2T
��[��T :�@�����`�k�H@�
��T!��?Q�
�� *�h� �E}�� P0�~*�N�b$z�C�q\p@
:<�=�=#����(�2
��0�p�1@.(����( "3c���G���i���H�
XA��4���c�#$���d�*`@e8��� 'Ab� �L�K�<����$ ��
\h $�+� %E��rI����N0�
D�2�^G� C�����HS�
&6��� >0� � p@.HA"��)�
� �$��IN��`�
X h��@0��2 ���i����fT�)
�.�|���p8)@ 6z��T�� 1��NP����:�@
"��@
d�OZ���3��4v��`�E���N0�����-M�t`R5�MN������@
���`��x�F� p��.-� ���Ac p�V7������*29��6���
�AJ0�<�5/A@��@�@���\R: �Wy1� (�c-���v�(�TT���:/�:��:' ��`���2��`|`��AO� �-� x�o�������k , ����78��
4[�l���y���;������ ��_�C �y�S���t}�� d� �t"!�2��� ��YA&�������[�6��^����0�� *�JtN��K����C�[P��
�5H�� �<X���c�-��P/{)�^�7(�0sg�����t@�T�;B@��E �G/����y�v� �@4hHy����u
^�
, ����x@DP�\Y
H0�<j����.�16 R"G��+8��z�i
�� ;p `�%_<�"(u������f v���,5��Y ��\��� p��i1 d����2���c�z����HJ�a��V;P x���| �A��
@@P�>��~����P��]����,o���B�VS��,`� n��s|8�DB` xt�pew ����?�&��]l ��xc<�sW��04*{Ex����Q� �`�4I d�nU��=7��N�?S��� ��V�n
����� ��g�s��d�v������`�� �M�M ��C6@ ��+�@ ���S7�@�����3�%���N������ l{y�X���x�|�M� �������U��- @t� �^,���M
� ��j"�A
z�{6 ~���
`��������z���~��[�H�T`�g`Agq
��7���sa����|�v
;�F � ��C a�"�. P �o?P �P&�`
�e��t� �&7�8�[��� +� @!=`8p<�5��<��.� ��9��C��� V��&�2!��v 5��<�?0KI# � �&2P8'���p ���@:�@C?�B&/@8�2�K� '��K0�:��h '@5�eM��>` a���P�G�w��@�Z�<��L�Q�� "1�0 �!o1( ux��S��F� ~,���m� ?������ 09��X�� �"� �h'��� '� Z(KP�h= ��� ^6 '"