aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris')
-rw-r--r--arch/cris/kernel/profile.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c
index b917549a7d94..195ec5fa0dd2 100644
--- a/arch/cris/kernel/profile.c
+++ b/arch/cris/kernel/profile.c
@@ -9,12 +9,11 @@
9 9
10#define SAMPLE_BUFFER_SIZE 8192 10#define SAMPLE_BUFFER_SIZE 8192
11 11
12static char* sample_buffer; 12static char *sample_buffer;
13static char* sample_buffer_pos; 13static char *sample_buffer_pos;
14static int prof_running = 0; 14static int prof_running = 0;
15 15
16void 16void cris_profile_sample(struct pt_regs *regs)
17cris_profile_sample(struct pt_regs* regs)
18{ 17{
19 if (!prof_running) 18 if (!prof_running)
20 return; 19 return;
@@ -24,7 +23,7 @@ cris_profile_sample(struct pt_regs* regs)
24 else 23 else
25 *(unsigned int*)sample_buffer_pos = 0; 24 *(unsigned int*)sample_buffer_pos = 0;
26 25
27 *(unsigned int*)(sample_buffer_pos + 4) = instruction_pointer(regs); 26 *(unsigned int *)(sample_buffer_pos + 4) = instruction_pointer(regs);
28 sample_buffer_pos += 8; 27 sample_buffer_pos += 8;
29 28
30 if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE) 29 if (sample_buffer_pos == sample_buffer + SAMPLE_BUFFER_SIZE)
@@ -54,6 +53,7 @@ write_cris_profile(struct file *file, const char __user *buf,
54{ 53{
55 sample_buffer_pos = sample_buffer; 54 sample_buffer_pos = sample_buffer;
56 memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); 55 memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE);
56 return count < SAMPLE_BUFFER_SIZE ? count : SAMPLE_BUFFER_SIZE;
57} 57}
58 58
59static const struct file_operations cris_proc_profile_operations = { 59static const struct file_operations cris_proc_profile_operations = {
@@ -61,8 +61,7 @@ static const struct file_operations cris_proc_profile_operations = {
61 .write = write_cris_profile, 61 .write = write_cris_profile,
62}; 62};
63 63
64static int 64static int __init init_cris_profile(void)
65__init init_cris_profile(void)
66{ 65{
67 struct proc_dir_entry *entry; 66 struct proc_dir_entry *entry;
68 67
@@ -82,5 +81,5 @@ __init init_cris_profile(void)
82 81
83 return 0; 82 return 0;
84} 83}
85
86__initcall(init_cris_profile); 84__initcall(init_cris_profile);
85