Changeset 30589 in vbox
- Timestamp:
- Jul 2, 2010 6:14:21 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63314
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/stam.h
r28800 r30589 634 634 * @param pProfile Pointer to the STAMPROFILE structure to operate on. 635 635 * @param Prefix Identifier prefix used to internal variables. 636 * 637 * @remarks Declears a stack variable that will be used by related macros. 636 638 */ 637 639 #ifndef VBOX_WITHOUT_RELEASE_STATISTICS … … 647 649 * @param pProfile Pointer to the STAMPROFILE structure to operate on. 648 650 * @param Prefix Identifier prefix used to internal variables. 651 * 652 * @remarks Declears a stack variable that will be used by related macros. 649 653 */ 650 654 #ifdef VBOX_WITH_STATISTICS … … 664 668 do { \ 665 669 uint64_t Prefix##_cTicks; \ 666 uint64_t Prefix##_tsStop; \ 667 STAM_GET_TS(Prefix##_tsStop); \ 668 Prefix##_cTicks = Prefix##_tsStop - Prefix##_tsStart; \ 670 STAM_GET_TS(Prefix##_cTicks); \ 671 Prefix##_cTicks -= Prefix##_tsStart; \ 669 672 (pProfile)->cTicks += Prefix##_cTicks; \ 670 673 (pProfile)->cPeriods++; \ … … 703 706 do { \ 704 707 uint64_t Prefix##_cTicks; \ 705 uint64_t Prefix##_tsStop; \ 706 STAM_GET_TS(Prefix##_tsStop); \ 707 Prefix##_cTicks = Prefix##_tsStop - Prefix##_tsStart; \ 708 STAM_GET_TS(Prefix##_cTicks); \ 709 Prefix##_cTicks -= Prefix##_tsStart; \ 708 710 (pProfile)->cTicks += Prefix##_cTicks; \ 709 711 (pProfile)->cPeriods++; \ … … 788 790 789 791 /** @def STAM_REL_PROFILE_ADV_STOP 790 * Samples the stop time of a profiling period and updates the sample. 792 * Samples the stop time of a profiling period (if running) and updates the 793 * sample. 791 794 * 792 795 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. … … 796 799 # define STAM_REL_PROFILE_ADV_STOP(pProfileAdv, Prefix) \ 797 800 do { \ 798 uint64_t Prefix##_tsStop; \799 STAM_GET_TS(Prefix##_tsStop); \800 801 if ((pProfileAdv)->tsStart) \ 801 802 { \ 802 uint64_t Prefix##_cTicks = Prefix##_tsStop - (pProfileAdv)->tsStart; \ 803 uint64_t Prefix##_cTicks; \ 804 STAM_GET_TS(Prefix##_cTicks); \ 805 Prefix##_cTicks -= (pProfileAdv)->tsStart; \ 803 806 (pProfileAdv)->tsStart = 0; \ 804 807 (pProfileAdv)->Core.cTicks += Prefix##_cTicks; \ … … 814 817 #endif 815 818 /** @def STAM_PROFILE_ADV_STOP 816 * Samples the stop time of a profiling period and updates the sample. 819 * Samples the stop time of a profiling period (if running) and updates the 820 * sample. 817 821 * 818 822 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. … … 823 827 #else 824 828 # define STAM_PROFILE_ADV_STOP(pProfileAdv, Prefix) do { } while (0) 829 #endif 830 831 832 /** @def STAM_REL_PROFILE_ADV_STOP_START 833 * Stops one profile counter (if running) and starts another one. 834 * 835 * @param pProfileAdv1 Pointer to the STAMPROFILEADV structure to stop. 836 * @param pProfileAdv2 Pointer to the STAMPROFILEADV structure to start. 837 * @param Prefix Identifier prefix used to internal variables. 838 */ 839 #ifndef VBOX_WITHOUT_RELEASE_STATISTICS 840 # define STAM_REL_PROFILE_ADV_STOP_START(pProfileAdv1, pProfileAdv2, Prefix) \ 841 do { \ 842 uint64_t Prefix##_cTicks; \ 843 STAM_GET_TS(Prefix##_cTicks); \ 844 (pProfileAdv2)->tsStart = Prefix##_cTicks; \ 845 if ((pProfileAdv1)->tsStart) \ 846 { \ 847 Prefix##_cTicks -= (pProfileAdv1)->tsStart; \ 848 (pProfileAdv1)->tsStart = 0; \ 849 (pProfileAdv1)->Core.cTicks += Prefix##_cTicks; \ 850 (pProfileAdv1)->Core.cPeriods++; \ 851 if ((pProfileAdv1)->Core.cTicksMax < Prefix##_cTicks) \ 852 (pProfileAdv1)->Core.cTicksMax = Prefix##_cTicks; \ 853 if ((pProfileAdv1)->Core.cTicksMin > Prefix##_cTicks) \ 854 (pProfileAdv1)->Core.cTicksMin = Prefix##_cTicks; \ 855 } \ 856 } while (0) 857 #else 858 # define STAM_REL_PROFILE_ADV_STOP_START(pProfileAdv1, pProfileAdv2, Prefix) \ 859 do { } while (0) 860 #endif 861 /** @def STAM_PROFILE_ADV_STOP_START 862 * Samples the stop time of a profiling period (if running) and updates the 863 * sample. 864 * 865 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. 866 * @param Prefix Identifier prefix used to internal variables. 867 */ 868 #ifdef VBOX_WITH_STATISTICS 869 # define STAM_PROFILE_ADV_STOP_START(pProfileAdv1, pProfileAdv2, Prefix) \ 870 STAM_REL_PROFILE_ADV_STOP_START(pProfileAdv1, pProfileAdv2, Prefix) 871 #else 872 # define STAM_PROFILE_ADV_STOP_START(pProfileAdv1, pProfileAdv2, Prefix) \ 873 do { } while (0) 825 874 #endif 826 875 … … 890 939 891 940 /** @def STAM_REL_PROFILE_ADV_STOP_EX 892 * Samples the stop time of a profiling period and updates both the sample893 * and an attribution sample.941 * Samples the stop time of a profiling period (if running) and updates both 942 * the sample and an attribution sample. 894 943 * 895 944 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. … … 901 950 # define STAM_REL_PROFILE_ADV_STOP_EX(pProfileAdv, pProfile2, Prefix) \ 902 951 do { \ 903 uint64_t Prefix##_tsStop; \904 STAM_GET_TS(Prefix##_tsStop); \905 952 if ((pProfileAdv)->tsStart) \ 906 953 { \ 907 uint64_t Prefix##_cTicks = Prefix##_tsStop - (pProfileAdv)->tsStart; \ 954 uint64_t Prefix##_cTicks; \ 955 STAM_GET_TS(Prefix##_cTicks); \ 956 Prefix##_cTicks -= (pProfileAdv)->tsStart; \ 908 957 (pProfileAdv)->tsStart = 0; \ 909 958 (pProfileAdv)->Core.cTicks += Prefix##_cTicks; \ … … 928 977 #endif 929 978 /** @def STAM_PROFILE_ADV_STOP_EX 930 * Samples the stop time of a profiling period and updates both the sample931 * and an attribution sample.979 * Samples the stop time of a profiling period (if running) and updates both 980 * the sample and an attribution sample. 932 981 * 933 982 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. … … 940 989 #else 941 990 # define STAM_PROFILE_ADV_STOP_EX(pProfileAdv, pProfile2, Prefix) do { } while (0) 991 #endif 992 993 /** @def STAM_REL_PROFILE_ADV_IS_RUNNING 994 * Checks if it is running. 995 * 996 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. 997 */ 998 #ifndef VBOX_WITHOUT_RELEASE_STATISTICS 999 # define STAM_REL_PROFILE_ADV_IS_RUNNING(pProfileAdv) (pProfileAdv)->tsStart 1000 #else 1001 # define STAM_REL_PROFILE_ADV_IS_RUNNING(pProfileAdv) (false) 1002 #endif 1003 /** @def STAM_PROFILE_ADV_IS_RUNNING 1004 * Checks if it is running. 1005 * 1006 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. 1007 */ 1008 #ifdef VBOX_WITH_STATISTICS 1009 # define STAM_PROFILE_ADV_IS_RUNNING(pProfileAdv) STAM_REL_PROFILE_ADV_IS_RUNNING(pProfileAdv) 1010 #else 1011 # define STAM_PROFILE_ADV_IS_RUNNING(pProfileAdv) (false) 1012 #endif 1013 1014 /** @def STAM_REL_PROFILE_ADV_SET_STOPPED 1015 * Marks the profile counter as stopped. 1016 * 1017 * This is for avoiding screwups in twisty code. 1018 * 1019 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. 1020 */ 1021 #ifndef VBOX_WITHOUT_RELEASE_STATISTICS 1022 # define STAM_REL_PROFILE_ADV_SET_STOPPED(pProfileAdv) do { (pProfileAdv)->tsStart = 0; } while (0) 1023 #else 1024 # define STAM_REL_PROFILE_ADV_SET_STOPPED(pProfileAdv) do { } while (0) 1025 #endif 1026 /** @def STAM_PROFILE_ADV_SET_STOPPED 1027 * Marks the profile counter as stopped. 1028 * 1029 * This is for avoiding screwups in twisty code. 1030 * 1031 * @param pProfileAdv Pointer to the STAMPROFILEADV structure to operate on. 1032 */ 1033 #ifdef VBOX_WITH_STATISTICS 1034 # define STAM_PROFILE_ADV_SET_STOPPED(pProfileAdv) STAM_REL_PROFILE_ADV_SET_STOPPED(pProfileAdv) 1035 #else 1036 # define STAM_PROFILE_ADV_SET_STOPPED(pProfileAdv) do { } while (0) 942 1037 #endif 943 1038
Note:
See TracChangeset
for help on using the changeset viewer.