diff options
| -rw-r--r-- | litmus/Kconfig | 20 | ||||
| -rw-r--r-- | litmus/sched_trace.c | 8 |
2 files changed, 24 insertions, 4 deletions
diff --git a/litmus/Kconfig b/litmus/Kconfig index f1de6fabfc17..a3341021f05c 100644 --- a/litmus/Kconfig +++ b/litmus/Kconfig | |||
| @@ -149,6 +149,26 @@ config SCHED_DEBUG_TRACE | |||
| 149 | Say Yes for debugging. | 149 | Say Yes for debugging. |
| 150 | Say No for overhead tracing. | 150 | Say No for overhead tracing. |
| 151 | 151 | ||
| 152 | config SCHED_DEBUG_TRACE_SHIFT | ||
| 153 | int "Buffer size for TRACE() buffer" | ||
| 154 | depends on SCHED_DEBUG_TRACE | ||
| 155 | range 14 22 | ||
| 156 | default 18 | ||
| 157 | help | ||
| 158 | |||
| 159 | Select the amount of memory needed per CPU for the TRACE() buffer, as a | ||
| 160 | power of two. The TRACE() buffer is global and statically allocated. If | ||
| 161 | the buffer is too small, there will be holes in the TRACE() log if the | ||
| 162 | buffer-flushing task is starved. | ||
| 163 | |||
| 164 | The default should be sufficient for most systems. Increase the buffer | ||
| 165 | size if the log contains holes. Reduce the buffer size when running on | ||
| 166 | a memory-constrained system. | ||
| 167 | |||
| 168 | Examples: 14 => 16KB | ||
| 169 | 18 => 256KB | ||
| 170 | 20 => 1MB | ||
| 171 | |||
| 152 | endmenu | 172 | endmenu |
| 153 | 173 | ||
| 154 | endmenu | 174 | endmenu |
diff --git a/litmus/sched_trace.c b/litmus/sched_trace.c index 9b03e0cfe82b..f4171fddbbb1 100644 --- a/litmus/sched_trace.c +++ b/litmus/sched_trace.c | |||
| @@ -18,14 +18,14 @@ | |||
| 18 | 18 | ||
| 19 | #define SCHED_TRACE_NAME "litmus/log" | 19 | #define SCHED_TRACE_NAME "litmus/log" |
| 20 | 20 | ||
| 21 | /* Allocate a buffer of about 32k per CPU */ | 21 | /* Compute size of TRACE() buffer */ |
| 22 | #define LITMUS_TRACE_BUF_PAGES 64 | 22 | #define LITMUS_TRACE_BUF_SIZE (1 << CONFIG_SCHED_DEBUG_TRACE_SHIFT) |
| 23 | #define LITMUS_TRACE_BUF_SIZE (PAGE_SIZE * LITMUS_TRACE_BUF_PAGES * NR_CPUS) | ||
| 24 | 23 | ||
| 25 | /* Max length of one read from the buffer */ | 24 | /* Max length of one read from the buffer */ |
| 26 | #define MAX_READ_LEN (64 * 1024) | 25 | #define MAX_READ_LEN (64 * 1024) |
| 27 | 26 | ||
| 28 | /* Max length for one write --- from kernel --- to the buffer */ | 27 | /* Max length for one write --- by TRACE() --- to the buffer. This is used to |
| 28 | * allocate a per-cpu buffer for printf() formatting. */ | ||
| 29 | #define MSG_SIZE 255 | 29 | #define MSG_SIZE 255 |
| 30 | 30 | ||
| 31 | 31 | ||
