MIPS: Loongson-3: Add oprofile support
PATCH v2 10/12 MIPS: Loongson-3: Add oprofile support
Loongson-3 has two groups of performance counters, they are 4 sub- registers of CP0's REG25. This patch add oprofile support.
REG25, sel 0: Perf Control of group 0;
REG25, sel 1: Perf Counter of group 0;
REG25, sel 2: Perf Control of group 1;
REG25, sel 3: Perf Counter of group 1.
Signed-off-by Huacai Chen <[email protected]>
--- arch/mips/oprofile/Makefile | 1 + arch/mips/oprofile/common.c | 4 + arch/mips/oprofile/op_model_loongson3.c | 220 +++++++++++++++++++++++++++++++ 3 files changed, 225 insertions(+), 0 deletions(-) create mode 100644 arch/mips/oprofile/op_model_loongson3.c
arch/mips/oprofile/Makefile +1 -0
@@ -14,3 +14,4 @@ oprofile-$(CONFIG_CPU_R10000) += op_model_mipsxx.o oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o oprofile-$(CONFIG_CPU_XLR) += op_model_mipsxx.o oprofile-$(CONFIG_CPU_LOONGSON2) += op_model_loongson2.o +oprofile-$(CONFIG_CPU_LOONGSON3) += op_model_loongson3.o
arch/mips/oprofile/common.c +4 -0
@@ -18,6 +18,7 @@extern struct op_mips_model op_model_mipsxx_ops__weak ;extern struct op_mips_model op_model_loongson2_ops__weak ; +extern struct op_mips_model op_model_loongson3_ops__weak ;static struct op_mips_model *model;
@@ -104,6 +105,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)case CPU_LOONGSON2 : lmodel = &op_model_loongson2_ops;break ; +case CPU_LOONGSON3 : + lmodel = &op_model_loongson3_ops; +break ; };if (!lmodel)
arch/mips/oprofile/op_model_loongson3.c new file +220 -0
220 lines not on this page · raw message
Signature · 1 line
1.7.7.3