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
b73d8847
Commit
b73d8847
authored
Sep 10, 2009
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc64: Initial niagara2 perf counter support.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
660d1376
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
arch/sparc/kernel/perf_counter.c
arch/sparc/kernel/perf_counter.c
+30
-0
No files found.
arch/sparc/kernel/perf_counter.c
View file @
b73d8847
...
...
@@ -102,6 +102,32 @@ static const struct sparc_pmu ultra3i_pmu = {
.
lower_nop
=
0x14
,
};
static
const
struct
perf_event_map
niagara2_perfmon_event_map
[]
=
{
[
PERF_COUNT_HW_CPU_CYCLES
]
=
{
0x02ff
,
PIC_UPPER
|
PIC_LOWER
},
[
PERF_COUNT_HW_INSTRUCTIONS
]
=
{
0x02ff
,
PIC_UPPER
|
PIC_LOWER
},
[
PERF_COUNT_HW_CACHE_REFERENCES
]
=
{
0x0208
,
PIC_UPPER
|
PIC_LOWER
},
[
PERF_COUNT_HW_CACHE_MISSES
]
=
{
0x0302
,
PIC_UPPER
|
PIC_LOWER
},
[
PERF_COUNT_HW_BRANCH_INSTRUCTIONS
]
=
{
0x0201
,
PIC_UPPER
|
PIC_LOWER
},
[
PERF_COUNT_HW_BRANCH_MISSES
]
=
{
0x0202
,
PIC_UPPER
|
PIC_LOWER
},
};
static
const
struct
perf_event_map
*
niagara2_event_map
(
int
event
)
{
return
&
niagara2_perfmon_event_map
[
event
];
}
static
const
struct
sparc_pmu
niagara2_pmu
=
{
.
event_map
=
niagara2_event_map
,
.
max_events
=
ARRAY_SIZE
(
niagara2_perfmon_event_map
),
.
upper_shift
=
19
,
.
lower_shift
=
6
,
.
event_mask
=
0xfff
,
.
hv_bit
=
0x8
,
.
irq_bit
=
0x03
,
.
upper_nop
=
0x220
,
.
lower_nop
=
0x220
,
};
static
const
struct
sparc_pmu
*
sparc_pmu
__read_mostly
;
static
u64
event_encoding
(
u64
event
,
int
idx
)
...
...
@@ -504,6 +530,10 @@ static bool __init supported_pmu(void)
sparc_pmu
=
&
ultra3i_pmu
;
return
true
;
}
if
(
!
strcmp
(
sparc_pmu_type
,
"niagara2"
))
{
sparc_pmu
=
&
niagara2_pmu
;
return
true
;
}
return
false
;
}
...
...
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