diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-16 11:13:10 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-16 11:22:45 -0500 |
commit | d922f5eb1c375ab0445240110656c1d793eaad04 (patch) | |
tree | b690dc794494a454468698c8e15c8f7d9ffad1fb /litmus/sched_trace.c | |
parent | 6fbc3b495cccf2e4ab7d4ab674b5c576e9946bed (diff) |
Make TRACE() buffer size configurable
Let the user choose an appropriate buffer size (instead of scaling
with NR_CPUS). The kfifo api requires the buffer to be a power of
two, so enforce this constraint in the configuration.
This fixes a previously-existing compile-time error for values of
NR_CPU that are not a power of two.
Based on a patch by Mac Mollison <mollison@cs.unc.edu>.
Diffstat (limited to 'litmus/sched_trace.c')
-rw-r--r-- | litmus/sched_trace.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 | ||