aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/profile.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-03-23 06:00:24 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 10:38:10 -0500
commit97d1f15b7ef52c1e9c28dc48b454024bb53a5fd2 (patch)
tree7bdb928096eec577e75897351f639d3f94441c87 /kernel/profile.c
parente723ccd805857a46d3b63fbd20edea8579c6c541 (diff)
[PATCH] sem2mutex: kernel/
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/profile.c')
-rw-r--r--kernel/profile.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/profile.c b/kernel/profile.c
index f89248e6d704..ad81f799a9b4 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -23,6 +23,7 @@
23#include <linux/cpu.h> 23#include <linux/cpu.h>
24#include <linux/profile.h> 24#include <linux/profile.h>
25#include <linux/highmem.h> 25#include <linux/highmem.h>
26#include <linux/mutex.h>
26#include <asm/sections.h> 27#include <asm/sections.h>
27#include <asm/semaphore.h> 28#include <asm/semaphore.h>
28 29
@@ -44,7 +45,7 @@ static cpumask_t prof_cpu_mask = CPU_MASK_ALL;
44#ifdef CONFIG_SMP 45#ifdef CONFIG_SMP
45static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits); 46static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
46static DEFINE_PER_CPU(int, cpu_profile_flip); 47static DEFINE_PER_CPU(int, cpu_profile_flip);
47static DECLARE_MUTEX(profile_flip_mutex); 48static DEFINE_MUTEX(profile_flip_mutex);
48#endif /* CONFIG_SMP */ 49#endif /* CONFIG_SMP */
49 50
50static int __init profile_setup(char * str) 51static int __init profile_setup(char * str)
@@ -243,7 +244,7 @@ static void profile_flip_buffers(void)
243{ 244{
244 int i, j, cpu; 245 int i, j, cpu;
245 246
246 down(&profile_flip_mutex); 247 mutex_lock(&profile_flip_mutex);
247 j = per_cpu(cpu_profile_flip, get_cpu()); 248 j = per_cpu(cpu_profile_flip, get_cpu());
248 put_cpu(); 249 put_cpu();
249 on_each_cpu(__profile_flip_buffers, NULL, 0, 1); 250 on_each_cpu(__profile_flip_buffers, NULL, 0, 1);
@@ -259,14 +260,14 @@ static void profile_flip_buffers(void)
259 hits[i].hits = hits[i].pc = 0; 260 hits[i].hits = hits[i].pc = 0;
260 } 261 }
261 } 262 }
262 up(&profile_flip_mutex); 263 mutex_unlock(&profile_flip_mutex);
263} 264}
264 265
265static void profile_discard_flip_buffers(void) 266static void profile_discard_flip_buffers(void)
266{ 267{
267 int i, cpu; 268 int i, cpu;
268 269
269 down(&profile_flip_mutex); 270 mutex_lock(&profile_flip_mutex);
270 i = per_cpu(cpu_profile_flip, get_cpu()); 271 i = per_cpu(cpu_profile_flip, get_cpu());
271 put_cpu(); 272 put_cpu();
272 on_each_cpu(__profile_flip_buffers, NULL, 0, 1); 273 on_each_cpu(__profile_flip_buffers, NULL, 0, 1);
@@ -274,7 +275,7 @@ static void profile_discard_flip_buffers(void)
274 struct profile_hit *hits = per_cpu(cpu_profile_hits, cpu)[i]; 275 struct profile_hit *hits = per_cpu(cpu_profile_hits, cpu)[i];
275 memset(hits, 0, NR_PROFILE_HIT*sizeof(struct profile_hit)); 276 memset(hits, 0, NR_PROFILE_HIT*sizeof(struct profile_hit));
276 } 277 }
277 up(&profile_flip_mutex); 278 mutex_unlock(&profile_flip_mutex);
278} 279}
279 280
280void profile_hit(int type, void *__pc) 281void profile_hit(int type, void *__pc)