aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/oprofile/common.c
diff options
context:
space:
mode:
authorHuacai Chen <chenhc@lemote.com>2014-11-04 01:15:07 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 01:45:01 -0500
commit89467e73d3881a470ce4ffdcba1d5a5ed618379a (patch)
treeab11981430ca14b0d29ee9cd37173c10a17ed837 /arch/mips/oprofile/common.c
parent3adeb2566b9bc1dbf579ed515265c6aad756a5cd (diff)
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 <chenhc@lemote.com> Cc: John Crispin <john@phrozen.org> Cc: Steven J. Hill <Steven.Hill@imgtec.com> Cc: linux-mips@linux-mips.org Cc: Fuxin Zhang <zhangfx@lemote.com> Cc: Zhangjin Wu <wuzhangjin@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/8328/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/oprofile/common.c')
-rw-r--r--arch/mips/oprofile/common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index e74732449478..feb987981f55 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -18,6 +18,7 @@
18 18
19extern struct op_mips_model op_model_mipsxx_ops __weak; 19extern struct op_mips_model op_model_mipsxx_ops __weak;
20extern struct op_mips_model op_model_loongson2_ops __weak; 20extern struct op_mips_model op_model_loongson2_ops __weak;
21extern struct op_mips_model op_model_loongson3_ops __weak;
21 22
22static struct op_mips_model *model; 23static struct op_mips_model *model;
23 24
@@ -104,6 +105,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
104 case CPU_LOONGSON2: 105 case CPU_LOONGSON2:
105 lmodel = &op_model_loongson2_ops; 106 lmodel = &op_model_loongson2_ops;
106 break; 107 break;
108 case CPU_LOONGSON3:
109 lmodel = &op_model_loongson3_ops;
110 break;
107 }; 111 };
108 112
109 if (!lmodel) 113 if (!lmodel)