diff options
author | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-11 15:20:19 +0000 |
---|---|---|
committer | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-11 15:20:19 +0000 |
commit | b66e9843f8d864fb22a5ab39ba8776dbcaa4cf4c (patch) | |
tree | b132e933954d83faf46a15cf9b1f6641ba56d842 /my_profile.h | |
parent | 7035adb0bdf3b83031576418aed3584c9c39abb1 (diff) | |
download | mpv-b66e9843f8d864fb22a5ab39ba8776dbcaa4cf4c.tar.bz2 mpv-b66e9843f8d864fb22a5ab39ba8776dbcaa4cf4c.tar.xz |
using volatile modifier
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2835 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'my_profile.h')
-rw-r--r-- | my_profile.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/my_profile.h b/my_profile.h index 23fec4ea43..7c27a4b452 100644 --- a/my_profile.h +++ b/my_profile.h @@ -5,12 +5,11 @@ * * You can redistribute this file under terms and conditions * of GNU General Public licence v2. - * This file is partly based on vbetest.c from lrmi distributive. */ #ifndef MY_PROFILE_INC #define MY_PROFILE_INC -extern unsigned long long int my_profile_start,my_profile_end,my_profile_total; +extern volatile unsigned long long int my_profile_start,my_profile_end,my_profile_total; #if defined ( ENABLE_PROFILE ) && defined ( ARCH_X86 ) static inline unsigned long long int read_tsc( void ) @@ -20,10 +19,11 @@ static inline unsigned long long int read_tsc( void ) return retval; } -#define PROFILE_START() (my_profile_start=read_tsc()) -#define PROFILE_END(your_message) { my_profile_end=read_tsc(); my_profile_total+=my_profile_end - my_profile_start; printf(your_message" current=%llu total=%llu\n\t",my_profile_end-my_profile_start,my_profile_total); } +#define PROFILE_RESET() (my_profile_total=0ULL) +#define PROFILE_START() { static int inited=0; if(!inited) { inited=1; my_profile_total=0ULL; } my_profile_start=read_tsc(); } +#define PROFILE_END(your_message) { my_profile_end=read_tsc(); my_profile_total+=(my_profile_end-my_profile_start); printf(your_message" current=%llu total=%llu\n\t",(my_profile_end-my_profile_start),my_profile_total); } #else -#define PROFILE_INIT() +#define PROFILE_RESET() #define PROFILE_START() #define PROFILE_END(your_message) #endif |