/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/debug.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-10-12 23:59:17 UTC
  • Revision ID: csa@suren.me-20151012235917-s5oi62kmu8khjl0t
Support writting register views

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
#include <stdarg.h>
5
5
#include <pcilib/env.h>
 
6
#include <pcilib/error.h>
6
7
 
7
8
#define PCILIB_DEBUG
8
9
 
9
10
#ifdef PCILIB_DEBUG
10
11
# define PCILIB_DEBUG_DMA
11
12
# define PCILIB_DEBUG_MISSING_EVENTS
 
13
# define PCILIB_DEBUG_VIEWS
12
14
#endif /* PCILIB_DEBUG */
13
15
 
14
16
 
28
30
# define PCILIB_DEBUG_MISSING_EVENTS_BUFFER(function, ...)
29
31
#endif /* PCILIB_DEBUG_MISSING_EVENTS */
30
32
 
 
33
#ifdef PCILIB_DEBUG_VIEWS
 
34
# define PCILIB_DEBUG_VIEWS_MESSAGE(function, ...) if (pcilib_getenv(function##_ENV, #function)) { pcilib_debug_message (#function, __FILE__, __LINE__, __VA_ARGS__); }
 
35
# define PCILIB_DEBUG_VIEWS_BUFFER(function, ...) if (pcilib_getenv(function##_ENV #function)) { pcilib_debug_data_buffer (#function, __VA_ARGS__); }
 
36
#else /* PCILIB_DEBUG_VIEWS */
 
37
# define PCILIB_DEBUG_VIEWS_MESSAGE(function, ...)
 
38
# define PCILIB_DEBUG_VIEWS_BUFFER(function, ...)
 
39
#endif /* PCILIB_DEBUG_VIEWS */
 
40
 
31
41
#define pcilib_debug(function, ...) \
32
42
    PCILIB_DEBUG_##function##_MESSAGE(PCILIB_DEBUG_##function, PCILIB_LOG_DEFAULT, __VA_ARGS__)
33
43