diff options
author | Robert Richter <robert.richter@amd.com> | 2008-09-24 05:08:52 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2008-09-24 05:08:52 -0400 |
commit | 4c168eaf7ea39f25a45a3d8c7eebc3fedb633a1d (patch) | |
tree | 315bb66a3ce2e752749a780876e2b7b5f6a596de /drivers/oprofile/oprof.c | |
parent | 45f197ade73ba95681b9803680c75352fc0a1c0a (diff) |
Revert "Oprofile Multiplexing Patch"
Reverting commit 1a960b402a51d80abf54e3f8e4972374ffe5f22d for the main
branch. Multiplexing will be tracked on a separate feature branch.
Conflicts:
arch/x86/oprofile/nmi_int.c
Diffstat (limited to 'drivers/oprofile/oprof.c')
-rw-r--r-- | drivers/oprofile/oprof.c | 58 |
1 files changed, 3 insertions, 55 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c index b2fa5df64a62..2c645170f06e 100644 --- a/drivers/oprofile/oprof.c +++ b/drivers/oprofile/oprof.c | |||
@@ -12,8 +12,6 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/oprofile.h> | 13 | #include <linux/oprofile.h> |
14 | #include <linux/moduleparam.h> | 14 | #include <linux/moduleparam.h> |
15 | #include <linux/workqueue.h> | ||
16 | #include <linux/time.h> | ||
17 | #include <asm/mutex.h> | 15 | #include <asm/mutex.h> |
18 | 16 | ||
19 | #include "oprof.h" | 17 | #include "oprof.h" |
@@ -21,18 +19,13 @@ | |||
21 | #include "cpu_buffer.h" | 19 | #include "cpu_buffer.h" |
22 | #include "buffer_sync.h" | 20 | #include "buffer_sync.h" |
23 | #include "oprofile_stats.h" | 21 | #include "oprofile_stats.h" |
24 | |||
25 | static unsigned long is_setup; | ||
26 | static void switch_worker(struct work_struct *work); | ||
27 | static DECLARE_DELAYED_WORK(switch_work, switch_worker); | ||
28 | static DEFINE_MUTEX(start_mutex); | ||
29 | 22 | ||
30 | struct oprofile_operations oprofile_ops; | 23 | struct oprofile_operations oprofile_ops; |
31 | 24 | ||
32 | unsigned long timeout_jiffies; | ||
33 | unsigned long oprofile_started; | 25 | unsigned long oprofile_started; |
34 | unsigned long backtrace_depth; | 26 | unsigned long backtrace_depth; |
35 | /* Multiplexing defaults at 1 msec*/ | 27 | static unsigned long is_setup; |
28 | static DEFINE_MUTEX(start_mutex); | ||
36 | 29 | ||
37 | /* timer | 30 | /* timer |
38 | 0 - use performance monitoring hardware if available | 31 | 0 - use performance monitoring hardware if available |
@@ -94,16 +87,6 @@ out: | |||
94 | return err; | 87 | return err; |
95 | } | 88 | } |
96 | 89 | ||
97 | static void start_switch_worker(void) | ||
98 | { | ||
99 | schedule_delayed_work(&switch_work, timeout_jiffies); | ||
100 | } | ||
101 | |||
102 | static void switch_worker(struct work_struct *work) | ||
103 | { | ||
104 | if (!oprofile_ops.switch_events()) | ||
105 | start_switch_worker(); | ||
106 | } | ||
107 | 90 | ||
108 | /* Actually start profiling (echo 1>/dev/oprofile/enable) */ | 91 | /* Actually start profiling (echo 1>/dev/oprofile/enable) */ |
109 | int oprofile_start(void) | 92 | int oprofile_start(void) |
@@ -111,6 +94,7 @@ int oprofile_start(void) | |||
111 | int err = -EINVAL; | 94 | int err = -EINVAL; |
112 | 95 | ||
113 | mutex_lock(&start_mutex); | 96 | mutex_lock(&start_mutex); |
97 | |||
114 | if (!is_setup) | 98 | if (!is_setup) |
115 | goto out; | 99 | goto out; |
116 | 100 | ||
@@ -124,9 +108,6 @@ int oprofile_start(void) | |||
124 | if ((err = oprofile_ops.start())) | 108 | if ((err = oprofile_ops.start())) |
125 | goto out; | 109 | goto out; |
126 | 110 | ||
127 | if (oprofile_ops.switch_events) | ||
128 | start_switch_worker(); | ||
129 | |||
130 | oprofile_started = 1; | 111 | oprofile_started = 1; |
131 | out: | 112 | out: |
132 | mutex_unlock(&start_mutex); | 113 | mutex_unlock(&start_mutex); |
@@ -142,7 +123,6 @@ void oprofile_stop(void) | |||
142 | goto out; | 123 | goto out; |
143 | oprofile_ops.stop(); | 124 | oprofile_ops.stop(); |
144 | oprofile_started = 0; | 125 | oprofile_started = 0; |
145 | cancel_delayed_work_sync(&switch_work); | ||
146 | /* wake up the daemon to read what remains */ | 126 | /* wake up the daemon to read what remains */ |
147 | wake_up_buffer_waiter(); | 127 | wake_up_buffer_waiter(); |
148 | out: | 128 | out: |
@@ -175,32 +155,6 @@ post_sync: | |||
175 | mutex_unlock(&start_mutex); | 155 | mutex_unlock(&start_mutex); |
176 | } | 156 | } |
177 | 157 | ||
178 | /* User inputs in ms, converts to jiffies */ | ||
179 | int oprofile_set_timeout(unsigned long val_msec) | ||
180 | { | ||
181 | int err = 0; | ||
182 | |||
183 | mutex_lock(&start_mutex); | ||
184 | |||
185 | if (oprofile_started) { | ||
186 | err = -EBUSY; | ||
187 | goto out; | ||
188 | } | ||
189 | |||
190 | if (!oprofile_ops.switch_events) { | ||
191 | err = -EINVAL; | ||
192 | goto out; | ||
193 | } | ||
194 | |||
195 | timeout_jiffies = msecs_to_jiffies(val_msec); | ||
196 | if (timeout_jiffies == MAX_JIFFY_OFFSET) | ||
197 | timeout_jiffies = msecs_to_jiffies(1); | ||
198 | |||
199 | out: | ||
200 | mutex_unlock(&start_mutex); | ||
201 | return err; | ||
202 | |||
203 | } | ||
204 | 158 | ||
205 | int oprofile_set_backtrace(unsigned long val) | 159 | int oprofile_set_backtrace(unsigned long val) |
206 | { | 160 | { |
@@ -225,16 +179,10 @@ out: | |||
225 | return err; | 179 | return err; |
226 | } | 180 | } |
227 | 181 | ||
228 | static void __init oprofile_switch_timer_init(void) | ||
229 | { | ||
230 | timeout_jiffies = msecs_to_jiffies(1); | ||
231 | } | ||
232 | |||
233 | static int __init oprofile_init(void) | 182 | static int __init oprofile_init(void) |
234 | { | 183 | { |
235 | int err; | 184 | int err; |
236 | 185 | ||
237 | oprofile_switch_timer_init(); | ||
238 | err = oprofile_arch_init(&oprofile_ops); | 186 | err = oprofile_arch_init(&oprofile_ops); |
239 | 187 | ||
240 | if (err < 0 || timer) { | 188 | if (err < 0 || timer) { |