seL4/include/api/debug.h
Hesham Almatary fc1feb670e SELFOUR-446 Benchmark: Track syscall feature
Benchmark feature that currently:
- Keeps track of system calls info
- Start time
- Duration
- Capability type
- Invocation tag
- Log the number of invocations of each system call*
- Log the number of invocations for each capability type per syscall.
- Has 3 new syscalls (dump, reset, get size).
- This new feature uses the existing log buffer (which is 1MiB for x86
and ARM). Since the number of syscall invocations is not
deterministic, the logged number of invocations is limited by the size
of the buffer. I suggested to enable the users to pass their own
user-level buffer, to enable more flexibility, later.
- ENABLE_BENCHMARKS is now a parent config option of trace points and
system call track features, they can't be used at the same time.
2016-05-25 13:47:49 +10:00

53 lines
1.5 KiB
C

/*
* Copyright 2014, General Dynamics C4 Systems
*
* This software may be distributed and modified according to the terms of
* the GNU General Public License version 2. Note that NO WARRANTY is provided.
* See "LICENSE_GPLv2.txt" for details.
*
* @TAG(GD_GPL)
*/
#include <config.h>
#ifdef DEBUG
#ifndef __API_DEBUG_H
#define __API_DEBUG_H
#include <benchmark_track.h>
#include <arch/api/syscall.h>
#include <model/statedata.h>
#ifdef CONFIG_PRINTING
static inline void
debug_printKernelEntryReason(void)
{
switch (ksKernelEntry.path) {
case Entry_Interrupt:
printf("Interrupt, irq %lu\n", (unsigned long) ksKernelEntry.word);
break;
case Entry_UnknownSyscall:
printf("Unknown syscall, word: %lu", (unsigned long) ksKernelEntry.word);
break;
case Entry_VMFault:
printf("VM Fault, fault type: %lu\n", (unsigned long) ksKernelEntry.word);
break;
case Entry_UserLevelFault:
printf("User level fault, number: %lu", (unsigned long) ksKernelEntry.word);
break;
case Entry_Syscall:
printf("Syscall, number: %ld\n", (long) ksKernelEntry.syscall_no);
if (ksKernelEntry.syscall_no == SysSend ||
ksKernelEntry.syscall_no == SysNBSend ||
ksKernelEntry.syscall_no == SysCall) {
printf("Cap type: %lu, Invocation tag: %lu\n", (unsigned long) ksKernelEntry.cap_type,
(unsigned long) ksKernelEntry.invocation_tag);
}
}
}
#endif
#endif /* __API_DEBUG_H */
#endif /* DEBUG */