|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [UNIKRAFT PATCH 2/5] lib/ukdebug: Option to hide source code locations from messages
Provides an option to hide the source code location of each ukdebug
message.
Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
lib/ukdebug/Config.uk | 4 ++++
lib/ukdebug/print.c | 10 ++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/lib/ukdebug/Config.uk b/lib/ukdebug/Config.uk
index c844d9a2..799593b8 100644
--- a/lib/ukdebug/Config.uk
+++ b/lib/ukdebug/Config.uk
@@ -69,6 +69,10 @@ config LIBUKDEBUG_PRINT_STACK
bool "Print bottom address of stack in messages"
default n
+config LIBUKDEBUG_PRINT_SRCNAME
+ bool "Print source code location of messages"
+ default y
+
config LIBUKDEBUG_ENABLE_ASSERT
bool "Enable assertions"
default y
diff --git a/lib/ukdebug/print.c b/lib/ukdebug/print.c
index e34199c8..1a12898e 100644
--- a/lib/ukdebug/print.c
+++ b/lib/ukdebug/print.c
@@ -31,8 +31,6 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
- *
- * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
*/
#include "snprintf.h"
@@ -104,8 +102,10 @@ static void _print_stack(struct _vprint_console *cons)
#endif
static void _vprint(struct _vprint_console *cons,
- int lvl, const char *libname, const char *srcname,
- unsigned int srcline, const char *fmt, va_list ap)
+ int lvl, const char *libname,
+ const char *srcname __maybe_unused,
+ unsigned int srcline __maybe_unused,
+ const char *fmt, va_list ap)
{
char lbuf[BUFLEN];
int len, llen;
@@ -163,6 +163,7 @@ static void _vprint(struct _vprint_console *cons,
strlen(libname));
cons->cout("] ", 2);
}
+#if CONFIG_LIBUKDEBUG_PRINT_SRCNAME
if (srcname) {
char lnobuf[6];
@@ -174,6 +175,7 @@ static void _vprint(struct _vprint_console *cons,
"%-5u", srcline));
cons->cout(": ", 2);
}
+#endif
cons->newline = 0;
}
--
2.20.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |