summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'driver/gator_trace_sched.c')
-rw-r--r--driver/gator_trace_sched.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/driver/gator_trace_sched.c b/driver/gator_trace_sched.c
index 332b3f6..52990e9 100644
--- a/driver/gator_trace_sched.c
+++ b/driver/gator_trace_sched.c
@@ -1,5 +1,5 @@
1/** 1/**
2 * Copyright (C) ARM Limited 2010-2013. All rights reserved. 2 * Copyright (C) ARM Limited 2010-2014. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
@@ -22,7 +22,6 @@ enum {
22 22
23static DEFINE_PER_CPU(uint64_t *, taskname_keys); 23static DEFINE_PER_CPU(uint64_t *, taskname_keys);
24static DEFINE_PER_CPU(int, collecting); 24static DEFINE_PER_CPU(int, collecting);
25static DEFINE_PER_CPU(bool, in_scheduler_context);
26 25
27// this array is never read as the cpu wait charts are derived counters 26// this array is never read as the cpu wait charts are derived counters
28// the files are needed, nonetheless, to show that these counters are available 27// the files are needed, nonetheless, to show that these counters are available
@@ -52,7 +51,7 @@ static int sched_trace_create_files(struct super_block *sb, struct dentry *root)
52 return 0; 51 return 0;
53} 52}
54 53
55void emit_pid_name(struct task_struct *task) 54static void emit_pid_name(struct task_struct *task)
56{ 55{
57 bool found = false; 56 bool found = false;
58 char taskcomm[TASK_COMM_LEN + 3]; 57 char taskcomm[TASK_COMM_LEN + 3];
@@ -116,20 +115,21 @@ static void collect_counters(u64 time, struct task_struct *task)
116 // Commit buffers on timeout 115 // Commit buffers on timeout
117 if (gator_live_rate > 0 && time >= per_cpu(gator_buffer_commit_time, cpu)) { 116 if (gator_live_rate > 0 && time >= per_cpu(gator_buffer_commit_time, cpu)) {
118 static const int buftypes[] = { NAME_BUF, COUNTER_BUF, BLOCK_COUNTER_BUF, SCHED_TRACE_BUF }; 117 static const int buftypes[] = { NAME_BUF, COUNTER_BUF, BLOCK_COUNTER_BUF, SCHED_TRACE_BUF };
119 unsigned long flags;
120 int i; 118 int i;
121 119
122 local_irq_save(flags);
123 for (i = 0; i < ARRAY_SIZE(buftypes); ++i) { 120 for (i = 0; i < ARRAY_SIZE(buftypes); ++i) {
124 gator_commit_buffer(cpu, buftypes[i], time); 121 gator_commit_buffer(cpu, buftypes[i], time);
125 } 122 }
126 local_irq_restore(flags);
127 123
124 // spinlocks are noops on uniprocessor machines and mutexes do not work in sched_switch context in
125 // RT-Preempt full, so disable proactive flushing of the annotate frame on uniprocessor machines.
126#ifdef CONFIG_SMP
128 // Try to preemptively flush the annotate buffer to reduce the chance of the buffer being full 127 // Try to preemptively flush the annotate buffer to reduce the chance of the buffer being full
129 if (on_primary_core() && spin_trylock(&annotate_lock)) { 128 if (on_primary_core() && spin_trylock(&annotate_lock)) {
130 gator_commit_buffer(0, ANNOTATE_BUF, time); 129 gator_commit_buffer(0, ANNOTATE_BUF, time);
131 spin_unlock(&annotate_lock); 130 spin_unlock(&annotate_lock);
132 } 131 }
132#endif
133 } 133 }
134 } 134 }
135} 135}
@@ -222,7 +222,7 @@ fail_sched_process_fork:
222 return -1; 222 return -1;
223} 223}
224 224
225int gator_trace_sched_start(void) 225static int gator_trace_sched_start(void)
226{ 226{
227 int cpu, size; 227 int cpu, size;
228 228
@@ -237,7 +237,7 @@ int gator_trace_sched_start(void)
237 return register_scheduler_tracepoints(); 237 return register_scheduler_tracepoints();
238} 238}
239 239
240void gator_trace_sched_offline(void) 240static void gator_trace_sched_offline(void)
241{ 241{
242 trace_sched_insert_idle(); 242 trace_sched_insert_idle();
243} 243}
@@ -250,7 +250,7 @@ static void unregister_scheduler_tracepoints(void)
250 pr_debug("gator: unregistered tracepoints\n"); 250 pr_debug("gator: unregistered tracepoints\n");
251} 251}
252 252
253void gator_trace_sched_stop(void) 253static void gator_trace_sched_stop(void)
254{ 254{
255 int cpu; 255 int cpu;
256 unregister_scheduler_tracepoints(); 256 unregister_scheduler_tracepoints();
@@ -260,7 +260,7 @@ void gator_trace_sched_stop(void)
260 } 260 }
261} 261}
262 262
263void gator_trace_sched_init(void) 263static void gator_trace_sched_init(void)
264{ 264{
265 int i; 265 int i;
266 for (i = 0; i < CPU_WAIT_TOTAL; i++) { 266 for (i = 0; i < CPU_WAIT_TOTAL; i++) {