Modify FinalizeLog syscall

There is no way to know how many entries the syscall log contains
otherwise.  One option was iterating through until finding a 0
terminator, however this requires the log to be zeroed before each
trial.  This changes the FinalizeLog syscall to return the number of
entries.
This commit is contained in:
Kent McLeod 2017-02-11 20:02:46 +11:00
parent e937d96801
commit aa656604db
7 changed files with 35 additions and 18 deletions

View file

@ -391,11 +391,18 @@ seL4_BenchmarkResetLog(void)
return (seL4_Error) ret;
}
LIBSEL4_INLINE_FUNC void
LIBSEL4_INLINE_FUNC seL4_Word
seL4_BenchmarkFinalizeLog(void)
{
arm_sys_null(seL4_SysBenchmarkFinalizeLog);
asm volatile("" ::: "memory");
seL4_Word unused0 = 0;
seL4_Word unused1 = 0;
seL4_Word unused2 = 0;
seL4_Word unused3 = 0;
seL4_Word unused4 = 0;
seL4_Word index_ret;
arm_sys_send_recv(seL4_SysBenchmarkFinalizeLog, 0, &index_ret, 0, &unused0, &unused1, &unused2, &unused3, &unused4);
return (seL4_Word)index_ret;
}
LIBSEL4_INLINE_FUNC seL4_Error

View file

@ -603,11 +603,16 @@ seL4_BenchmarkResetLog(void)
return (seL4_Error)ret;
}
LIBSEL4_INLINE_FUNC void
LIBSEL4_INLINE_FUNC seL4_Word
seL4_BenchmarkFinalizeLog(void)
{
x86_sys_null(seL4_SysBenchmarkFinalizeLog);
asm volatile("" :::"%esi", "%edi", "memory");
seL4_Word unused0 = 0;
seL4_Word unused1 = 0;
seL4_Word unused2 = 0;
seL4_Word index_ret;
x86_sys_send_recv(seL4_SysBenchmarkFinalizeLog, 0, &index_ret, 0, &unused0, &unused1, &unused2);
return (seL4_Word)index_ret;
}
LIBSEL4_INLINE_FUNC seL4_Error

View file

@ -419,11 +419,18 @@ seL4_BenchmarkResetLog(void)
return (seL4_Error)ret;
}
LIBSEL4_INLINE_FUNC void
LIBSEL4_INLINE_FUNC seL4_Word
seL4_BenchmarkFinalizeLog(void)
{
x64_sys_null(seL4_SysBenchmarkFinalizeLog);
asm volatile("" ::: "memory");
seL4_Word unused0 = 0;
seL4_Word unused1 = 0;
seL4_Word unused2 = 0;
seL4_Word unused3 = 0;
seL4_Word unused4 = 0;
seL4_Word index_ret;
x64_sys_send_recv(seL4_SysBenchmarkFinalizeLog, 0, &index_ret, 0, &unused0, &unused1, &unused2, &unused3, &unused4);
return (seL4_Word)index_ret;
}
LIBSEL4_INLINE_FUNC seL4_Error

View file

@ -147,6 +147,7 @@ handleUnknownSyscall(word_t w)
} else if (w == SysBenchmarkFinalizeLog) {
#ifdef CONFIG_BENCHMARK_USE_KERNEL_LOG_BUFFER
ksLogIndexFinalized = ksLogIndex;
setRegister(NODE_STATE(ksCurThread), capRegister, ksLogIndexFinalized);
#endif /* CONFIG_BENCHMARK_USE_KERNEL_LOG_BUFFER */
#ifdef CONFIG_BENCHMARK_TRACK_UTILISATION
benchmark_utilisation_finalise();

View file

@ -16,9 +16,7 @@
timestamp_t ksEntries[CONFIG_MAX_NUM_TRACE_POINTS];
bool_t ksStarted[CONFIG_MAX_NUM_TRACE_POINTS];
timestamp_t ksExit;
uint32_t ksLogIndex = 0;
uint32_t ksLogIndexFinalized = 0;
seL4_Word ksLogIndex = 0;
seL4_Word ksLogIndexFinalized = 0;
#endif /* CONFIG_MAX_NUM_TRACE_POINTS > 0 */

View file

@ -17,8 +17,7 @@
timestamp_t ksEntries[CONFIG_MAX_NUM_TRACE_POINTS];
bool_t ksStarted[CONFIG_MAX_NUM_TRACE_POINTS];
timestamp_t ksExit;
uint32_t ksLogIndex = 0;
uint32_t ksLogIndexFinalized = 0;
seL4_Word ksLogIndex = 0;
seL4_Word ksLogIndexFinalized = 0;
#endif /* CONFIG_MAX_NUM_TRACE_POINTS > 0 */

View file

@ -15,8 +15,8 @@
#ifdef CONFIG_BENCHMARK_TRACK_KERNEL_ENTRIES
timestamp_t ksEnter;
word_t ksLogIndex;
uint32_t ksLogIndexFinalized;
seL4_Word ksLogIndex;
seL4_Word ksLogIndexFinalized;
void benchmark_track_exit(void)
{