microblaze: Improve ftrace time measuring
I had to comment sched_clock generic function because of broken toolchain. It is fine grain timing. Signed-off-by: Michal Simek <monstr@monstr.eu>hifive-unleashed-5.1
parent
ce3266c047
commit
6f34b08f58
|
@ -28,8 +28,6 @@ void disable_early_printk(void);
|
||||||
void heartbeat(void);
|
void heartbeat(void);
|
||||||
void setup_heartbeat(void);
|
void setup_heartbeat(void);
|
||||||
|
|
||||||
unsigned long long sched_clock(void);
|
|
||||||
|
|
||||||
# ifdef CONFIG_MMU
|
# ifdef CONFIG_MMU
|
||||||
extern void mmu_reset(void);
|
extern void mmu_reset(void);
|
||||||
extern void early_console_reg_tlb_alloc(unsigned int addr);
|
extern void early_console_reg_tlb_alloc(unsigned int addr);
|
||||||
|
|
|
@ -235,6 +235,12 @@ static int __init microblaze_clocksource_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We have to protect accesses before timer initialization
|
||||||
|
* and return 0 for sched_clock function below.
|
||||||
|
*/
|
||||||
|
static int timer_initialized;
|
||||||
|
|
||||||
void __init time_init(void)
|
void __init time_init(void)
|
||||||
{
|
{
|
||||||
u32 irq, i = 0;
|
u32 irq, i = 0;
|
||||||
|
@ -289,4 +295,15 @@ void __init time_init(void)
|
||||||
#endif
|
#endif
|
||||||
microblaze_clocksource_init();
|
microblaze_clocksource_init();
|
||||||
microblaze_clockevent_init();
|
microblaze_clockevent_init();
|
||||||
|
timer_initialized = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long long notrace sched_clock(void)
|
||||||
|
{
|
||||||
|
if (timer_initialized) {
|
||||||
|
struct clocksource *cs = &clocksource_microblaze;
|
||||||
|
cycle_t cyc = cs->read(NULL);
|
||||||
|
return clocksource_cyc2ns(cyc, cs->mult, cs->shift);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue