mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-11 20:01:48 +00:00
lx_emul: function to generate trace messages
lx_emul_trace_msg() uses Genode::trace() as message function for lightweight trace points, but also supports Linux format-string attributes by using vsnprintf().
This commit is contained in:
@ -23,6 +23,8 @@ __attribute__((noreturn)) void lx_emul_trace_and_stop(const char * func);
|
|||||||
|
|
||||||
void lx_emul_trace(const char * func);
|
void lx_emul_trace(const char * func);
|
||||||
|
|
||||||
|
__attribute__((__format__(printf, 1, 2))) void lx_emul_trace_msg(char const *fmt, ...);
|
||||||
|
|
||||||
void lx_emul_backtrace(void);
|
void lx_emul_backtrace(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -29,7 +29,7 @@ extern "C" void lx_emul_trace_and_stop(const char * func)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern "C" void lx_emul_trace(const char *) {}
|
extern "C" void lx_emul_trace(const char *s) { trace(s); }
|
||||||
|
|
||||||
|
|
||||||
extern "C" void lx_emul_backtrace()
|
extern "C" void lx_emul_backtrace()
|
||||||
|
@ -56,3 +56,13 @@ asmlinkage int vprintk_emit(int facility, int level,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void lx_emul_trace_msg(char const *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
va_start(args, fmt);
|
||||||
|
vsnprintf(print_string, sizeof(print_string), fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
lx_emul_trace(print_string);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user