Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
b9117423
Commit
b9117423
authored
18 years ago
by
edgrif
Browse files
Options
Downloads
Patches
Plain Diff
simplify file, function, line macro stuff + add some timer macros.
parent
25e4f99a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/include/ZMap/zmapUtilsDebug.h
+41
-14
41 additions, 14 deletions
src/include/ZMap/zmapUtilsDebug.h
with
41 additions
and
14 deletions
src/include/ZMap/zmapUtilsDebug.h
+
41
−
14
View file @
b9117423
...
...
@@ -25,9 +25,9 @@
* Description: Contains macros, functions etc. useful for testing/debugging.
*
* HISTORY:
* Last edited:
Apr
8
1
7:05
200
4
(edgrif)
* Last edited:
Nov
7
1
6:47
200
6
(edgrif)
* Created: Mon Mar 29 16:51:28 2004 (edgrif)
* CVS info: $Id: zmapUtilsDebug.h,v 1.
1
200
4-04
-0
8
1
6:14:53
edgrif Exp $
* CVS info: $Id: zmapUtilsDebug.h,v 1.
2
200
6-11
-0
7
1
7:00:32
edgrif Exp $
*-------------------------------------------------------------------
*/
#ifndef ZMAP_UTILS_DEBUG_H
...
...
@@ -57,26 +57,53 @@ g_assert_not_reached()
extern
gboolean
zmap_debug_G
;
#ifdef HOME
/* Stupid home system needs updating.... */
#define zMapDebug(FORMAT, ...)
#else
/* Takes the standard printf like args: ZMAP_DEBUG("format string", lots, of, args) ; */
#define zMapDebug(FORMAT, ...) \
G_STMT_START{ \
if (zmap_debug_G) \
g_printerr(ZMAP_MSG_FORMAT_STRING FORMAT, \
__FILE__, \
ZMAP_MSG_FUNCTION_MACRO \
__LINE__, \
ZMAP_MSG_FUNCTION_MACRO, \
__VA_ARGS__) ; \
}G_STMT_END
#endif
/*HOME*/
/* Timer functions, just simplifies printing etc a bit and provides a global timer if required.
* Just comment out #define ZMAP_DISABLE_TIMER to make it all work.
*/
/* #define ZMAP_DISABLE_TIMER */
#ifdef ZMAP_DISABLE_TIMER
#define zMapStartTimer(TIMER_PTR) (void)0
#define zMapPrintTimer(TIMER, TEXT) (void)0
#else
#define ZMAP_GLOBAL_TIMER zmap_global_timer_G
extern
GTimer
*
ZMAP_GLOBAL_TIMER
;
/* A bit clumsy but couln't see a neat way to allow just putting NULL for the timer to get
* the global one.
* Do this for the global one: zMapStartTimer(ZMAP_GLOBAL_TIMER) ;
* and this for your one: zMapStartTimer(your_timer_ptr) ;
* */
#define zMapStartTimer(TIMER_PTR) \
(TIMER_PTR) = g_timer_new()
/* Takes an optional Gtimer* and an optional char* (you must supply the arg but it can NULL */
#define zMapPrintTimer(TIMER, TEXT) \
printf(ZMAP_MSG_FORMAT_STRING " %s - elapsed time: %g\n", \
ZMAP_MSG_FUNCTION_MACRO, \
(TEXT), \
g_timer_elapsed(((TIMER) ? (TIMER) : ZMAP_GLOBAL_TIMER), NULL)) ;
#endif
/* ZMAP_DISABLE_TIMER */
#endif
/* ZMAP_UTILS_DEBUG_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment