Skip to content

Commit bd2172f

Browse files
author
Robert Richter
committed
oprofile: rename kernel-wide identifiers
This patch renames kernel-wide identifiers to something more oprofile specific names. Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Robert Richter <robert.richter@amd.com>
1 parent d69d59f commit bd2172f

5 files changed

Lines changed: 28 additions & 27 deletions

File tree

‎drivers/oprofile/cpu_buffer.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void free_cpu_buffers(void)
6666

6767
unsigned long oprofile_get_cpu_buffer_size(void)
6868
{
69-
return fs_cpu_buffer_size;
69+
return oprofile_cpu_buffer_size;
7070
}
7171

7272
void oprofile_cpu_buffer_inc_smpl_lost(void)
@@ -81,7 +81,7 @@ int alloc_cpu_buffers(void)
8181
{
8282
int i;
8383

84-
unsigned long buffer_size = fs_cpu_buffer_size;
84+
unsigned long buffer_size = oprofile_cpu_buffer_size;
8585

8686
op_ring_buffer_read = ring_buffer_alloc(buffer_size, OP_BUFFER_FLAGS);
8787
if (!op_ring_buffer_read)
@@ -238,7 +238,7 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
238238
{
239239
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer);
240240

241-
if (!backtrace_depth) {
241+
if (!oprofile_backtrace_depth) {
242242
log_sample(cpu_buf, pc, is_kernel, event);
243243
return;
244244
}
@@ -251,7 +251,7 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
251251
* source of this event
252252
*/
253253
if (log_sample(cpu_buf, pc, is_kernel, event))
254-
oprofile_ops.backtrace(regs, backtrace_depth);
254+
oprofile_ops.backtrace(regs, oprofile_backtrace_depth);
255255
oprofile_end_trace(cpu_buf);
256256
}
257257

@@ -308,8 +308,8 @@ void oprofile_add_ibs_sample(struct pt_regs * const regs,
308308
if (fail)
309309
goto fail;
310310

311-
if (backtrace_depth)
312-
oprofile_ops.backtrace(regs, backtrace_depth);
311+
if (oprofile_backtrace_depth)
312+
oprofile_ops.backtrace(regs, oprofile_backtrace_depth);
313313

314314
return;
315315

‎drivers/oprofile/event_buffer.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ int alloc_event_buffer(void)
7373
unsigned long flags;
7474

7575
spin_lock_irqsave(&oprofilefs_lock, flags);
76-
buffer_size = fs_buffer_size;
77-
buffer_watershed = fs_buffer_watershed;
76+
buffer_size = oprofile_buffer_size;
77+
buffer_watershed = oprofile_buffer_watershed;
7878
spin_unlock_irqrestore(&oprofilefs_lock, flags);
7979

8080
if (buffer_watershed >= buffer_size)

‎drivers/oprofile/oprof.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
struct oprofile_operations oprofile_ops;
2424

2525
unsigned long oprofile_started;
26-
unsigned long backtrace_depth;
26+
unsigned long oprofile_backtrace_depth;
2727
static unsigned long is_setup;
2828
static DEFINE_MUTEX(start_mutex);
2929

@@ -172,7 +172,7 @@ int oprofile_set_backtrace(unsigned long val)
172172
goto out;
173173
}
174174

175-
backtrace_depth = val;
175+
oprofile_backtrace_depth = val;
176176

177177
out:
178178
mutex_unlock(&start_mutex);

‎drivers/oprofile/oprof.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ void oprofile_stop(void);
2121

2222
struct oprofile_operations;
2323

24-
extern unsigned long fs_buffer_size;
25-
extern unsigned long fs_cpu_buffer_size;
26-
extern unsigned long fs_buffer_watershed;
24+
extern unsigned long oprofile_buffer_size;
25+
extern unsigned long oprofile_cpu_buffer_size;
26+
extern unsigned long oprofile_buffer_watershed;
2727
extern struct oprofile_operations oprofile_ops;
2828
extern unsigned long oprofile_started;
29-
extern unsigned long backtrace_depth;
29+
extern unsigned long oprofile_backtrace_depth;
3030

3131
struct super_block;
3232
struct dentry;

‎drivers/oprofile/oprofile_files.c‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
#include "oprofile_stats.h"
1515
#include "oprof.h"
1616

17-
#define FS_BUFFER_SIZE_DEFAULT 131072
18-
#define FS_CPU_BUFFER_SIZE_DEFAULT 8192
19-
#define FS_BUFFER_WATERSHED_DEFAULT 32768 /* FIXME: tune */
17+
#define BUFFER_SIZE_DEFAULT 131072
18+
#define CPU_BUFFER_SIZE_DEFAULT 8192
19+
#define BUFFER_WATERSHED_DEFAULT 32768 /* FIXME: tune */
2020

21-
unsigned long fs_buffer_size;
22-
unsigned long fs_cpu_buffer_size;
23-
unsigned long fs_buffer_watershed;
21+
unsigned long oprofile_buffer_size;
22+
unsigned long oprofile_cpu_buffer_size;
23+
unsigned long oprofile_buffer_watershed;
2424

2525
static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
2626
{
27-
return oprofilefs_ulong_to_user(backtrace_depth, buf, count, offset);
27+
return oprofilefs_ulong_to_user(oprofile_backtrace_depth, buf, count,
28+
offset);
2829
}
2930

3031

@@ -125,16 +126,16 @@ static const struct file_operations dump_fops = {
125126
void oprofile_create_files(struct super_block *sb, struct dentry *root)
126127
{
127128
/* reinitialize default values */
128-
fs_buffer_size = FS_BUFFER_SIZE_DEFAULT;
129-
fs_cpu_buffer_size = FS_CPU_BUFFER_SIZE_DEFAULT;
130-
fs_buffer_watershed = FS_BUFFER_WATERSHED_DEFAULT;
129+
oprofile_buffer_size = BUFFER_SIZE_DEFAULT;
130+
oprofile_cpu_buffer_size = CPU_BUFFER_SIZE_DEFAULT;
131+
oprofile_buffer_watershed = BUFFER_WATERSHED_DEFAULT;
131132

132133
oprofilefs_create_file(sb, root, "enable", &enable_fops);
133134
oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666);
134135
oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
135-
oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size);
136-
oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
137-
oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &fs_cpu_buffer_size);
136+
oprofilefs_create_ulong(sb, root, "buffer_size", &oprofile_buffer_size);
137+
oprofilefs_create_ulong(sb, root, "buffer_watershed", &oprofile_buffer_watershed);
138+
oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &oprofile_cpu_buffer_size);
138139
oprofilefs_create_file(sb, root, "cpu_type", &cpu_type_fops);
139140
oprofilefs_create_file(sb, root, "backtrace_depth", &depth_fops);
140141
oprofilefs_create_file(sb, root, "pointer_size", &pointer_size_fops);

0 commit comments

Comments
 (0)