Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f15bdfe4
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f15bdfe4
编写于
8月 05, 2014
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'devel-stable' into for-next
Conflicts: arch/arm/kernel/perf_event_cpu.c
上级
c89c3a6a
c70fbb01
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
362 addition
and
1107 deletion
+362
-1107
arch/arm/include/asm/memory.h
arch/arm/include/asm/memory.h
+1
-3
arch/arm/include/asm/perf_event.h
arch/arm/include/asm/perf_event.h
+0
-9
arch/arm/include/asm/pmu.h
arch/arm/include/asm/pmu.h
+19
-0
arch/arm/include/asm/uaccess.h
arch/arm/include/asm/uaccess.h
+1
-1
arch/arm/kernel/perf_event.c
arch/arm/kernel/perf_event.c
+11
-2
arch/arm/kernel/perf_event_cpu.c
arch/arm/kernel/perf_event_cpu.c
+10
-3
arch/arm/kernel/perf_event_v6.c
arch/arm/kernel/perf_event_v6.c
+79
-228
arch/arm/kernel/perf_event_v7.c
arch/arm/kernel/perf_event_v7.c
+216
-751
arch/arm/kernel/perf_event_xscale.c
arch/arm/kernel/perf_event_xscale.c
+17
-104
arch/arm/oprofile/common.c
arch/arm/oprofile/common.c
+8
-6
未找到文件。
arch/arm/include/asm/memory.h
浏览文件 @
f15bdfe4
...
...
@@ -91,9 +91,7 @@
* of this define that was meant to.
* Fortunately, there is no reference for this in noMMU mode, for now.
*/
#ifndef TASK_SIZE
#define TASK_SIZE (CONFIG_DRAM_SIZE)
#endif
#define TASK_SIZE UL(0xffffffff)
#ifndef TASK_UNMAPPED_BASE
#define TASK_UNMAPPED_BASE UL(0x00000000)
...
...
arch/arm/include/asm/perf_event.h
浏览文件 @
f15bdfe4
...
...
@@ -12,15 +12,6 @@
#ifndef __ARM_PERF_EVENT_H__
#define __ARM_PERF_EVENT_H__
/*
* The ARMv7 CPU PMU supports up to 32 event counters.
*/
#define ARMPMU_MAX_HWEVENTS 32
#define HW_OP_UNSUPPORTED 0xFFFF
#define C(_x) PERF_COUNT_HW_CACHE_##_x
#define CACHE_OP_UNSUPPORTED 0xFFFF
#ifdef CONFIG_HW_PERF_EVENTS
struct
pt_regs
;
extern
unsigned
long
perf_instruction_pointer
(
struct
pt_regs
*
regs
);
...
...
arch/arm/include/asm/pmu.h
浏览文件 @
f15bdfe4
...
...
@@ -42,6 +42,25 @@ struct arm_pmu_platdata {
#ifdef CONFIG_HW_PERF_EVENTS
/*
* The ARMv7 CPU PMU supports up to 32 event counters.
*/
#define ARMPMU_MAX_HWEVENTS 32
#define HW_OP_UNSUPPORTED 0xFFFF
#define C(_x) PERF_COUNT_HW_CACHE_##_x
#define CACHE_OP_UNSUPPORTED 0xFFFF
#define PERF_MAP_ALL_UNSUPPORTED \
[0 ... PERF_COUNT_HW_MAX - 1] = HW_OP_UNSUPPORTED
#define PERF_CACHE_MAP_ALL_UNSUPPORTED \
[0 ... C(MAX) - 1] = { \
[0 ... C(OP_MAX) - 1] = { \
[0 ... C(RESULT_MAX) - 1] = CACHE_OP_UNSUPPORTED, \
}, \
}
/* The events for a given PMU register set. */
struct
pmu_hw_events
{
/*
...
...
arch/arm/include/asm/uaccess.h
浏览文件 @
f15bdfe4
...
...
@@ -242,7 +242,7 @@ static inline void set_fs(mm_segment_t fs)
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
#define user_addr_max() \
(segment_eq(get_fs(),
USER_DS) ? TASK_SIZE : ~0UL
)
(segment_eq(get_fs(),
KERNEL_DS) ? ~0UL : get_fs()
)
/*
* The "__xxx" versions of the user access functions do not verify the
...
...
arch/arm/kernel/perf_event.c
浏览文件 @
f15bdfe4
...
...
@@ -560,11 +560,16 @@ user_backtrace(struct frame_tail __user *tail,
struct
perf_callchain_entry
*
entry
)
{
struct
frame_tail
buftail
;
unsigned
long
err
;
/* Also check accessibility of one struct frame_tail beyond */
if
(
!
access_ok
(
VERIFY_READ
,
tail
,
sizeof
(
buftail
)))
return
NULL
;
if
(
__copy_from_user_inatomic
(
&
buftail
,
tail
,
sizeof
(
buftail
)))
pagefault_disable
();
err
=
__copy_from_user_inatomic
(
&
buftail
,
tail
,
sizeof
(
buftail
));
pagefault_enable
();
if
(
err
)
return
NULL
;
perf_callchain_store
(
entry
,
buftail
.
lr
);
...
...
@@ -590,6 +595,10 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
}
perf_callchain_store
(
entry
,
regs
->
ARM_pc
);
if
(
!
current
->
mm
)
return
;
tail
=
(
struct
frame_tail
__user
*
)
regs
->
ARM_fp
-
1
;
while
((
entry
->
nr
<
PERF_MAX_STACK_DEPTH
)
&&
...
...
arch/arm/kernel/perf_event_cpu.c
浏览文件 @
f15bdfe4
...
...
@@ -233,14 +233,17 @@ static struct of_device_id cpu_pmu_of_device_ids[] = {
{.
compatible
=
"arm,cortex-a7-pmu"
,
.
data
=
armv7_a7_pmu_init
},
{.
compatible
=
"arm,cortex-a5-pmu"
,
.
data
=
armv7_a5_pmu_init
},
{.
compatible
=
"arm,arm11mpcore-pmu"
,
.
data
=
armv6mpcore_pmu_init
},
{.
compatible
=
"arm,arm1176-pmu"
,
.
data
=
armv6pmu_init
},
{.
compatible
=
"arm,arm1136-pmu"
,
.
data
=
armv6pmu_init
},
{.
compatible
=
"arm,arm1176-pmu"
,
.
data
=
armv6
_1176_
pmu_init
},
{.
compatible
=
"arm,arm1136-pmu"
,
.
data
=
armv6
_1136_
pmu_init
},
{.
compatible
=
"qcom,krait-pmu"
,
.
data
=
krait_pmu_init
},
{},
};
static
struct
platform_device_id
cpu_pmu_plat_device_ids
[]
=
{
{.
name
=
"arm-pmu"
},
{.
name
=
"armv6-pmu"
},
{.
name
=
"armv7-pmu"
},
{.
name
=
"xscale-pmu"
},
{},
};
...
...
@@ -257,9 +260,13 @@ static int probe_current_pmu(struct arm_pmu *pmu)
switch
(
read_cpuid_part
())
{
/* ARM Ltd CPUs. */
case
ARM_CPU_PART_ARM1136
:
ret
=
armv6_1136_pmu_init
(
pmu
);
break
;
case
ARM_CPU_PART_ARM1156
:
ret
=
armv6_1156_pmu_init
(
pmu
);
break
;
case
ARM_CPU_PART_ARM1176
:
ret
=
armv6pmu_init
(
pmu
);
ret
=
armv6
_1176_
pmu_init
(
pmu
);
break
;
case
ARM_CPU_PART_ARM11MPCORE
:
ret
=
armv6mpcore_pmu_init
(
pmu
);
...
...
arch/arm/kernel/perf_event_v6.c
浏览文件 @
f15bdfe4
...
...
@@ -65,13 +65,11 @@ enum armv6_counters {
* accesses/misses in hardware.
*/
static
const
unsigned
armv6_perf_map
[
PERF_COUNT_HW_MAX
]
=
{
PERF_MAP_ALL_UNSUPPORTED
,
[
PERF_COUNT_HW_CPU_CYCLES
]
=
ARMV6_PERFCTR_CPU_CYCLES
,
[
PERF_COUNT_HW_INSTRUCTIONS
]
=
ARMV6_PERFCTR_INSTR_EXEC
,
[
PERF_COUNT_HW_CACHE_REFERENCES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_CACHE_MISSES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_BRANCH_INSTRUCTIONS
]
=
ARMV6_PERFCTR_BR_EXEC
,
[
PERF_COUNT_HW_BRANCH_MISSES
]
=
ARMV6_PERFCTR_BR_MISPREDICT
,
[
PERF_COUNT_HW_BUS_CYCLES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
]
=
ARMV6_PERFCTR_IBUF_STALL
,
[
PERF_COUNT_HW_STALLED_CYCLES_BACKEND
]
=
ARMV6_PERFCTR_LSU_FULL_STALL
,
};
...
...
@@ -79,116 +77,31 @@ static const unsigned armv6_perf_map[PERF_COUNT_HW_MAX] = {
static
const
unsigned
armv6_perf_cache_map
[
PERF_COUNT_HW_CACHE_MAX
]
[
PERF_COUNT_HW_CACHE_OP_MAX
]
[
PERF_COUNT_HW_CACHE_RESULT_MAX
]
=
{
[
C
(
L1D
)]
=
{
/*
* The performance counters don't differentiate between read
* and write accesses/misses so this isn't strictly correct,
* but it's the best we can do. Writes and reads get
* combined.
*/
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
ARMV6_PERFCTR_DCACHE_ACCESS
,
[
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DCACHE_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
ARMV6_PERFCTR_DCACHE_ACCESS
,
[
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DCACHE_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
L1I
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_ICACHE_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
LL
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
DTLB
)]
=
{
/*
* The ARM performance counters can count micro DTLB misses,
* micro ITLB misses and main TLB misses. There isn't an event
* for TLB misses, so use the micro misses here and if users
* want the main TLB misses they can use a raw counter.
*/
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DTLB_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DTLB_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
ITLB
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_ITLB_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_ITLB_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
BPU
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
NODE
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
PERF_CACHE_MAP_ALL_UNSUPPORTED
,
/*
* The performance counters don't differentiate between read and write
* accesses/misses so this isn't strictly correct, but it's the best we
* can do. Writes and reads get combined.
*/
[
C
(
L1D
)][
C
(
OP_READ
)][
C
(
RESULT_ACCESS
)]
=
ARMV6_PERFCTR_DCACHE_ACCESS
,
[
C
(
L1D
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DCACHE_MISS
,
[
C
(
L1D
)][
C
(
OP_WRITE
)][
C
(
RESULT_ACCESS
)]
=
ARMV6_PERFCTR_DCACHE_ACCESS
,
[
C
(
L1D
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DCACHE_MISS
,
[
C
(
L1I
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_ICACHE_MISS
,
/*
* The ARM performance counters can count micro DTLB misses, micro ITLB
* misses and main TLB misses. There isn't an event for TLB misses, so
* use the micro misses here and if users want the main TLB misses they
* can use a raw counter.
*/
[
C
(
DTLB
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DTLB_MISS
,
[
C
(
DTLB
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_DTLB_MISS
,
[
C
(
ITLB
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_ITLB_MISS
,
[
C
(
ITLB
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
ARMV6_PERFCTR_ITLB_MISS
,
};
enum
armv6mpcore_perf_types
{
...
...
@@ -220,13 +133,11 @@ enum armv6mpcore_perf_types {
* accesses/misses in hardware.
*/
static
const
unsigned
armv6mpcore_perf_map
[
PERF_COUNT_HW_MAX
]
=
{
PERF_MAP_ALL_UNSUPPORTED
,
[
PERF_COUNT_HW_CPU_CYCLES
]
=
ARMV6MPCORE_PERFCTR_CPU_CYCLES
,
[
PERF_COUNT_HW_INSTRUCTIONS
]
=
ARMV6MPCORE_PERFCTR_INSTR_EXEC
,
[
PERF_COUNT_HW_CACHE_REFERENCES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_CACHE_MISSES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_BRANCH_INSTRUCTIONS
]
=
ARMV6MPCORE_PERFCTR_BR_EXEC
,
[
PERF_COUNT_HW_BRANCH_MISSES
]
=
ARMV6MPCORE_PERFCTR_BR_MISPREDICT
,
[
PERF_COUNT_HW_BUS_CYCLES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
]
=
ARMV6MPCORE_PERFCTR_IBUF_STALL
,
[
PERF_COUNT_HW_STALLED_CYCLES_BACKEND
]
=
ARMV6MPCORE_PERFCTR_LSU_FULL_STALL
,
};
...
...
@@ -234,114 +145,26 @@ static const unsigned armv6mpcore_perf_map[PERF_COUNT_HW_MAX] = {
static
const
unsigned
armv6mpcore_perf_cache_map
[
PERF_COUNT_HW_CACHE_MAX
]
[
PERF_COUNT_HW_CACHE_OP_MAX
]
[
PERF_COUNT_HW_CACHE_RESULT_MAX
]
=
{
[
C
(
L1D
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS
,
[
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_RDMISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS
,
[
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_WRMISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
L1I
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_ICACHE_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
LL
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
DTLB
)]
=
{
/*
* The ARM performance counters can count micro DTLB misses,
* micro ITLB misses and main TLB misses. There isn't an event
* for TLB misses, so use the micro misses here and if users
* want the main TLB misses they can use a raw counter.
*/
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DTLB_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DTLB_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
ITLB
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_ITLB_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_ITLB_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
BPU
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
NODE
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
PERF_CACHE_MAP_ALL_UNSUPPORTED
,
[
C
(
L1D
)][
C
(
OP_READ
)][
C
(
RESULT_ACCESS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_RDACCESS
,
[
C
(
L1D
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_RDMISS
,
[
C
(
L1D
)][
C
(
OP_WRITE
)][
C
(
RESULT_ACCESS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_WRACCESS
,
[
C
(
L1D
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DCACHE_WRMISS
,
[
C
(
L1I
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_ICACHE_MISS
,
/*
* The ARM performance counters can count micro DTLB misses, micro ITLB
* misses and main TLB misses. There isn't an event for TLB misses, so
* use the micro misses here and if users want the main TLB misses they
* can use a raw counter.
*/
[
C
(
DTLB
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DTLB_MISS
,
[
C
(
DTLB
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_DTLB_MISS
,
[
C
(
ITLB
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_ITLB_MISS
,
[
C
(
ITLB
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
ARMV6MPCORE_PERFCTR_ITLB_MISS
,
};
static
inline
unsigned
long
...
...
@@ -653,9 +476,8 @@ static int armv6_map_event(struct perf_event *event)
&
armv6_perf_cache_map
,
0xFF
);
}
static
int
armv6pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
static
void
armv6pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
cpu_pmu
->
name
=
"v6"
;
cpu_pmu
->
handle_irq
=
armv6pmu_handle_irq
;
cpu_pmu
->
enable
=
armv6pmu_enable_event
;
cpu_pmu
->
disable
=
armv6pmu_disable_event
;
...
...
@@ -667,7 +489,26 @@ static int armv6pmu_init(struct arm_pmu *cpu_pmu)
cpu_pmu
->
map_event
=
armv6_map_event
;
cpu_pmu
->
num_events
=
3
;
cpu_pmu
->
max_period
=
(
1LLU
<<
32
)
-
1
;
}
static
int
armv6_1136_pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
armv6pmu_init
(
cpu_pmu
);
cpu_pmu
->
name
=
"armv6_1136"
;
return
0
;
}
static
int
armv6_1156_pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
armv6pmu_init
(
cpu_pmu
);
cpu_pmu
->
name
=
"armv6_1156"
;
return
0
;
}
static
int
armv6_1176_pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
armv6pmu_init
(
cpu_pmu
);
cpu_pmu
->
name
=
"armv6_1176"
;
return
0
;
}
...
...
@@ -687,7 +528,7 @@ static int armv6mpcore_map_event(struct perf_event *event)
static
int
armv6mpcore_pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
cpu_pmu
->
name
=
"
v6
mpcore"
;
cpu_pmu
->
name
=
"
armv6_11
mpcore"
;
cpu_pmu
->
handle_irq
=
armv6pmu_handle_irq
;
cpu_pmu
->
enable
=
armv6pmu_enable_event
;
cpu_pmu
->
disable
=
armv6mpcore_pmu_disable_event
;
...
...
@@ -703,7 +544,17 @@ static int armv6mpcore_pmu_init(struct arm_pmu *cpu_pmu)
return
0
;
}
#else
static
int
armv6pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
static
int
armv6_1136_pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
return
-
ENODEV
;
}
static
int
armv6_1156_pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
return
-
ENODEV
;
}
static
int
armv6_1176_pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
return
-
ENODEV
;
}
...
...
arch/arm/kernel/perf_event_v7.c
浏览文件 @
f15bdfe4
此差异已折叠。
点击以展开。
arch/arm/kernel/perf_event_xscale.c
浏览文件 @
f15bdfe4
...
...
@@ -48,118 +48,31 @@ enum xscale_counters {
};
static
const
unsigned
xscale_perf_map
[
PERF_COUNT_HW_MAX
]
=
{
PERF_MAP_ALL_UNSUPPORTED
,
[
PERF_COUNT_HW_CPU_CYCLES
]
=
XSCALE_PERFCTR_CCNT
,
[
PERF_COUNT_HW_INSTRUCTIONS
]
=
XSCALE_PERFCTR_INSTRUCTION
,
[
PERF_COUNT_HW_CACHE_REFERENCES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_CACHE_MISSES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_BRANCH_INSTRUCTIONS
]
=
XSCALE_PERFCTR_BRANCH
,
[
PERF_COUNT_HW_BRANCH_MISSES
]
=
XSCALE_PERFCTR_BRANCH_MISS
,
[
PERF_COUNT_HW_BUS_CYCLES
]
=
HW_OP_UNSUPPORTED
,
[
PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
]
=
XSCALE_PERFCTR_ICACHE_NO_DELIVER
,
[
PERF_COUNT_HW_STALLED_CYCLES_BACKEND
]
=
HW_OP_UNSUPPORTED
,
};
static
const
unsigned
xscale_perf_cache_map
[
PERF_COUNT_HW_CACHE_MAX
]
[
PERF_COUNT_HW_CACHE_OP_MAX
]
[
PERF_COUNT_HW_CACHE_RESULT_MAX
]
=
{
[
C
(
L1D
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
XSCALE_PERFCTR_DCACHE_ACCESS
,
[
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DCACHE_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
XSCALE_PERFCTR_DCACHE_ACCESS
,
[
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DCACHE_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
L1I
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_ICACHE_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
LL
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
DTLB
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DTLB_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DTLB_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
ITLB
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_ITLB_MISS
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_ITLB_MISS
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
BPU
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
[
C
(
NODE
)]
=
{
[
C
(
OP_READ
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_WRITE
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
[
C
(
OP_PREFETCH
)]
=
{
[
C
(
RESULT_ACCESS
)]
=
CACHE_OP_UNSUPPORTED
,
[
C
(
RESULT_MISS
)]
=
CACHE_OP_UNSUPPORTED
,
},
},
PERF_CACHE_MAP_ALL_UNSUPPORTED
,
[
C
(
L1D
)][
C
(
OP_READ
)][
C
(
RESULT_ACCESS
)]
=
XSCALE_PERFCTR_DCACHE_ACCESS
,
[
C
(
L1D
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DCACHE_MISS
,
[
C
(
L1D
)][
C
(
OP_WRITE
)][
C
(
RESULT_ACCESS
)]
=
XSCALE_PERFCTR_DCACHE_ACCESS
,
[
C
(
L1D
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DCACHE_MISS
,
[
C
(
L1I
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_ICACHE_MISS
,
[
C
(
DTLB
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DTLB_MISS
,
[
C
(
DTLB
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_DTLB_MISS
,
[
C
(
ITLB
)][
C
(
OP_READ
)][
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_ITLB_MISS
,
[
C
(
ITLB
)][
C
(
OP_WRITE
)][
C
(
RESULT_MISS
)]
=
XSCALE_PERFCTR_ITLB_MISS
,
};
#define XSCALE_PMU_ENABLE 0x001
...
...
@@ -442,7 +355,7 @@ static int xscale_map_event(struct perf_event *event)
static
int
xscale1pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
cpu_pmu
->
name
=
"xscale1"
;
cpu_pmu
->
name
=
"
armv5_
xscale1"
;
cpu_pmu
->
handle_irq
=
xscale1pmu_handle_irq
;
cpu_pmu
->
enable
=
xscale1pmu_enable_event
;
cpu_pmu
->
disable
=
xscale1pmu_disable_event
;
...
...
@@ -812,7 +725,7 @@ static inline void xscale2pmu_write_counter(struct perf_event *event, u32 val)
static
int
xscale2pmu_init
(
struct
arm_pmu
*
cpu_pmu
)
{
cpu_pmu
->
name
=
"xscale2"
;
cpu_pmu
->
name
=
"
armv5_
xscale2"
;
cpu_pmu
->
handle_irq
=
xscale2pmu_handle_irq
;
cpu_pmu
->
enable
=
xscale2pmu_enable_event
;
cpu_pmu
->
disable
=
xscale2pmu_disable_event
;
...
...
arch/arm/oprofile/common.c
浏览文件 @
f15bdfe4
...
...
@@ -33,12 +33,14 @@ static struct op_perf_name {
char
*
perf_name
;
char
*
op_name
;
}
op_perf_name_map
[]
=
{
{
"xscale1"
,
"arm/xscale1"
},
{
"xscale1"
,
"arm/xscale2"
},
{
"v6"
,
"arm/armv6"
},
{
"v6mpcore"
,
"arm/mpcore"
},
{
"ARMv7 Cortex-A8"
,
"arm/armv7"
},
{
"ARMv7 Cortex-A9"
,
"arm/armv7-ca9"
},
{
"armv5_xscale1"
,
"arm/xscale1"
},
{
"armv5_xscale2"
,
"arm/xscale2"
},
{
"armv6_1136"
,
"arm/armv6"
},
{
"armv6_1156"
,
"arm/armv6"
},
{
"armv6_1176"
,
"arm/armv6"
},
{
"armv6_11mpcore"
,
"arm/mpcore"
},
{
"armv7_cortex_a8"
,
"arm/armv7"
},
{
"armv7_cortex_a9"
,
"arm/armv7-ca9"
},
};
char
*
op_name_from_perf_id
(
void
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录