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
b4f061a4
Commit
b4f061a4
authored
Aug 17, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc64: Make sparc_pmu_{enable,disable}_event() multi-pcr aware.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
5ab96841
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
arch/sparc/kernel/perf_event.c
arch/sparc/kernel/perf_event.c
+14
-6
No files found.
arch/sparc/kernel/perf_event.c
View file @
b4f061a4
...
@@ -623,27 +623,35 @@ static u64 nop_for_index(int idx)
...
@@ -623,27 +623,35 @@ static u64 nop_for_index(int idx)
static
inline
void
sparc_pmu_enable_event
(
struct
cpu_hw_events
*
cpuc
,
struct
hw_perf_event
*
hwc
,
int
idx
)
static
inline
void
sparc_pmu_enable_event
(
struct
cpu_hw_events
*
cpuc
,
struct
hw_perf_event
*
hwc
,
int
idx
)
{
{
u64
val
,
mask
=
mask_for_index
(
idx
);
u64
val
,
mask
=
mask_for_index
(
idx
);
int
pcr_index
=
0
;
val
=
cpuc
->
pcr
[
0
];
if
(
sparc_pmu
->
num_pcrs
>
1
)
pcr_index
=
idx
;
val
=
cpuc
->
pcr
[
pcr_index
];
val
&=
~
mask
;
val
&=
~
mask
;
val
|=
hwc
->
config
;
val
|=
hwc
->
config
;
cpuc
->
pcr
[
0
]
=
val
;
cpuc
->
pcr
[
pcr_index
]
=
val
;
pcr_ops
->
write_pcr
(
0
,
cpuc
->
pcr
[
0
]);
pcr_ops
->
write_pcr
(
pcr_index
,
cpuc
->
pcr
[
pcr_index
]);
}
}
static
inline
void
sparc_pmu_disable_event
(
struct
cpu_hw_events
*
cpuc
,
struct
hw_perf_event
*
hwc
,
int
idx
)
static
inline
void
sparc_pmu_disable_event
(
struct
cpu_hw_events
*
cpuc
,
struct
hw_perf_event
*
hwc
,
int
idx
)
{
{
u64
mask
=
mask_for_index
(
idx
);
u64
mask
=
mask_for_index
(
idx
);
u64
nop
=
nop_for_index
(
idx
);
u64
nop
=
nop_for_index
(
idx
);
int
pcr_index
=
0
;
u64
val
;
u64
val
;
val
=
cpuc
->
pcr
[
0
];
if
(
sparc_pmu
->
num_pcrs
>
1
)
pcr_index
=
idx
;
val
=
cpuc
->
pcr
[
pcr_index
];
val
&=
~
mask
;
val
&=
~
mask
;
val
|=
nop
;
val
|=
nop
;
cpuc
->
pcr
[
0
]
=
val
;
cpuc
->
pcr
[
pcr_index
]
=
val
;
pcr_ops
->
write_pcr
(
0
,
cpuc
->
pcr
[
0
]);
pcr_ops
->
write_pcr
(
pcr_index
,
cpuc
->
pcr
[
pcr_index
]);
}
}
static
u64
sparc_perf_event_update
(
struct
perf_event
*
event
,
static
u64
sparc_perf_event_update
(
struct
perf_event
*
event
,
...
...
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