s3:mdssvc: move debug macro to header file
authorRalph Boehme <slow@samba.org>
Wed, 7 Aug 2019 09:59:39 +0000 (11:59 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 8 Aug 2019 20:24:31 +0000 (20:24 +0000)
This is going to be used from other parts of the code soon.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/mdssvc/mdssvc.c
source3/rpc_server/mdssvc/mdssvc.h

index 41aa089bf209138d5c95131ea68876f34ca9d4f5..85da89d4ef0711d1e39c00837647a81e28848cbe 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
 
-#define SLQ_DEBUG(lvl, _slq, state) do { if (CHECK_DEBUGLVL(lvl)) {    \
-       const struct sl_query *__slq = _slq;                            \
-       struct timeval_buf start_buf;                                   \
-       const char *start;                                              \
-       struct timeval_buf last_used_buf;                               \
-       const char *last_used;                                          \
-       struct timeval_buf expire_buf;                                  \
-       const char *expire;                                             \
-       start = timeval_str_buf(&__slq->start_time, false,              \
-                               true, &start_buf);                      \
-       last_used = timeval_str_buf(&__slq->last_used, false,           \
-                                   true, &last_used_buf);              \
-       expire = timeval_str_buf(&__slq->expire_time, false,            \
-                                true, &expire_buf);                    \
-       DEBUG(lvl,("%s slq[0x%jx,0x%jx], start: %s, last_used: %s, "    \
-                  "expires: %s, query: '%s'\n", state,                 \
-                  (uintmax_t)__slq->ctx1, (uintmax_t)__slq->ctx2,      \
-                  start, last_used, expire, __slq->query_string));     \
-}} while(0)
-
 struct slrpc_cmd {
        const char *name;
        bool (*function)(struct mds_ctx *mds_ctx,
index baf0e92f8f28dfb13e125caa938aa0f868626d1d..2260a38e6d21bed1c1e5581e9e00253657611384 100644 (file)
 #define MAX_SL_RUNTIME 30
 #define MDS_TRACKER_ASYNC_TIMEOUT_MS 250
 
+#define SLQ_DEBUG(lvl, _slq, state) do { if (CHECK_DEBUGLVL(lvl)) {    \
+       const struct sl_query *__slq = _slq;                            \
+       struct timeval_buf start_buf;                                   \
+       const char *start;                                              \
+       struct timeval_buf last_used_buf;                               \
+       const char *last_used;                                          \
+       struct timeval_buf expire_buf;                                  \
+       const char *expire;                                             \
+       start = timeval_str_buf(&__slq->start_time, false,              \
+                               true, &start_buf);                      \
+       last_used = timeval_str_buf(&__slq->last_used, false,           \
+                                   true, &last_used_buf);              \
+       expire = timeval_str_buf(&__slq->expire_time, false,            \
+                                true, &expire_buf);                    \
+       DEBUG(lvl,("%s slq[0x%jx,0x%jx], start: %s, last_used: %s, "    \
+                  "expires: %s, query: '%s'\n", state,                 \
+                  (uintmax_t)__slq->ctx1, (uintmax_t)__slq->ctx2,      \
+                  start, last_used, expire, __slq->query_string));     \
+}} while(0)
+
 /******************************************************************************
  * Some helper stuff dealing with queries
  ******************************************************************************/