diff options
author | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-11 14:41:19 +0000 |
---|---|---|
committer | nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-11-11 14:41:19 +0000 |
commit | 6fde34dde88c6d840718600485a696eaa97a1d4b (patch) | |
tree | 9811462ee36c80b88af729a9af84dbfc23a32c74 | |
parent | cac469b9b0ac86db6004e8523bca7f877bdfed9e (diff) | |
download | mpv-6fde34dde88c6d840718600485a696eaa97a1d4b.tar.bz2 mpv-6fde34dde88c6d840718600485a696eaa97a1d4b.tar.xz |
Precised profile stuff
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2833 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | my_profile.c | 13 | ||||
-rw-r--r-- | my_profile.h | 33 |
3 files changed, 47 insertions, 1 deletions
@@ -24,7 +24,7 @@ INSTALL = install SRCS_MENCODER = divx4_vbr.c mencoder.c libvo/aclib.c libvo/img_format.c ima4.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c msvidc.c codec-cfg.c cfgparser.c OBJS_MENCODER = $(SRCS_MENCODER:.c=.o) -SRCS_MPLAYER = mplayer.c ima4.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c find_sub.c dec_audio.c dec_video.c msvidc.c codec-cfg.c subreader.c lirc_mp.c cfgparser.c mixer.c spudec.c +SRCS_MPLAYER = mplayer.c ima4.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c find_sub.c dec_audio.c dec_video.c msvidc.c codec-cfg.c subreader.c lirc_mp.c cfgparser.c mixer.c spudec.c my_profile.c OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o) CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader -Ilibvo $(EXTRA_INC) $(MADLIB_INC) # -Wall A_LIBS = -Lmp3lib -lMP3 -Llibac3 -lac3 $(ALSA_LIB) $(ESD_LIB) $(MADLIB_LIB) $(SGI_AUDIO_LIB) diff --git a/my_profile.c b/my_profile.c new file mode 100644 index 0000000000..297c831684 --- /dev/null +++ b/my_profile.c @@ -0,0 +1,13 @@ +/* + * my_profile.c + * + * Copyright (C) Nick Kurshev <nickols_k@mail.ru> - Oct 2001 + * + * 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; diff --git a/my_profile.h b/my_profile.h new file mode 100644 index 0000000000..23fec4ea43 --- /dev/null +++ b/my_profile.h @@ -0,0 +1,33 @@ +/* + * my_profile.h + * + * Copyright (C) Nick Kurshev <nickols_k@mail.ru> - Oct 2001 + * + * 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; + +#if defined ( ENABLE_PROFILE ) && defined ( ARCH_X86 ) +static inline unsigned long long int read_tsc( void ) +{ + unsigned long long int retval; + __asm __volatile ("rdtsc":"=A"(retval)::"memory"); + 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); } +#else +#define PROFILE_INIT() +#define PROFILE_START() +#define PROFILE_END(your_message) +#endif + + + +#endif
\ No newline at end of file |