From 90a5d194a2712d7e28eafa1aac0b9fdb32e7b96b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Sep 2007 22:51:25 +0000 Subject: 2007-09-06 Joel Sherrill * libcsupport/Makefile.am, libcsupport/src/printk.c: * libcsupport/src/printk_plugin.c: New file. include/rtems/bspIo.h, libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuuse.h, libmisc/stackchk/check.c, libmisc/stackchk/stackchk.h: rtems/include/rtems/rtems/ratemon.h, rtems/src/ratemonreportstatistics.c: Added capability to specify your own "printf" routine to various reporting functions. This added an XXX_with_plugin as the underlying implementation for + rtems_rate_monotonic_report_statistics + rtems_stack_checker_report_usage + rtems_cpu_usage_report As demonstration, the http netdemo can now print out stack and cpu usage reports. --- cpukit/include/rtems/bspIo.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'cpukit/include/rtems/bspIo.h') diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h index d3eda5610a..3e8eb5a534 100644 --- a/cpukit/include/rtems/bspIo.h +++ b/cpukit/include/rtems/bspIo.h @@ -37,8 +37,25 @@ extern BSP_polling_getchar_function_type BSP_poll_char; * and initialisation of the previous variable are done. */ #include -extern void vprintk(char *fmt, va_list ap); -extern void printk(char *fmt, ...); + +extern void vprintk(const char *fmt, va_list ap); +extern void printk(const char *fmt, ...); + +/* + * This routine is passed into RTEMS reporting functions + * that may have their output redirected. In particular, + * the cpu usage, period usage, and stack usage reporting + * functions use this. If the user provides their + * own "printf plugin", then they may redirect those reports + * as they see fit. + */ +extern int printk_plugin(void *context, const char *fmt, ...); + +/* + * Type definition for function which can be plugged in to + * certain reporting routines to redirect the output + */ +typedef int (*rtems_printk_plugin_t)(void *, const char *format, ...); #ifdef __cplusplus } -- cgit v1.2.3