aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/buffer_sync.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-01-22 08:14:14 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-22 08:37:06 -0500
commit4c50d9ea9ca9e46b65aeffed3e0d6f54ff38c8d4 (patch)
treec153b251584bcfbfb8fbbf849400e28d2c8c3720 /drivers/oprofile/buffer_sync.c
parent5766b842b23c6b40935a5f3bd435b2bcdaff2143 (diff)
cpumask: modifiy oprofile initialization
Delta patch to f7df8ed164996cd2c6aca9674388be6ef78d8b37 for tip/cpus4096. Moved initialization to sync_start()/sync_stop(). No changes needed in buffer_sync.h and oprof.c anymore. Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r--drivers/oprofile/buffer_sync.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index c3ea5fa7d05..8574622e36a 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -154,6 +154,10 @@ int sync_start(void)
154{ 154{
155 int err; 155 int err;
156 156
157 if (!alloc_cpumask_var(&marked_cpus, GFP_KERNEL))
158 return -ENOMEM;
159 cpumask_clear(marked_cpus);
160
157 start_cpu_work(); 161 start_cpu_work();
158 162
159 err = task_handoff_register(&task_free_nb); 163 err = task_handoff_register(&task_free_nb);
@@ -179,6 +183,7 @@ out2:
179 task_handoff_unregister(&task_free_nb); 183 task_handoff_unregister(&task_free_nb);
180out1: 184out1:
181 end_sync(); 185 end_sync();
186 free_cpumask_var(marked_cpus);
182 goto out; 187 goto out;
183} 188}
184 189
@@ -190,6 +195,7 @@ void sync_stop(void)
190 profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb); 195 profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
191 task_handoff_unregister(&task_free_nb); 196 task_handoff_unregister(&task_free_nb);
192 end_sync(); 197 end_sync();
198 free_cpumask_var(marked_cpus);
193} 199}
194 200
195 201
@@ -565,20 +571,6 @@ void sync_buffer(int cpu)
565 mutex_unlock(&buffer_mutex); 571 mutex_unlock(&buffer_mutex);
566} 572}
567 573
568int __init buffer_sync_init(void)
569{
570 if (!alloc_cpumask_var(&marked_cpus, GFP_KERNEL))
571 return -ENOMEM;
572
573 cpumask_clear(marked_cpus);
574 return 0;
575}
576
577void __exit buffer_sync_cleanup(void)
578{
579 free_cpumask_var(marked_cpus);
580}
581
582/* The function can be used to add a buffer worth of data directly to 574/* The function can be used to add a buffer worth of data directly to
583 * the kernel buffer. The buffer is assumed to be a circular buffer. 575 * the kernel buffer. The buffer is assumed to be a circular buffer.
584 * Take the entries from index start and end at index end, wrapping 576 * Take the entries from index start and end at index end, wrapping