aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/math-emu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/math-emu')
-rw-r--r--arch/mips/math-emu/cp1emu.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 80531b35cd61..d7f05b0abe17 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -35,6 +35,7 @@
35 * better performance by compiling with -msoft-float! 35 * better performance by compiling with -msoft-float!
36 */ 36 */
37#include <linux/sched.h> 37#include <linux/sched.h>
38#include <linux/debugfs.h>
38 39
39#include <asm/inst.h> 40#include <asm/inst.h>
40#include <asm/bootinfo.h> 41#include <asm/bootinfo.h>
@@ -1277,3 +1278,36 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
1277 1278
1278 return sig; 1279 return sig;
1279} 1280}
1281
1282#ifdef CONFIG_DEBUG_FS
1283extern struct dentry *mips_debugfs_dir;
1284static int __init debugfs_fpuemu(void)
1285{
1286 struct dentry *d, *dir;
1287 int i;
1288 static struct {
1289 const char *name;
1290 unsigned int *v;
1291 } vars[] __initdata = {
1292 { "emulated", &fpuemustats.emulated },
1293 { "loads", &fpuemustats.loads },
1294 { "stores", &fpuemustats.stores },
1295 { "cp1ops", &fpuemustats.cp1ops },
1296 { "cp1xops", &fpuemustats.cp1xops },
1297 { "errors", &fpuemustats.errors },
1298 };
1299
1300 if (!mips_debugfs_dir)
1301 return -ENODEV;
1302 dir = debugfs_create_dir("fpuemustats", mips_debugfs_dir);
1303 if (IS_ERR(dir))
1304 return PTR_ERR(dir);
1305 for (i = 0; i < ARRAY_SIZE(vars); i++) {
1306 d = debugfs_create_u32(vars[i].name, S_IRUGO, dir, vars[i].v);
1307 if (IS_ERR(d))
1308 return PTR_ERR(d);
1309 }
1310 return 0;
1311}
1312__initcall(debugfs_fpuemu);
1313#endif