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>
This commit is contained in:
parent
d69d59f497
commit
bd2172f580
5 changed files with 28 additions and 27 deletions
|
@ -66,7 +66,7 @@ void free_cpu_buffers(void)
|
||||||
|
|
||||||
unsigned long oprofile_get_cpu_buffer_size(void)
|
unsigned long oprofile_get_cpu_buffer_size(void)
|
||||||
{
|
{
|
||||||
return fs_cpu_buffer_size;
|
return oprofile_cpu_buffer_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
void oprofile_cpu_buffer_inc_smpl_lost(void)
|
void oprofile_cpu_buffer_inc_smpl_lost(void)
|
||||||
|
@ -81,7 +81,7 @@ int alloc_cpu_buffers(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
unsigned long buffer_size = fs_cpu_buffer_size;
|
unsigned long buffer_size = oprofile_cpu_buffer_size;
|
||||||
|
|
||||||
op_ring_buffer_read = ring_buffer_alloc(buffer_size, OP_BUFFER_FLAGS);
|
op_ring_buffer_read = ring_buffer_alloc(buffer_size, OP_BUFFER_FLAGS);
|
||||||
if (!op_ring_buffer_read)
|
if (!op_ring_buffer_read)
|
||||||
|
@ -238,7 +238,7 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
|
||||||
{
|
{
|
||||||
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer);
|
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(cpu_buffer);
|
||||||
|
|
||||||
if (!backtrace_depth) {
|
if (!oprofile_backtrace_depth) {
|
||||||
log_sample(cpu_buf, pc, is_kernel, event);
|
log_sample(cpu_buf, pc, is_kernel, event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
|
||||||
* source of this event
|
* source of this event
|
||||||
*/
|
*/
|
||||||
if (log_sample(cpu_buf, pc, is_kernel, event))
|
if (log_sample(cpu_buf, pc, is_kernel, event))
|
||||||
oprofile_ops.backtrace(regs, backtrace_depth);
|
oprofile_ops.backtrace(regs, oprofile_backtrace_depth);
|
||||||
oprofile_end_trace(cpu_buf);
|
oprofile_end_trace(cpu_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,8 +308,8 @@ void oprofile_add_ibs_sample(struct pt_regs * const regs,
|
||||||
if (fail)
|
if (fail)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (backtrace_depth)
|
if (oprofile_backtrace_depth)
|
||||||
oprofile_ops.backtrace(regs, backtrace_depth);
|
oprofile_ops.backtrace(regs, oprofile_backtrace_depth);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -73,8 +73,8 @@ int alloc_event_buffer(void)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&oprofilefs_lock, flags);
|
spin_lock_irqsave(&oprofilefs_lock, flags);
|
||||||
buffer_size = fs_buffer_size;
|
buffer_size = oprofile_buffer_size;
|
||||||
buffer_watershed = fs_buffer_watershed;
|
buffer_watershed = oprofile_buffer_watershed;
|
||||||
spin_unlock_irqrestore(&oprofilefs_lock, flags);
|
spin_unlock_irqrestore(&oprofilefs_lock, flags);
|
||||||
|
|
||||||
if (buffer_watershed >= buffer_size)
|
if (buffer_watershed >= buffer_size)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
struct oprofile_operations oprofile_ops;
|
struct oprofile_operations oprofile_ops;
|
||||||
|
|
||||||
unsigned long oprofile_started;
|
unsigned long oprofile_started;
|
||||||
unsigned long backtrace_depth;
|
unsigned long oprofile_backtrace_depth;
|
||||||
static unsigned long is_setup;
|
static unsigned long is_setup;
|
||||||
static DEFINE_MUTEX(start_mutex);
|
static DEFINE_MUTEX(start_mutex);
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ int oprofile_set_backtrace(unsigned long val)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
backtrace_depth = val;
|
oprofile_backtrace_depth = val;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&start_mutex);
|
mutex_unlock(&start_mutex);
|
||||||
|
|
|
@ -21,12 +21,12 @@ void oprofile_stop(void);
|
||||||
|
|
||||||
struct oprofile_operations;
|
struct oprofile_operations;
|
||||||
|
|
||||||
extern unsigned long fs_buffer_size;
|
extern unsigned long oprofile_buffer_size;
|
||||||
extern unsigned long fs_cpu_buffer_size;
|
extern unsigned long oprofile_cpu_buffer_size;
|
||||||
extern unsigned long fs_buffer_watershed;
|
extern unsigned long oprofile_buffer_watershed;
|
||||||
extern struct oprofile_operations oprofile_ops;
|
extern struct oprofile_operations oprofile_ops;
|
||||||
extern unsigned long oprofile_started;
|
extern unsigned long oprofile_started;
|
||||||
extern unsigned long backtrace_depth;
|
extern unsigned long oprofile_backtrace_depth;
|
||||||
|
|
||||||
struct super_block;
|
struct super_block;
|
||||||
struct dentry;
|
struct dentry;
|
||||||
|
|
|
@ -14,17 +14,18 @@
|
||||||
#include "oprofile_stats.h"
|
#include "oprofile_stats.h"
|
||||||
#include "oprof.h"
|
#include "oprof.h"
|
||||||
|
|
||||||
#define FS_BUFFER_SIZE_DEFAULT 131072
|
#define BUFFER_SIZE_DEFAULT 131072
|
||||||
#define FS_CPU_BUFFER_SIZE_DEFAULT 8192
|
#define CPU_BUFFER_SIZE_DEFAULT 8192
|
||||||
#define FS_BUFFER_WATERSHED_DEFAULT 32768 /* FIXME: tune */
|
#define BUFFER_WATERSHED_DEFAULT 32768 /* FIXME: tune */
|
||||||
|
|
||||||
unsigned long fs_buffer_size;
|
unsigned long oprofile_buffer_size;
|
||||||
unsigned long fs_cpu_buffer_size;
|
unsigned long oprofile_cpu_buffer_size;
|
||||||
unsigned long fs_buffer_watershed;
|
unsigned long oprofile_buffer_watershed;
|
||||||
|
|
||||||
static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
|
static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
|
||||||
{
|
{
|
||||||
return oprofilefs_ulong_to_user(backtrace_depth, buf, count, offset);
|
return oprofilefs_ulong_to_user(oprofile_backtrace_depth, buf, count,
|
||||||
|
offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,16 +126,16 @@ static const struct file_operations dump_fops = {
|
||||||
void oprofile_create_files(struct super_block *sb, struct dentry *root)
|
void oprofile_create_files(struct super_block *sb, struct dentry *root)
|
||||||
{
|
{
|
||||||
/* reinitialize default values */
|
/* reinitialize default values */
|
||||||
fs_buffer_size = FS_BUFFER_SIZE_DEFAULT;
|
oprofile_buffer_size = BUFFER_SIZE_DEFAULT;
|
||||||
fs_cpu_buffer_size = FS_CPU_BUFFER_SIZE_DEFAULT;
|
oprofile_cpu_buffer_size = CPU_BUFFER_SIZE_DEFAULT;
|
||||||
fs_buffer_watershed = FS_BUFFER_WATERSHED_DEFAULT;
|
oprofile_buffer_watershed = BUFFER_WATERSHED_DEFAULT;
|
||||||
|
|
||||||
oprofilefs_create_file(sb, root, "enable", &enable_fops);
|
oprofilefs_create_file(sb, root, "enable", &enable_fops);
|
||||||
oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666);
|
oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666);
|
||||||
oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
|
oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
|
||||||
oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size);
|
oprofilefs_create_ulong(sb, root, "buffer_size", &oprofile_buffer_size);
|
||||||
oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
|
oprofilefs_create_ulong(sb, root, "buffer_watershed", &oprofile_buffer_watershed);
|
||||||
oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &fs_cpu_buffer_size);
|
oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &oprofile_cpu_buffer_size);
|
||||||
oprofilefs_create_file(sb, root, "cpu_type", &cpu_type_fops);
|
oprofilefs_create_file(sb, root, "cpu_type", &cpu_type_fops);
|
||||||
oprofilefs_create_file(sb, root, "backtrace_depth", &depth_fops);
|
oprofilefs_create_file(sb, root, "backtrace_depth", &depth_fops);
|
||||||
oprofilefs_create_file(sb, root, "pointer_size", &pointer_size_fops);
|
oprofilefs_create_file(sb, root, "pointer_size", &pointer_size_fops);
|
||||||
|
|
Loading…
Add table
Reference in a new issue