Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
ef7bca14
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ef7bca14
编写于
7月 19, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
oprofile: don't bother with passing superblock to ->create_files()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
a9e599e5
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
91 addition
and
93 deletion
+91
-93
arch/alpha/oprofile/common.c
arch/alpha/oprofile/common.c
+11
-11
arch/avr32/oprofile/op_model_avr32.c
arch/avr32/oprofile/op_model_avr32.c
+8
-9
arch/mips/oprofile/common.c
arch/mips/oprofile/common.c
+10
-10
arch/powerpc/oprofile/common.c
arch/powerpc/oprofile/common.c
+14
-14
arch/s390/oprofile/init.c
arch/s390/oprofile/init.c
+17
-18
arch/x86/oprofile/nmi_int.c
arch/x86/oprofile/nmi_int.c
+9
-9
arch/x86/oprofile/op_model_amd.c
arch/x86/oprofile/op_model_amd.c
+12
-12
drivers/oprofile/oprofile_files.c
drivers/oprofile/oprofile_files.c
+1
-1
drivers/oprofile/oprofile_perf.c
drivers/oprofile/oprofile_perf.c
+8
-8
include/linux/oprofile.h
include/linux/oprofile.h
+1
-1
未找到文件。
arch/alpha/oprofile/common.c
浏览文件 @
ef7bca14
...
@@ -106,7 +106,7 @@ op_axp_stop(void)
...
@@ -106,7 +106,7 @@ op_axp_stop(void)
}
}
static
int
static
int
op_axp_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
op_axp_create_files
(
struct
dentry
*
root
)
{
{
int
i
;
int
i
;
...
@@ -115,23 +115,23 @@ op_axp_create_files(struct super_block *sb, struct dentry *root)
...
@@ -115,23 +115,23 @@ op_axp_create_files(struct super_block *sb, struct dentry *root)
char
buf
[
4
];
char
buf
[
4
];
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
dir
=
oprofilefs_mkdir
(
sb
,
root
,
buf
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
buf
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enabled"
,
&
ctr
[
i
].
enabled
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
ctr
[
i
].
enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"event"
,
&
ctr
[
i
].
event
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"event"
,
&
ctr
[
i
].
event
);
oprofilefs_create_ulong
(
sb
,
dir
,
"count"
,
&
ctr
[
i
].
count
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"count"
,
&
ctr
[
i
].
count
);
/* Dummies. */
/* Dummies. */
oprofilefs_create_ulong
(
sb
,
dir
,
"kernel"
,
&
ctr
[
i
].
kernel
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"kernel"
,
&
ctr
[
i
].
kernel
);
oprofilefs_create_ulong
(
sb
,
dir
,
"user"
,
&
ctr
[
i
].
user
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"user"
,
&
ctr
[
i
].
user
);
oprofilefs_create_ulong
(
sb
,
dir
,
"unit_mask"
,
&
ctr
[
i
].
unit_mask
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"unit_mask"
,
&
ctr
[
i
].
unit_mask
);
}
}
if
(
model
->
can_set_proc_mode
)
{
if
(
model
->
can_set_proc_mode
)
{
oprofilefs_create_ulong
(
sb
,
root
,
"enable_pal"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"enable_pal"
,
&
sys
.
enable_pal
);
&
sys
.
enable_pal
);
oprofilefs_create_ulong
(
sb
,
root
,
"enable_kernel"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"enable_kernel"
,
&
sys
.
enable_kernel
);
&
sys
.
enable_kernel
);
oprofilefs_create_ulong
(
sb
,
root
,
"enable_user"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"enable_user"
,
&
sys
.
enable_user
);
&
sys
.
enable_user
);
}
}
...
...
arch/avr32/oprofile/op_model_avr32.c
浏览文件 @
ef7bca14
...
@@ -97,8 +97,7 @@ static irqreturn_t avr32_perf_counter_interrupt(int irq, void *dev_id)
...
@@ -97,8 +97,7 @@ static irqreturn_t avr32_perf_counter_interrupt(int irq, void *dev_id)
return
IRQ_HANDLED
;
return
IRQ_HANDLED
;
}
}
static
int
avr32_perf_counter_create_files
(
struct
super_block
*
sb
,
static
int
avr32_perf_counter_create_files
(
struct
dentry
*
root
)
struct
dentry
*
root
)
{
{
struct
dentry
*
dir
;
struct
dentry
*
dir
;
unsigned
int
i
;
unsigned
int
i
;
...
@@ -106,21 +105,21 @@ static int avr32_perf_counter_create_files(struct super_block *sb,
...
@@ -106,21 +105,21 @@ static int avr32_perf_counter_create_files(struct super_block *sb,
for
(
i
=
0
;
i
<
NR_counter
;
i
++
)
{
for
(
i
=
0
;
i
<
NR_counter
;
i
++
)
{
snprintf
(
filename
,
sizeof
(
filename
),
"%u"
,
i
);
snprintf
(
filename
,
sizeof
(
filename
),
"%u"
,
i
);
dir
=
oprofilefs_mkdir
(
sb
,
root
,
filename
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
filename
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enabled"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
counter
[
i
].
enabled
);
&
counter
[
i
].
enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"event"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"event"
,
&
counter
[
i
].
event
);
&
counter
[
i
].
event
);
oprofilefs_create_ulong
(
sb
,
dir
,
"count"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"count"
,
&
counter
[
i
].
count
);
&
counter
[
i
].
count
);
/* Dummy entries */
/* Dummy entries */
oprofilefs_create_ulong
(
sb
,
dir
,
"kernel"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"kernel"
,
&
counter
[
i
].
kernel
);
&
counter
[
i
].
kernel
);
oprofilefs_create_ulong
(
sb
,
dir
,
"user"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"user"
,
&
counter
[
i
].
user
);
&
counter
[
i
].
user
);
oprofilefs_create_ulong
(
sb
,
dir
,
"unit_mask"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"unit_mask"
,
&
counter
[
i
].
unit_mask
);
&
counter
[
i
].
unit_mask
);
}
}
...
...
arch/mips/oprofile/common.c
浏览文件 @
ef7bca14
...
@@ -33,7 +33,7 @@ static int op_mips_setup(void)
...
@@ -33,7 +33,7 @@ static int op_mips_setup(void)
return
0
;
return
0
;
}
}
static
int
op_mips_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
static
int
op_mips_create_files
(
struct
dentry
*
root
)
{
{
int
i
;
int
i
;
...
@@ -42,16 +42,16 @@ static int op_mips_create_files(struct super_block *sb, struct dentry *root)
...
@@ -42,16 +42,16 @@ static int op_mips_create_files(struct super_block *sb, struct dentry *root)
char
buf
[
4
];
char
buf
[
4
];
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
dir
=
oprofilefs_mkdir
(
sb
,
root
,
buf
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
buf
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enabled"
,
&
ctr
[
i
].
enabled
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
ctr
[
i
].
enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"event"
,
&
ctr
[
i
].
event
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"event"
,
&
ctr
[
i
].
event
);
oprofilefs_create_ulong
(
sb
,
dir
,
"count"
,
&
ctr
[
i
].
count
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"count"
,
&
ctr
[
i
].
count
);
oprofilefs_create_ulong
(
sb
,
dir
,
"kernel"
,
&
ctr
[
i
].
kernel
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"kernel"
,
&
ctr
[
i
].
kernel
);
oprofilefs_create_ulong
(
sb
,
dir
,
"user"
,
&
ctr
[
i
].
user
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"user"
,
&
ctr
[
i
].
user
);
oprofilefs_create_ulong
(
sb
,
dir
,
"exl"
,
&
ctr
[
i
].
exl
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"exl"
,
&
ctr
[
i
].
exl
);
/* Dummy. */
/* Dummy. */
oprofilefs_create_ulong
(
sb
,
dir
,
"unit_mask"
,
&
ctr
[
i
].
unit_mask
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"unit_mask"
,
&
ctr
[
i
].
unit_mask
);
}
}
return
0
;
return
0
;
...
...
arch/powerpc/oprofile/common.c
浏览文件 @
ef7bca14
...
@@ -119,7 +119,7 @@ static void op_powerpc_stop(void)
...
@@ -119,7 +119,7 @@ static void op_powerpc_stop(void)
model
->
global_stop
();
model
->
global_stop
();
}
}
static
int
op_powerpc_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
static
int
op_powerpc_create_files
(
struct
dentry
*
root
)
{
{
int
i
;
int
i
;
...
@@ -128,9 +128,9 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
...
@@ -128,9 +128,9 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
* There is one mmcr0, mmcr1 and mmcra for setting the events for
* There is one mmcr0, mmcr1 and mmcra for setting the events for
* all of the counters.
* all of the counters.
*/
*/
oprofilefs_create_ulong
(
sb
,
root
,
"mmcr0"
,
&
sys
.
mmcr0
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"mmcr0"
,
&
sys
.
mmcr0
);
oprofilefs_create_ulong
(
sb
,
root
,
"mmcr1"
,
&
sys
.
mmcr1
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"mmcr1"
,
&
sys
.
mmcr1
);
oprofilefs_create_ulong
(
sb
,
root
,
"mmcra"
,
&
sys
.
mmcra
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"mmcra"
,
&
sys
.
mmcra
);
#ifdef CONFIG_OPROFILE_CELL
#ifdef CONFIG_OPROFILE_CELL
/* create a file the user tool can check to see what level of profiling
/* create a file the user tool can check to see what level of profiling
* support exits with this kernel. Initialize bit mask to indicate
* support exits with this kernel. Initialize bit mask to indicate
...
@@ -142,7 +142,7 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
...
@@ -142,7 +142,7 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
* If the file does not exist, then the kernel only supports SPU
* If the file does not exist, then the kernel only supports SPU
* cycle profiling, PPU event and cycle profiling.
* cycle profiling, PPU event and cycle profiling.
*/
*/
oprofilefs_create_ulong
(
sb
,
root
,
"cell_support"
,
&
sys
.
cell_support
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"cell_support"
,
&
sys
.
cell_support
);
sys
.
cell_support
=
0x1
;
/* Note, the user OProfile tool must check
sys
.
cell_support
=
0x1
;
/* Note, the user OProfile tool must check
* that this bit is set before attempting to
* that this bit is set before attempting to
* user SPU event profiling. Older kernels
* user SPU event profiling. Older kernels
...
@@ -160,11 +160,11 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
...
@@ -160,11 +160,11 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
char
buf
[
4
];
char
buf
[
4
];
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
dir
=
oprofilefs_mkdir
(
sb
,
root
,
buf
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
buf
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enabled"
,
&
ctr
[
i
].
enabled
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
ctr
[
i
].
enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"event"
,
&
ctr
[
i
].
event
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"event"
,
&
ctr
[
i
].
event
);
oprofilefs_create_ulong
(
sb
,
dir
,
"count"
,
&
ctr
[
i
].
count
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"count"
,
&
ctr
[
i
].
count
);
/*
/*
* Classic PowerPC doesn't support per-counter
* Classic PowerPC doesn't support per-counter
...
@@ -173,14 +173,14 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
...
@@ -173,14 +173,14 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
* Book-E style performance monitors, we do
* Book-E style performance monitors, we do
* support them.
* support them.
*/
*/
oprofilefs_create_ulong
(
sb
,
dir
,
"kernel"
,
&
ctr
[
i
].
kernel
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"kernel"
,
&
ctr
[
i
].
kernel
);
oprofilefs_create_ulong
(
sb
,
dir
,
"user"
,
&
ctr
[
i
].
user
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"user"
,
&
ctr
[
i
].
user
);
oprofilefs_create_ulong
(
sb
,
dir
,
"unit_mask"
,
&
ctr
[
i
].
unit_mask
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"unit_mask"
,
&
ctr
[
i
].
unit_mask
);
}
}
oprofilefs_create_ulong
(
sb
,
root
,
"enable_kernel"
,
&
sys
.
enable_kernel
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"enable_kernel"
,
&
sys
.
enable_kernel
);
oprofilefs_create_ulong
(
sb
,
root
,
"enable_user"
,
&
sys
.
enable_user
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
root
,
"enable_user"
,
&
sys
.
enable_user
);
/* Default to tracing both kernel and user */
/* Default to tracing both kernel and user */
sys
.
enable_kernel
=
1
;
sys
.
enable_kernel
=
1
;
...
...
arch/s390/oprofile/init.c
浏览文件 @
ef7bca14
...
@@ -346,16 +346,15 @@ static const struct file_operations timer_enabled_fops = {
...
@@ -346,16 +346,15 @@ static const struct file_operations timer_enabled_fops = {
};
};
static
int
oprofile_create_hwsampling_files
(
struct
super_block
*
sb
,
static
int
oprofile_create_hwsampling_files
(
struct
dentry
*
root
)
struct
dentry
*
root
)
{
{
struct
dentry
*
dir
;
struct
dentry
*
dir
;
dir
=
oprofilefs_mkdir
(
sb
,
root
,
"timer"
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
"timer"
);
if
(
!
dir
)
if
(
!
dir
)
return
-
EINVAL
;
return
-
EINVAL
;
oprofilefs_create_file
(
sb
,
dir
,
"enabled"
,
&
timer_enabled_fops
);
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
timer_enabled_fops
);
if
(
!
hwsampler_available
)
if
(
!
hwsampler_available
)
return
0
;
return
0
;
...
@@ -376,17 +375,17 @@ static int oprofile_create_hwsampling_files(struct super_block *sb,
...
@@ -376,17 +375,17 @@ static int oprofile_create_hwsampling_files(struct super_block *sb,
* and can only be set to 0.
* and can only be set to 0.
*/
*/
dir
=
oprofilefs_mkdir
(
sb
,
root
,
"0"
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
"0"
);
if
(
!
dir
)
if
(
!
dir
)
return
-
EINVAL
;
return
-
EINVAL
;
oprofilefs_create_file
(
sb
,
dir
,
"enabled"
,
&
hwsampler_fops
);
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
hwsampler_fops
);
oprofilefs_create_file
(
sb
,
dir
,
"event"
,
&
zero_fops
);
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"event"
,
&
zero_fops
);
oprofilefs_create_file
(
sb
,
dir
,
"count"
,
&
hw_interval_fops
);
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"count"
,
&
hw_interval_fops
);
oprofilefs_create_file
(
sb
,
dir
,
"unit_mask"
,
&
zero_fops
);
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"unit_mask"
,
&
zero_fops
);
oprofilefs_create_file
(
sb
,
dir
,
"kernel"
,
&
kernel_fops
);
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"kernel"
,
&
kernel_fops
);
oprofilefs_create_file
(
sb
,
dir
,
"user"
,
&
user_fops
);
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"user"
,
&
user_fops
);
oprofilefs_create_ulong
(
sb
,
dir
,
"hw_sdbt_blocks"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"hw_sdbt_blocks"
,
&
oprofile_sdbt_blocks
);
&
oprofile_sdbt_blocks
);
}
else
{
}
else
{
...
@@ -396,19 +395,19 @@ static int oprofile_create_hwsampling_files(struct super_block *sb,
...
@@ -396,19 +395,19 @@ static int oprofile_create_hwsampling_files(struct super_block *sb,
* space tools. The /dev/oprofile/hwsampling fs is
* space tools. The /dev/oprofile/hwsampling fs is
* provided in that case.
* provided in that case.
*/
*/
dir
=
oprofilefs_mkdir
(
sb
,
root
,
"hwsampling"
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
"hwsampling"
);
if
(
!
dir
)
if
(
!
dir
)
return
-
EINVAL
;
return
-
EINVAL
;
oprofilefs_create_file
(
sb
,
dir
,
"hwsampler"
,
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"hwsampler"
,
&
hwsampler_fops
);
&
hwsampler_fops
);
oprofilefs_create_file
(
sb
,
dir
,
"hw_interval"
,
oprofilefs_create_file
(
root
->
d_
sb
,
dir
,
"hw_interval"
,
&
hw_interval_fops
);
&
hw_interval_fops
);
oprofilefs_create_ro_ulong
(
sb
,
dir
,
"hw_min_interval"
,
oprofilefs_create_ro_ulong
(
root
->
d_
sb
,
dir
,
"hw_min_interval"
,
&
oprofile_min_interval
);
&
oprofile_min_interval
);
oprofilefs_create_ro_ulong
(
sb
,
dir
,
"hw_max_interval"
,
oprofilefs_create_ro_ulong
(
root
->
d_
sb
,
dir
,
"hw_max_interval"
,
&
oprofile_max_interval
);
&
oprofile_max_interval
);
oprofilefs_create_ulong
(
sb
,
dir
,
"hw_sdbt_blocks"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"hw_sdbt_blocks"
,
&
oprofile_sdbt_blocks
);
&
oprofile_sdbt_blocks
);
}
}
return
0
;
return
0
;
...
...
arch/x86/oprofile/nmi_int.c
浏览文件 @
ef7bca14
...
@@ -403,7 +403,7 @@ static void nmi_cpu_down(void *dummy)
...
@@ -403,7 +403,7 @@ static void nmi_cpu_down(void *dummy)
nmi_cpu_shutdown
(
dummy
);
nmi_cpu_shutdown
(
dummy
);
}
}
static
int
nmi_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
static
int
nmi_create_files
(
struct
dentry
*
root
)
{
{
unsigned
int
i
;
unsigned
int
i
;
...
@@ -420,14 +420,14 @@ static int nmi_create_files(struct super_block *sb, struct dentry *root)
...
@@ -420,14 +420,14 @@ static int nmi_create_files(struct super_block *sb, struct dentry *root)
continue
;
continue
;
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
i
);
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
i
);
dir
=
oprofilefs_mkdir
(
sb
,
root
,
buf
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
buf
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enabled"
,
&
counter_config
[
i
].
enabled
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
counter_config
[
i
].
enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"event"
,
&
counter_config
[
i
].
event
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"event"
,
&
counter_config
[
i
].
event
);
oprofilefs_create_ulong
(
sb
,
dir
,
"count"
,
&
counter_config
[
i
].
count
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"count"
,
&
counter_config
[
i
].
count
);
oprofilefs_create_ulong
(
sb
,
dir
,
"unit_mask"
,
&
counter_config
[
i
].
unit_mask
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"unit_mask"
,
&
counter_config
[
i
].
unit_mask
);
oprofilefs_create_ulong
(
sb
,
dir
,
"kernel"
,
&
counter_config
[
i
].
kernel
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"kernel"
,
&
counter_config
[
i
].
kernel
);
oprofilefs_create_ulong
(
sb
,
dir
,
"user"
,
&
counter_config
[
i
].
user
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"user"
,
&
counter_config
[
i
].
user
);
oprofilefs_create_ulong
(
sb
,
dir
,
"extra"
,
&
counter_config
[
i
].
extra
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"extra"
,
&
counter_config
[
i
].
extra
);
}
}
return
0
;
return
0
;
...
...
arch/x86/oprofile/op_model_amd.c
浏览文件 @
ef7bca14
...
@@ -454,16 +454,16 @@ static void init_ibs(void)
...
@@ -454,16 +454,16 @@ static void init_ibs(void)
printk
(
KERN_INFO
"oprofile: AMD IBS detected (0x%08x)
\n
"
,
ibs_caps
);
printk
(
KERN_INFO
"oprofile: AMD IBS detected (0x%08x)
\n
"
,
ibs_caps
);
}
}
static
int
(
*
create_arch_files
)(
struct
super_block
*
sb
,
struct
dentry
*
root
);
static
int
(
*
create_arch_files
)(
struct
dentry
*
root
);
static
int
setup_ibs_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
static
int
setup_ibs_files
(
struct
dentry
*
root
)
{
{
struct
dentry
*
dir
;
struct
dentry
*
dir
;
int
ret
=
0
;
int
ret
=
0
;
/* architecture specific files */
/* architecture specific files */
if
(
create_arch_files
)
if
(
create_arch_files
)
ret
=
create_arch_files
(
sb
,
root
);
ret
=
create_arch_files
(
root
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -479,26 +479,26 @@ static int setup_ibs_files(struct super_block *sb, struct dentry *root)
...
@@ -479,26 +479,26 @@ static int setup_ibs_files(struct super_block *sb, struct dentry *root)
ibs_config
.
max_cnt_op
=
250000
;
ibs_config
.
max_cnt_op
=
250000
;
if
(
ibs_caps
&
IBS_CAPS_FETCHSAM
)
{
if
(
ibs_caps
&
IBS_CAPS_FETCHSAM
)
{
dir
=
oprofilefs_mkdir
(
sb
,
root
,
"ibs_fetch"
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
"ibs_fetch"
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enable"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enable"
,
&
ibs_config
.
fetch_enabled
);
&
ibs_config
.
fetch_enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"max_count"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"max_count"
,
&
ibs_config
.
max_cnt_fetch
);
&
ibs_config
.
max_cnt_fetch
);
oprofilefs_create_ulong
(
sb
,
dir
,
"rand_enable"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"rand_enable"
,
&
ibs_config
.
rand_en
);
&
ibs_config
.
rand_en
);
}
}
if
(
ibs_caps
&
IBS_CAPS_OPSAM
)
{
if
(
ibs_caps
&
IBS_CAPS_OPSAM
)
{
dir
=
oprofilefs_mkdir
(
sb
,
root
,
"ibs_op"
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
"ibs_op"
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enable"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enable"
,
&
ibs_config
.
op_enabled
);
&
ibs_config
.
op_enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"max_count"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"max_count"
,
&
ibs_config
.
max_cnt_op
);
&
ibs_config
.
max_cnt_op
);
if
(
ibs_caps
&
IBS_CAPS_OPCNT
)
if
(
ibs_caps
&
IBS_CAPS_OPCNT
)
oprofilefs_create_ulong
(
sb
,
dir
,
"dispatched_ops"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"dispatched_ops"
,
&
ibs_config
.
dispatched_ops
);
&
ibs_config
.
dispatched_ops
);
if
(
ibs_caps
&
IBS_CAPS_BRNTRGT
)
if
(
ibs_caps
&
IBS_CAPS_BRNTRGT
)
oprofilefs_create_ulong
(
sb
,
dir
,
"branch_target"
,
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"branch_target"
,
&
ibs_config
.
branch_target
);
&
ibs_config
.
branch_target
);
}
}
...
...
drivers/oprofile/oprofile_files.c
浏览文件 @
ef7bca14
...
@@ -197,5 +197,5 @@ void oprofile_create_files(struct dentry *root)
...
@@ -197,5 +197,5 @@ void oprofile_create_files(struct dentry *root)
#endif
#endif
oprofile_create_stats_files
(
root
->
d_sb
,
root
);
oprofile_create_stats_files
(
root
->
d_sb
,
root
);
if
(
oprofile_ops
.
create_files
)
if
(
oprofile_ops
.
create_files
)
oprofile_ops
.
create_files
(
root
->
d_sb
,
root
);
oprofile_ops
.
create_files
(
root
);
}
}
drivers/oprofile/oprofile_perf.c
浏览文件 @
ef7bca14
...
@@ -138,7 +138,7 @@ static void op_perf_stop(void)
...
@@ -138,7 +138,7 @@ static void op_perf_stop(void)
op_destroy_counter
(
cpu
,
event
);
op_destroy_counter
(
cpu
,
event
);
}
}
static
int
oprofile_perf_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
static
int
oprofile_perf_create_files
(
struct
dentry
*
root
)
{
{
unsigned
int
i
;
unsigned
int
i
;
...
@@ -147,13 +147,13 @@ static int oprofile_perf_create_files(struct super_block *sb, struct dentry *roo
...
@@ -147,13 +147,13 @@ static int oprofile_perf_create_files(struct super_block *sb, struct dentry *roo
char
buf
[
4
];
char
buf
[
4
];
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
snprintf
(
buf
,
sizeof
buf
,
"%d"
,
i
);
dir
=
oprofilefs_mkdir
(
sb
,
root
,
buf
);
dir
=
oprofilefs_mkdir
(
root
->
d_
sb
,
root
,
buf
);
oprofilefs_create_ulong
(
sb
,
dir
,
"enabled"
,
&
counter_config
[
i
].
enabled
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"enabled"
,
&
counter_config
[
i
].
enabled
);
oprofilefs_create_ulong
(
sb
,
dir
,
"event"
,
&
counter_config
[
i
].
event
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"event"
,
&
counter_config
[
i
].
event
);
oprofilefs_create_ulong
(
sb
,
dir
,
"count"
,
&
counter_config
[
i
].
count
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"count"
,
&
counter_config
[
i
].
count
);
oprofilefs_create_ulong
(
sb
,
dir
,
"unit_mask"
,
&
counter_config
[
i
].
unit_mask
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"unit_mask"
,
&
counter_config
[
i
].
unit_mask
);
oprofilefs_create_ulong
(
sb
,
dir
,
"kernel"
,
&
counter_config
[
i
].
kernel
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"kernel"
,
&
counter_config
[
i
].
kernel
);
oprofilefs_create_ulong
(
sb
,
dir
,
"user"
,
&
counter_config
[
i
].
user
);
oprofilefs_create_ulong
(
root
->
d_
sb
,
dir
,
"user"
,
&
counter_config
[
i
].
user
);
}
}
return
0
;
return
0
;
...
...
include/linux/oprofile.h
浏览文件 @
ef7bca14
...
@@ -51,7 +51,7 @@ struct pt_regs;
...
@@ -51,7 +51,7 @@ struct pt_regs;
struct
oprofile_operations
{
struct
oprofile_operations
{
/* create any necessary configuration files in the oprofile fs.
/* create any necessary configuration files in the oprofile fs.
* Optional. */
* Optional. */
int
(
*
create_files
)(
struct
super_block
*
sb
,
struct
dentry
*
root
);
int
(
*
create_files
)(
struct
dentry
*
root
);
/* Do any necessary interrupt setup. Optional. */
/* Do any necessary interrupt setup. Optional. */
int
(
*
setup
)(
void
);
int
(
*
setup
)(
void
);
/* Do any necessary interrupt shutdown. Optional. */
/* Do any necessary interrupt shutdown. Optional. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录