Commit ae5f3f5b authored by Aleksandar Markovic's avatar Aleksandar Markovic Committed by Ralf Baechle

MIPS: math-emu: Add FP emu debugfs statistics for branches

Add FP emu debugfs counter for branches.

The new counter is displayed the same way as existing counter, and
its default path is /sys/kernel/debug/mips/fpuemustats/.

The limitation of this counter is that it counts only R6 branch
instructions BC1NEZ and BC1EQZ.
Signed-off-by: default avatarMiodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: default avatarGoran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: default avatarAleksandar Markovic <aleksandar.markovic@imgtec.com>
Cc: Douglas Leung <douglas.leung@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Maciej W. Rozycki <macro@imgtec.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
Cc: Raghu Gandham <raghu.gandham@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/17143/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent e1231dd6
...@@ -36,6 +36,7 @@ struct mips_fpu_emulator_stats { ...@@ -36,6 +36,7 @@ struct mips_fpu_emulator_stats {
unsigned long emulated; unsigned long emulated;
unsigned long loads; unsigned long loads;
unsigned long stores; unsigned long stores;
unsigned long branches;
unsigned long cp1ops; unsigned long cp1ops;
unsigned long cp1xops; unsigned long cp1xops;
unsigned long errors; unsigned long errors;
......
...@@ -1230,6 +1230,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx, ...@@ -1230,6 +1230,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
break; break;
} }
branch_common: branch_common:
MIPS_FPU_EMU_INC_STATS(branches);
set_delay_slot(xcp); set_delay_slot(xcp);
if (cond) { if (cond) {
/* /*
......
...@@ -53,6 +53,7 @@ do { \ ...@@ -53,6 +53,7 @@ do { \
FPU_STAT_CREATE(emulated); FPU_STAT_CREATE(emulated);
FPU_STAT_CREATE(loads); FPU_STAT_CREATE(loads);
FPU_STAT_CREATE(stores); FPU_STAT_CREATE(stores);
FPU_STAT_CREATE(branches);
FPU_STAT_CREATE(cp1ops); FPU_STAT_CREATE(cp1ops);
FPU_STAT_CREATE(cp1xops); FPU_STAT_CREATE(cp1xops);
FPU_STAT_CREATE(errors); FPU_STAT_CREATE(errors);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment