Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
85c51c51
Commit
85c51c51
authored
Apr 16, 2014
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MIPS: math-emu: Move all debug fs code to a separate file.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
6d18b624
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
56 deletions
+62
-56
arch/mips/math-emu/Makefile
arch/mips/math-emu/Makefile
+2
-0
arch/mips/math-emu/cp1emu.c
arch/mips/math-emu/cp1emu.c
+1
-56
arch/mips/math-emu/me-debugfs.c
arch/mips/math-emu/me-debugfs.c
+59
-0
No files found.
arch/mips/math-emu/Makefile
View file @
85c51c51
...
...
@@ -9,3 +9,5 @@ obj-y := cp1emu.o ieee754m.o ieee754d.o ieee754dp.o ieee754sp.o ieee754.o \
sp_div.o sp_mul.o sp_sub.o sp_add.o sp_fdp.o sp_cmp.o sp_logb.o
\
sp_scalb.o sp_simple.o sp_tint.o sp_fint.o sp_tlong.o sp_flong.o
\
dp_sqrt.o sp_sqrt.o kernel_linkage.o dsemul.o
obj-$(CONFIG_DEBUG_FS)
+=
me-debugfs.o
arch/mips/math-emu/cp1emu.c
View file @
85c51c51
...
...
@@ -35,6 +35,7 @@
*/
#include <linux/sched.h>
#include <linux/debugfs.h>
#include <linux/percpu-defs.h>
#include <linux/perf_event.h>
#include <asm/branch.h>
...
...
@@ -66,12 +67,6 @@ static int fpux_emu(struct pt_regs *,
struct
mips_fpu_struct
*
,
mips_instruction
,
void
*
__user
*
);
#endif
/* Further private data for which no space exists in mips_fpu_struct */
#ifdef CONFIG_DEBUG_FS
DEFINE_PER_CPU
(
struct
mips_fpu_emulator_stats
,
fpuemustats
);
#endif
/* Control registers */
#define FPCREG_RID 0
/* $0 = revision id */
...
...
@@ -2158,53 +2153,3 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
return
sig
;
}
#ifdef CONFIG_DEBUG_FS
static
int
fpuemu_stat_get
(
void
*
data
,
u64
*
val
)
{
int
cpu
;
unsigned
long
sum
=
0
;
for_each_online_cpu
(
cpu
)
{
struct
mips_fpu_emulator_stats
*
ps
;
local_t
*
pv
;
ps
=
&
per_cpu
(
fpuemustats
,
cpu
);
pv
=
(
void
*
)
ps
+
(
unsigned
long
)
data
;
sum
+=
local_read
(
pv
);
}
*
val
=
sum
;
return
0
;
}
DEFINE_SIMPLE_ATTRIBUTE
(
fops_fpuemu_stat
,
fpuemu_stat_get
,
NULL
,
"%llu
\n
"
);
extern
struct
dentry
*
mips_debugfs_dir
;
static
int
__init
debugfs_fpuemu
(
void
)
{
struct
dentry
*
d
,
*
dir
;
if
(
!
mips_debugfs_dir
)
return
-
ENODEV
;
dir
=
debugfs_create_dir
(
"fpuemustats"
,
mips_debugfs_dir
);
if
(
!
dir
)
return
-
ENOMEM
;
#define FPU_STAT_CREATE(M) \
do { \
d = debugfs_create_file(#M , S_IRUGO, dir, \
(void *)offsetof(struct mips_fpu_emulator_stats, M), \
&fops_fpuemu_stat); \
if (!d) \
return -ENOMEM; \
} while (0)
FPU_STAT_CREATE
(
emulated
);
FPU_STAT_CREATE
(
loads
);
FPU_STAT_CREATE
(
stores
);
FPU_STAT_CREATE
(
cp1ops
);
FPU_STAT_CREATE
(
cp1xops
);
FPU_STAT_CREATE
(
errors
);
return
0
;
}
__initcall
(
debugfs_fpuemu
);
#endif
arch/mips/math-emu/me-debugfs.c
0 → 100644
View file @
85c51c51
#include <linux/cpumask.h>
#include <linux/debugfs.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/percpu.h>
#include <linux/types.h>
#include <asm/fpu_emulator.h>
#include <asm/local.h>
DEFINE_PER_CPU
(
struct
mips_fpu_emulator_stats
,
fpuemustats
);
static
int
fpuemu_stat_get
(
void
*
data
,
u64
*
val
)
{
int
cpu
;
unsigned
long
sum
=
0
;
for_each_online_cpu
(
cpu
)
{
struct
mips_fpu_emulator_stats
*
ps
;
local_t
*
pv
;
ps
=
&
per_cpu
(
fpuemustats
,
cpu
);
pv
=
(
void
*
)
ps
+
(
unsigned
long
)
data
;
sum
+=
local_read
(
pv
);
}
*
val
=
sum
;
return
0
;
}
DEFINE_SIMPLE_ATTRIBUTE
(
fops_fpuemu_stat
,
fpuemu_stat_get
,
NULL
,
"%llu
\n
"
);
extern
struct
dentry
*
mips_debugfs_dir
;
static
int
__init
debugfs_fpuemu
(
void
)
{
struct
dentry
*
d
,
*
dir
;
if
(
!
mips_debugfs_dir
)
return
-
ENODEV
;
dir
=
debugfs_create_dir
(
"fpuemustats"
,
mips_debugfs_dir
);
if
(
!
dir
)
return
-
ENOMEM
;
#define FPU_STAT_CREATE(M) \
do { \
d = debugfs_create_file(#M , S_IRUGO, dir, \
(void *)offsetof(struct mips_fpu_emulator_stats, M), \
&fops_fpuemu_stat); \
if (!d) \
return -ENOMEM; \
} while (0)
FPU_STAT_CREATE
(
emulated
);
FPU_STAT_CREATE
(
loads
);
FPU_STAT_CREATE
(
stores
);
FPU_STAT_CREATE
(
cp1ops
);
FPU_STAT_CREATE
(
cp1xops
);
FPU_STAT_CREATE
(
errors
);
return
0
;
}
__initcall
(
debugfs_fpuemu
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment