summaryrefslogtreecommitdiff
path: root/src/xine-engine/monitor.c
diff options
context:
space:
mode:
authorJuergen Keil <jkeil@users.sourceforge.net>2001-09-10 13:36:56 +0000
committerJuergen Keil <jkeil@users.sourceforge.net>2001-09-10 13:36:56 +0000
commitd9f6f14d5110787be31160ef4956bebe572cba4d (patch)
treec80f06c376a1ce653c1150a5fcaa5a93f1646a31 /src/xine-engine/monitor.c
parent6fdc5685796399e9ddea30b7dcffc607bd4c10b3 (diff)
downloadxine-lib-d9f6f14d5110787be31160ef4956bebe572cba4d.tar.gz
xine-lib-d9f6f14d5110787be31160ef4956bebe572cba4d.tar.bz2
Dynamically allocate the profiler IDs, and add a profiler for video_out_xshm's
yuv2rgb conversion CVS patchset: 601 CVS date: 2001/09/10 13:36:56
Diffstat (limited to 'src/xine-engine/monitor.c')
-rw-r--r--src/xine-engine/monitor.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/xine-engine/monitor.c b/src/xine-engine/monitor.c
index ed490c89c..05ac994a6 100644
--- a/src/xine-engine/monitor.c
+++ b/src/xine-engine/monitor.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: monitor.c,v 1.4 2001/09/06 13:39:36 jkeil Exp $
+ * $Id: monitor.c,v 1.5 2001/09/10 13:36:56 jkeil Exp $
*
* debug print and profiling functions - implementation
*
@@ -32,7 +32,7 @@
#include "utils.h"
#include "monitor.h"
-#define MAX_ID 5
+#define MAX_ID 10
#ifdef DEBUG
@@ -51,10 +51,20 @@ void profiler_init () {
}
}
-void profiler_set_label (int id, char *label) {
+int profiler_allocate_slot (char *label) {
+ int id;
+
+ for (id = 0; id < MAX_ID && profiler_label[id] != NULL; id++)
+ ;
+
+ if (id >= MAX_ID)
+ return -1;
+
profiler_label[id] = label;
+ return id;
}
+
#ifdef ARCH_X86
__inline__ unsigned long long int rdtsc()
{
@@ -65,12 +75,18 @@ __inline__ unsigned long long int rdtsc()
#endif
void profiler_start_count (int id) {
+
+ if ((unsigned)id >= MAX_ID) return;
+
#ifdef ARCH_X86
profiler_start[id] = rdtsc();
#endif
}
void profiler_stop_count (int id) {
+
+ if ((unsigned)id >= MAX_ID) return;
+
#ifdef ARCH_X86
profiler_times[id] += rdtsc() - profiler_start[id];
#endif