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
Kirill Smelkov
linux
Commits
728f660c
Commit
728f660c
authored
Jan 16, 2003
by
Richard Henderson
Committed by
Richard Henderson
Jan 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[OPROF] Tidy model handle_interrupt handling.
parent
bf6831cf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
13 deletions
+48
-13
arch/alpha/oprofile/common.c
arch/alpha/oprofile/common.c
+2
-11
arch/alpha/oprofile/op_model_ev4.c
arch/alpha/oprofile/op_model_ev4.c
+17
-0
arch/alpha/oprofile/op_model_ev5.c
arch/alpha/oprofile/op_model_ev5.c
+13
-0
arch/alpha/oprofile/op_model_ev6.c
arch/alpha/oprofile/op_model_ev6.c
+12
-0
arch/alpha/oprofile/op_model_ev67.c
arch/alpha/oprofile/op_model_ev67.c
+4
-2
No files found.
arch/alpha/oprofile/common.c
View file @
728f660c
...
...
@@ -36,17 +36,8 @@ static struct op_register_config reg;
static
void
op_handle_interrupt
(
unsigned
long
which
,
struct
pt_regs
*
regs
)
{
if
(
model
->
handle_interrupt
)
{
model
->
handle_interrupt
(
which
,
regs
,
ctr
);
}
else
{
/* EV4 can't properly disable counters individually.
Discard "disabled" events now. */
if
(
!
ctr
[
which
].
enabled
)
return
;
/* Record the sample. */
oprofile_add_sample
(
regs
->
pc
,
which
,
smp_processor_id
());
}
model
->
handle_interrupt
(
which
,
regs
,
ctr
);
/* If the user has selected an interrupt frequency that is
not exactly the width of the counter, write a new value
into the counter such that it'll overflow after N more
...
...
arch/alpha/oprofile/op_model_ev4.c
View file @
728f660c
...
...
@@ -9,6 +9,8 @@
#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <asm/ptrace.h>
#include <asm/system.h>
#include "op_impl.h"
...
...
@@ -89,10 +91,25 @@ ev4_cpu_setup(void *x)
wrperfmon
(
3
,
reg
->
proc_mode
);
}
static
void
ev4_handle_interrupt
(
unsigned
long
which
,
struct
pt_regs
*
regs
,
struct
op_counter_config
*
ctr
)
{
/* EV4 can't properly disable counters individually.
Discard "disabled" events now. */
if
(
!
ctr
[
which
].
enabled
)
return
;
/* Record the sample. */
oprofile_add_sample
(
regs
->
pc
,
which
,
smp_processor_id
());
}
struct
op_axp_model
op_model_ev4
=
{
.
reg_setup
=
ev4_reg_setup
,
.
cpu_setup
=
ev4_cpu_setup
,
.
reset_ctr
=
NULL
,
.
handle_interrupt
=
ev4_handle_interrupt
,
.
cpu
=
OPROFILE_CPU_AXP_EV4
,
.
num_counters
=
2
,
.
can_set_proc_mode
=
0
,
...
...
arch/alpha/oprofile/op_model_ev5.c
View file @
728f660c
...
...
@@ -9,6 +9,8 @@
#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <asm/ptrace.h>
#include <asm/system.h>
#include "op_impl.h"
...
...
@@ -179,10 +181,20 @@ ev5_reset_ctr(struct op_register_config *reg, unsigned long ctr)
}
}
static
void
ev5_handle_interrupt
(
unsigned
long
which
,
struct
pt_regs
*
regs
,
struct
op_counter_config
*
ctr
)
{
/* Record the sample. */
oprofile_add_sample
(
regs
->
pc
,
which
,
smp_processor_id
());
}
struct
op_axp_model
op_model_ev5
=
{
.
reg_setup
=
ev5_reg_setup
,
.
cpu_setup
=
ev5_cpu_setup
,
.
reset_ctr
=
ev5_reset_ctr
,
.
handle_interrupt
=
ev5_handle_interrupt
,
.
cpu
=
OPROFILE_CPU_AXP_EV5
,
.
num_counters
=
3
,
.
can_set_proc_mode
=
1
,
...
...
@@ -192,6 +204,7 @@ struct op_axp_model op_model_pca56 = {
.
reg_setup
=
pca56_reg_setup
,
.
cpu_setup
=
ev5_cpu_setup
,
.
reset_ctr
=
ev5_reset_ctr
,
.
handle_interrupt
=
ev5_handle_interrupt
,
.
cpu
=
OPROFILE_CPU_AXP_PCA56
,
.
num_counters
=
3
,
.
can_set_proc_mode
=
1
,
...
...
arch/alpha/oprofile/op_model_ev6.c
View file @
728f660c
...
...
@@ -9,6 +9,8 @@
#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <asm/ptrace.h>
#include <asm/system.h>
#include "op_impl.h"
...
...
@@ -81,10 +83,20 @@ ev6_reset_ctr(struct op_register_config *reg, unsigned long ctr)
wrperfmon
(
6
,
reg
->
reset_values
|
(
1
<<
ctr
));
}
static
void
ev6_handle_interrupt
(
unsigned
long
which
,
struct
pt_regs
*
regs
,
struct
op_counter_config
*
ctr
)
{
/* Record the sample. */
oprofile_add_sample
(
regs
->
pc
,
which
,
smp_processor_id
());
}
struct
op_axp_model
op_model_ev6
=
{
.
reg_setup
=
ev6_reg_setup
,
.
cpu_setup
=
ev6_cpu_setup
,
.
reset_ctr
=
ev6_reset_ctr
,
.
handle_interrupt
=
ev6_handle_interrupt
,
.
cpu
=
OPROFILE_CPU_AXP_EV6
,
.
num_counters
=
2
,
.
can_set_proc_mode
=
0
,
...
...
arch/alpha/oprofile/op_model_ev67.c
View file @
728f660c
...
...
@@ -132,7 +132,8 @@ enum profileme_counters {
static
void
op_add_pm
(
unsigned
long
pc
,
unsigned
long
counter
,
struct
op_counter_config
*
ctr
,
unsigned
long
event
)
{
struct
op_counter_config
*
ctr
,
unsigned
long
event
)
{
unsigned
long
fake_counter
=
2
+
event
;
if
(
counter
==
1
)
fake_counter
+=
PM_NUM_COUNTERS
;
...
...
@@ -142,7 +143,8 @@ op_add_pm(unsigned long pc, unsigned long counter,
static
void
ev67_handle_interrupt
(
unsigned
long
which
,
struct
pt_regs
*
regs
,
struct
op_counter_config
*
ctr
)
{
struct
op_counter_config
*
ctr
)
{
unsigned
long
pmpc
,
pctr_ctl
;
int
mispredict
=
0
;
union
{
...
...
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