1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the BSD 2-Clause license. Note that NO WARRANTY is provided. 8 * See "LICENSE_BSD2.txt" for details. 9 * 10 * @TAG(DATA61_BSD) 11 */ 12 13#include <autoconf.h> 14#include <sel4debug/gen_config.h> 15#include <sel4debug/debug.h> 16#include <sel4debug/instrumentation.h> 17 18#ifdef CONFIG_LIBSEL4DEBUG_FUNCTION_INSTRUMENTATION_TRACE 19 20/* Function entry and exit printing. Useful for low effort tracing of 21 * execution. 22 * 23 * Enable this in your app by including: 24 * NK_CFLAGS += -finstrument-functions \ 25 * -finstrument-functions-exclude-function-list=seL4_MessageInfo_get_length 26 * If you don't exclude seL4_MessageInfo_get_length, you will most likely find 27 * that __seL4_*WithMRs will not function correctly because calls to 28 * seL4_MessageInfo_get_length will be instrumented and clobber necessary 29 * registers for the following syscall. 30 */ 31void __cyg_profile_func_enter(void *func, void *caller) 32{ 33 debug_safe_printf("ENTER: %p called from %p\n", func, caller); 34} 35 36void __cyg_profile_func_exit(void *func, void *caller) 37{ 38 debug_safe_printf("EXIT: %p returning to %p\n", func, caller); 39} 40 41#endif 42