From 5c826f9de142a9d4558e0b3aefab9c90d70c8c54 Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 1 Jul 2005 19:05:46 +0000 Subject: 2005-07-01 Martin Hunt * alloc.c (_stp_alloc): Call _stp_error(). (_stp_valloc): Ditto. * io.c (_stp_warn): New function. (_stp_exit): New function. (_stp_error): New function. (_stp_dbug): New function. * runtime.h (dbug): Call _stp_dbug() if DEBUG is defined. --- runtime/runtime.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'runtime/runtime.h') diff --git a/runtime/runtime.h b/runtime/runtime.h index 1a70da3f..1be35b77 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -1,3 +1,12 @@ +/* main header file + * Copyright (C) 2005 Red Hat Inc. + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + */ + #ifndef _RUNTIME_H_ #define _RUNTIME_H_ /** @file runtime.h @@ -20,7 +29,16 @@ #include #include +#ifdef DEBUG +/** Prints debug line. + * This function prints a debug message immediately to stpd. + * If the last character is not a newline, then one is added. + * @param args A variable number of args in a format like printf. + */ +#define dbug(args...) _stp_dbug(__FUNCTION__, __LINE__, args) +#else #define dbug(args...) ; +#endif /* DEBUG */ /* atomic globals */ static atomic_t _stp_transport_failures = ATOMIC_INIT (0); -- cgit