summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2008-04-28 18:41:13 +0000
committerBertrik Sikken <bertrik@sikken.nl>2008-04-28 18:41:13 +0000
commitcbd7fa40f6ba6d7c484299cbab06795196479ab4 (patch)
tree23f20b89506f66eaee66c8d7022f8a8c827fb0b3
parentbff3ddd5377e8b91e966fd4d3e19239053c1f168 (diff)
downloadrockbox-cbd7fa40f6ba6d7c484299cbab06795196479ab4.tar.gz
rockbox-cbd7fa40f6ba6d7c484299cbab06795196479ab4.zip
Moved private types and constants from profile.h to profile.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17284 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/profile.h35
-rw-r--r--firmware/profile.c33
2 files changed, 34 insertions, 34 deletions
diff --git a/firmware/export/profile.h b/firmware/export/profile.h
index 3736ac7924..4a7649e803 100644
--- a/firmware/export/profile.h
+++ b/firmware/export/profile.h
@@ -19,40 +19,7 @@
19 ****************************************************************************/ 19 ****************************************************************************/
20 20
21#ifndef _SYS_PROFILE_H 21#ifndef _SYS_PROFILE_H
22#define _SYS_PROFILE_H 1 22#define _SYS_PROFILE_H
23
24#include <sys/types.h>
25
26/* PFD is Profiled Function Data */
27
28/* Indices are shorts which means that we use 4k of RAM */
29#define INDEX_BITS 11 /* What is a reasonable size for this? */
30#define INDEX_SIZE 2048 /* 2 ^ INDEX_BITS */
31#define INDEX_MASK 0x7FF /* lower INDEX_BITS 1 */
32
33/*
34 * In the current setup (pfd has 4 longs and 2 shorts) this uses 20k of RAM
35 * for profiling, and allows for profiling sections of code with up-to
36 * 1024 function caller->callee pairs
37 */
38#define NUMPFDS 1024
39
40struct pfd_struct {
41 void *self_pc;
42 unsigned long count;
43 unsigned long time;
44 unsigned short link;
45 struct pfd_struct *caller;
46};
47
48/* Possible states of profiling */
49#define PROF_ON 0x00
50#define PROF_BUSY 0x01
51#define PROF_ERROR 0x02
52#define PROF_OFF 0x03
53/* Masks for thread switches */
54#define PROF_OFF_THREAD 0x10
55#define PROF_ON_THREAD 0x0F
56 23
57/* Initialize and start profiling */ 24/* Initialize and start profiling */
58void profstart(int current_thread) 25void profstart(int current_thread)
diff --git a/firmware/profile.c b/firmware/profile.c
index 71fe343879..0f445f42de 100644
--- a/firmware/profile.c
+++ b/firmware/profile.c
@@ -57,8 +57,41 @@
57#include <system.h> 57#include <system.h>
58#include <string.h> 58#include <string.h>
59#include <timer.h> 59#include <timer.h>
60#include <sys/types.h>
60#include "profile.h" 61#include "profile.h"
61 62
63
64/* PFD is Profiled Function Data */
65
66/* Indices are shorts which means that we use 4k of RAM */
67#define INDEX_BITS 11 /* What is a reasonable size for this? */
68#define INDEX_SIZE 2048 /* 2 ^ INDEX_BITS */
69#define INDEX_MASK 0x7FF /* lower INDEX_BITS 1 */
70
71/*
72 * In the current setup (pfd has 4 longs and 2 shorts) this uses 20k of RAM
73 * for profiling, and allows for profiling sections of code with up-to
74 * 1024 function caller->callee pairs
75 */
76#define NUMPFDS 1024
77
78struct pfd_struct {
79 void *self_pc;
80 unsigned long count;
81 unsigned long time;
82 unsigned short link;
83 struct pfd_struct *caller;
84};
85
86/* Possible states of profiling */
87#define PROF_ON 0x00
88#define PROF_BUSY 0x01
89#define PROF_ERROR 0x02
90#define PROF_OFF 0x03
91/* Masks for thread switches */
92#define PROF_OFF_THREAD 0x10
93#define PROF_ON_THREAD 0x0F
94
62static unsigned short profiling = PROF_OFF; 95static unsigned short profiling = PROF_OFF;
63static size_t recursion_level; 96static size_t recursion_level;
64static unsigned short indices[INDEX_SIZE]; 97static unsigned short indices[INDEX_SIZE];