[Mplayer-cvslog] CVS: main my_profile.c,1.1,1.2 my_profile.h,1.1,1.2

Nick Kurshev nick at mplayer.dev.hu
Sun Nov 11 16:20:22 CET 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv14242/main

Modified Files:
	my_profile.c my_profile.h 
Log Message:
using volatile modifier

Index: my_profile.c
===================================================================
RCS file: /cvsroot/mplayer/main/my_profile.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- my_profile.c	11 Nov 2001 14:41:19 -0000	1.1
+++ my_profile.c	11 Nov 2001 15:20:19 -0000	1.2
@@ -5,9 +5,8 @@
  *
  *  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.
  */
  
 #include "my_profile.h"
 
-unsigned long long int my_profile_start,my_profile_end,my_profile_total=0ULL;
+volatile unsigned long long int my_profile_start,my_profile_end,my_profile_total;

Index: my_profile.h
===================================================================
RCS file: /cvsroot/mplayer/main/my_profile.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- my_profile.h	11 Nov 2001 14:41:19 -0000	1.1
+++ my_profile.h	11 Nov 2001 15:20:19 -0000	1.2
@@ -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 @@
   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




More information about the MPlayer-cvslog mailing list