Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
ba339c03
Commit
ba339c03
authored
Dec 09, 2005
by
Ralf Baechle
Committed by
Jan 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MIPS: Oprofile: Fixup the loose ends in the plumbing.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
0401572a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
7 deletions
+49
-7
arch/mips/kernel/time.c
arch/mips/kernel/time.c
+25
-1
arch/mips/mips-boards/generic/time.c
arch/mips/mips-boards/generic/time.c
+17
-3
arch/mips/oprofile/op_impl.h
arch/mips/oprofile/op_impl.h
+2
-2
arch/mips/oprofile/op_model_mipsxx.c
arch/mips/oprofile/op_model_mipsxx.c
+5
-1
No files found.
arch/mips/kernel/time.c
View file @
ba339c03
...
...
@@ -507,14 +507,38 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return
IRQ_HANDLED
;
}
int
null_perf_irq
(
struct
pt_regs
*
regs
)
{
return
0
;
}
int
(
*
perf_irq
)(
struct
pt_regs
*
regs
)
=
null_perf_irq
;
EXPORT_SYMBOL
(
null_perf_irq
);
EXPORT_SYMBOL
(
perf_irq
);
asmlinkage
void
ll_timer_interrupt
(
int
irq
,
struct
pt_regs
*
regs
)
{
int
r2
=
cpu_has_mips_r2
;
irq_enter
();
kstat_this_cpu
.
irqs
[
irq
]
++
;
/*
* Suckage alert:
* Before R2 of the architecture there was no way to see if a
* performance counter interrupt was pending, so we have to run the
* performance counter interrupt handler anyway.
*/
if
(
!
r2
||
(
read_c0_cause
()
&
(
1
<<
26
)))
if
(
perf_irq
(
regs
))
goto
out
;
/* we keep interrupt disabled all the time */
timer_interrupt
(
irq
,
NULL
,
regs
);
if
(
!
r2
||
(
read_c0_cause
()
&
(
1
<<
30
)))
timer_interrupt
(
irq
,
NULL
,
regs
);
out:
irq_exit
();
}
...
...
arch/mips/mips-boards/generic/time.c
View file @
ba339c03
...
...
@@ -75,16 +75,29 @@ static void mips_timer_dispatch (struct pt_regs *regs)
do_IRQ
(
mips_cpu_timer_irq
,
regs
);
}
extern
int
null_perf_irq
(
struct
pt_regs
*
regs
);
extern
int
(
*
perf_irq
)(
struct
pt_regs
*
regs
);
irqreturn_t
mips_timer_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
int
r2
=
cpu_has_mips_r2
;
int
cpu
=
smp_processor_id
();
if
(
cpu
==
0
)
{
/*
* CPU 0 handles the global timer interrupt job and process accounting
* resets count/compare registers to trigger next timer int.
* CPU 0 handles the global timer interrupt job and process
* accounting resets count/compare registers to trigger next
* timer int.
*/
timer_interrupt
(
irq
,
dev_id
,
regs
);
if
(
!
r2
||
(
read_c0_cause
()
&
(
1
<<
26
)))
if
(
perf_irq
(
regs
))
goto
out
;
/* we keep interrupt disabled all the time */
if
(
!
r2
||
(
read_c0_cause
()
&
(
1
<<
30
)))
timer_interrupt
(
irq
,
NULL
,
regs
);
scroll_display_message
();
}
else
{
/* Everyone else needs to reset the timer int here as
...
...
@@ -101,6 +114,7 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
local_timer_interrupt
(
irq
,
dev_id
,
regs
);
}
out:
return
IRQ_HANDLED
;
}
...
...
arch/mips/oprofile/op_impl.h
View file @
ba339c03
...
...
@@ -12,8 +12,8 @@
struct
pt_regs
;
extern
void
null_perf_irq
(
struct
pt_regs
*
regs
);
extern
void
(
*
perf_irq
)(
struct
pt_regs
*
regs
);
extern
int
null_perf_irq
(
struct
pt_regs
*
regs
);
extern
int
(
*
perf_irq
)(
struct
pt_regs
*
regs
);
/* Per-counter configuration as set via oprofilefs. */
struct
op_counter_config
{
...
...
arch/mips/oprofile/op_model_mipsxx.c
View file @
ba339c03
...
...
@@ -114,11 +114,12 @@ static void mipsxx_cpu_stop(void *args)
}
}
static
void
mipsxx_perfcount_handler
(
struct
pt_regs
*
regs
)
static
int
mipsxx_perfcount_handler
(
struct
pt_regs
*
regs
)
{
unsigned
int
counters
=
op_model_mipsxx
.
num_counters
;
unsigned
int
control
;
unsigned
int
counter
;
int
handled
=
0
;
switch
(
counters
)
{
#define HANDLE_COUNTER(n) \
...
...
@@ -129,12 +130,15 @@ static void mipsxx_perfcount_handler(struct pt_regs *regs)
(counter & M_COUNTER_OVERFLOW)) { \
oprofile_add_sample(regs, n); \
write_c0_perfcntr ## n(reg.counter[n]); \
handled = 1; \
}
HANDLE_COUNTER
(
3
)
HANDLE_COUNTER
(
2
)
HANDLE_COUNTER
(
1
)
HANDLE_COUNTER
(
0
)
}
return
handled
;
}
#define M_CONFIG1_PC (1 << 4)
...
...
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