• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 /*! \addtogroup osclproc OSCL Proc
19  *
20  * @{
21  */
22 
23 
24 
25 /** \file oscl_scheduler_tuneables.h
26     \brief Tuneable settings for Oscl Scheduler
27 */
28 
29 
30 #ifndef OSCL_SCHEDULER_TUNEABLES_H_INCLUDED
31 #define OSCL_SCHEDULER_TUNEABLES_H_INCLUDED
32 
33 #include "osclconfig_proc.h"
34 
35 //Enable/disable scheduler stats gathering for Run times.
36 //This data gathering is fairly expensive so should only be used
37 //for debug and profiling.
38 #ifndef PV_SCHED_ENABLE_AO_STATS
39 //defaults for cases where the flag is not defined in the osclconfig_proc.h
40 #if defined( NDEBUG)||(OSCL_RELEASE_BUILD)
41 //for release builds
42 #define PV_SCHED_ENABLE_AO_STATS 0
43 #else
44 //for debug builds
45 #define PV_SCHED_ENABLE_AO_STATS 1
46 #endif
47 #endif
48 
49 //Enable this to track time spent in scheduling loop in addition to Run times.
50 //This data gathering is fairly expensive so should only be used
51 //for debug and profiling.
52 #ifndef PV_SCHED_ENABLE_LOOP_STATS
53 //defaults for cases where the flag is not defined in the osclconfig_proc.h
54 #if defined( NDEBUG)||(OSCL_RELEASE_BUILD)
55 //for release builds
56 #define PV_SCHED_ENABLE_LOOP_STATS 0
57 #else
58 //for debug builds
59 #define PV_SCHED_ENABLE_LOOP_STATS 0
60 #endif
61 #endif
62 
63 //Note: loop stats requires PV_SCHED_ENABLE_AO_STATS
64 #if(PV_SCHED_ENABLE_LOOP_STATS) && !(PV_SCHED_ENABLE_AO_STATS)
65 #error Invalid Config!
66 #endif
67 
68 //Enable this to do detailed logging for all Run calls.
69 //This logging is very expensive so should only be used
70 //for debug and profiling.
71 #ifndef PV_SCHED_ENABLE_PERF_LOGGING
72 //defaults for cases where the flag is not defined in the osclconfig_proc.h
73 #if defined( NDEBUG)||(OSCL_RELEASE_BUILD)
74 //for release builds
75 #define PV_SCHED_ENABLE_PERF_LOGGING 0
76 #else
77 //for debug builds
78 #define PV_SCHED_ENABLE_PERF_LOGGING 1
79 #endif
80 #endif
81 
82 //Note: Perf logging requires PV_SCHED_ENABLE_AO_STATS
83 #if(PV_SCHED_ENABLE_PERF_LOGGING) && !(PV_SCHED_ENABLE_AO_STATS)
84 #error Invalid Config!
85 #endif
86 
87 //Enable/disable thread context checking here. Context checks are important during
88 //development but may be costly depending on the OS thread ID retrieval efficiency.
89 #if defined( NDEBUG)||(OSCL_RELEASE_BUILD)
90 //for release builds
91 #define PV_SCHED_ENABLE_THREAD_CONTEXT_CHECKS 0
92 #else
93 //for debug builds
94 #define PV_SCHED_ENABLE_THREAD_CONTEXT_CHECKS 1
95 #endif
96 
97 //Set LOG_Q to 1 to enable extensive Queue logging for non-symbian scheduler.
98 //the code will log the entire queue every time any AO is added or removed,
99 //for both timer queue and ready queue.  It is expensive so should be off in
100 //production code.
101 #define PV_SCHED_LOG_Q 0
102 
103 //Set CHECK_Q to enable Q integrity checks.  Should be off in production code.
104 #define PV_SCHED_CHECK_Q 0
105 
106 //This allows switching between "fair scheduling" and Symbian native scheduler
107 //behavior in the non-symbian scheduler implementation.
108 //We always use fair scheduling, but for testing it can be helpful to
109 //swap in the symbian native behavior.
110 #define PV_SCHED_FAIR_SCHEDULING 1
111 
112 //OSCL_PERF_SUMMARY_LOGGING is a master switch to configure scheduler
113 //for full performance data gathering with minimal summary logging at
114 //the end.  The data gathering is fairly expensive so should only be
115 //used for profiling tests.  The logging itself is fairly nonintrusive
116 //since it only happens at scheduler exit.
117 //------------------------------------
118 // logger node: "OsclSchedulerPerfStats"
119 // instrumentation level: PVLOGMSG_INST_PROF
120 // logger level: PVLOGMSG_INFO
121 //------------------------------------
122 #ifndef OSCL_PERF_SUMMARY_LOGGING
123 //defaults for cases where the flag is not defined in the osclconfig_proc.h
124 #if defined( NDEBUG)||(OSCL_RELEASE_BUILD)
125 //release builds
126 #define OSCL_PERF_SUMMARY_LOGGING 0
127 #else
128 //other debug builds
129 #define OSCL_PERF_SUMMARY_LOGGING 0
130 #endif
131 #endif
132 
133 //Settings for minimal stats logging
134 #if(OSCL_PERF_SUMMARY_LOGGING)
135 //enable AO stats
136 #undef PV_SCHED_ENABLE_AO_STATS
137 #define PV_SCHED_ENABLE_AO_STATS 1
138 //enable loop stats
139 #undef PV_SCHED_ENABLE_LOOP_STATS
140 #define PV_SCHED_ENABLE_LOOP_STATS 1
141 //disable perf logging because it skews the results
142 #undef PV_SCHED_ENABLE_PERF_LOGGING
143 #define PV_SCHED_ENABLE_PERF_LOGGING 0
144 #endif //OSCL_PERF_SUMMARY_LOGGING
145 
146 #endif
147 
148 
149 /*! @} */
150