MIPS: math-emu: Add FP emu debugfs statistics for branches
authorAleksandar Markovic <aleksandar.markovic@imgtec.com>
Mon, 21 Aug 2017 12:24:50 +0000 (14:24 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 29 Aug 2017 13:21:57 +0000 (15:21 +0200)
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: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: Aleksandar 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: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/fpu_emulator.h
arch/mips/math-emu/cp1emu.c
arch/mips/math-emu/me-debugfs.c

index 8e50fa3623e3005b87dd4772aa7ea18deeeb3ba7..4c8ab2739aae4d0ecc701810e169571317812bdc 100644 (file)
@@ -36,6 +36,7 @@ struct mips_fpu_emulator_stats {
        unsigned long emulated;
        unsigned long loads;
        unsigned long stores;
+       unsigned long branches;
        unsigned long cp1ops;
        unsigned long cp1xops;
        unsigned long errors;
index a4df2200c725bd616503c1860255c6b4a55dbdf5..a1f06ad017595d479c06d1a4908e1a845833458d 100644 (file)
@@ -1230,6 +1230,7 @@ emul:
                                break;
                        }
 branch_common:
+                       MIPS_FPU_EMU_INC_STATS(branches);
                        set_delay_slot(xcp);
                        if (cond) {
                                /*
index be650ed7db596bb8b586c7b65bfdddce56f65b3b..78b26c8dc697fefa651efbe506326c4e44ea105e 100644 (file)
@@ -53,6 +53,7 @@ do {                                                                  \
        FPU_STAT_CREATE(emulated);
        FPU_STAT_CREATE(loads);
        FPU_STAT_CREATE(stores);
+       FPU_STAT_CREATE(branches);
        FPU_STAT_CREATE(cp1ops);
        FPU_STAT_CREATE(cp1xops);
        FPU_STAT_CREATE(errors);