Merge pull request #372 in SEL4/sel4 from ~HALMATARY/sel4:BenchmarkNullSyscall to master
* commit '9c507cffd1472a41700417c91d87d7e12d1eb641': SELFOUR-603 - Benchmark: Add null syscall Benchmarks: Add new generic benchmark entry mode
This commit is contained in:
commit
c8a9178c8a
5 changed files with 40 additions and 0 deletions
6
Kconfig
6
Kconfig
|
|
@ -552,6 +552,12 @@ menu "Build Options"
|
|||
config NO_BENCHMARKS
|
||||
bool "No benchmarking features enabled"
|
||||
|
||||
config BENCHMARK_GENERIC
|
||||
bool "Enable generic benchmarks"
|
||||
select ENABLE_BENCHMARKS
|
||||
help
|
||||
Enable global benchmarks config variable with no specific features
|
||||
|
||||
config BENCHMARK_TRACK_KERNEL_ENTRIES
|
||||
bool "Keep track of kernel entries"
|
||||
select ENABLE_BENCHMARKS
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
<syscall name="BenchmarkResetLog" />
|
||||
<syscall name="BenchmarkFinalizeLog" />
|
||||
<syscall name="BenchmarkSetLogBuffer" />
|
||||
<syscall name="BenchmarkNullSyscall" />
|
||||
</config>
|
||||
<config condition="defined CONFIG_BENCHMARK_TRACK_UTILISATION">
|
||||
<syscall name="BenchmarkGetThreadUtilisation" />
|
||||
|
|
|
|||
|
|
@ -626,6 +626,17 @@ seL4_BenchmarkSetLogBuffer(seL4_Word frame_cptr)
|
|||
|
||||
return (seL4_Error) arg1;
|
||||
}
|
||||
|
||||
static inline void
|
||||
seL4_BenchmarkNullSyscall(void)
|
||||
{
|
||||
register seL4_Word scno asm("r7") = seL4_SysBenchmarkNullSyscall;
|
||||
asm volatile ("swi %[swi_num]"
|
||||
: /* no outputs */
|
||||
: [swi_num] "i" __SEL4_SWINUM(seL4_SysBenchmarkNullSyscall), "r"(scno)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BENCHMARK_TRACK_UTILISATION
|
||||
static inline void
|
||||
seL4_BenchmarkGetThreadUtilisation(seL4_Word tcp_cptr)
|
||||
|
|
|
|||
|
|
@ -730,6 +730,25 @@ seL4_BenchmarkSetLogBuffer(seL4_Word frame_cptr)
|
|||
return (seL4_Error) frame_cptr;
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
seL4_BenchmarkNullSyscall(void)
|
||||
{
|
||||
asm volatile (
|
||||
"pushl %%ebp \n"
|
||||
SEL4_REGS_SAVE
|
||||
"movl %%esp, %%ecx \n"
|
||||
"leal 1f, %%edx \n"
|
||||
"1: \n"
|
||||
"sysenter \n"
|
||||
SEL4_REGS_RESTORE
|
||||
"popl %%ebp \n"
|
||||
:
|
||||
: "a" (seL4_SysBenchmarkNullSyscall)
|
||||
: SEL4_REGS_CLOBBER_EBX "%ecx", "%edx", "%esi", "%edi", "memory"
|
||||
);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BENCHMARK_TRACK_UTILISATION
|
||||
static inline void
|
||||
seL4_BenchmarkGetThreadUtilisation(seL4_Word tcb_cptr)
|
||||
|
|
|
|||
|
|
@ -171,6 +171,9 @@ handleUnknownSyscall(word_t w)
|
|||
}
|
||||
#endif /* CONFIG_BENCHMARK_TRACK_UTILISATION */
|
||||
|
||||
else if (w == SysBenchmarkNullSyscall) {
|
||||
return EXCEPTION_NONE;
|
||||
}
|
||||
#endif /* CONFIG_ENABLE_BENCHMARKS */
|
||||
|
||||
current_fault = fault_unknown_syscall_new(w);
|
||||
|
|
|
|||
Loading…
Reference in a new issue