Rename lttngerr.h to error.h
authorDavid Goulet <dgoulet@efficios.com>
Fri, 20 Jan 2012 21:43:59 +0000 (16:43 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 20 Jan 2012 21:47:08 +0000 (16:47 -0500)
Also add this header in common.h.

Signed-off-by: David Goulet <dgoulet@efficios.com>
27 files changed:
src/bin/lttng-consumerd/lttng-consumerd.c
src/bin/lttng-sessiond/channel.c
src/bin/lttng-sessiond/context.c
src/bin/lttng-sessiond/event.c
src/bin/lttng-sessiond/futex.c
src/bin/lttng-sessiond/kernel.c
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/session.c
src/bin/lttng-sessiond/shm.c
src/bin/lttng-sessiond/trace-kernel.c
src/bin/lttng-sessiond/trace-ust.c
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/ust-consumer.c
src/bin/lttng-sessiond/utils.c
src/bin/lttng/command.h
src/bin/lttng/conf.c
src/bin/lttng/lttng.c
src/bin/lttng/utils.c
src/common/Makefile.am
src/common/common.h
src/common/compat/compat-epoll.c
src/common/compat/compat-poll.c
src/common/consumer.c
src/common/error.h [new file with mode: 0644]
src/common/lttngerr.h [deleted file]
src/common/runas.c
src/lib/lttng-ctl/lttng-ctl.c

index b501be8730ca8b4d22a997fbb10001d394aaf906..ab83c6a75ab0a7360e9b7eaefa0519002bec1a19 100644 (file)
 #include <config.h>
 #include <urcu/compiler.h>
 
-#include <common/lttngerr.h>
+#include <common/defaults.h>
+#include <common/common.h>
+#include <common/kernel-consumer/kernel-consumer.h>
 #include <common/kernel-ctl/kernel-ctl.h>
 #include <common/sessiond-comm/sessiond-comm.h>
-#include <common/kernel-consumer/kernel-consumer.h>
 #include <common/ust-consumer/ust-consumer.h>
-#include <common/defaults.h>
 
 #include "lttng-consumerd.h"
 
index d7fdbaec634d439b02de77a87c4054709256d1ff..b5202fe6abe0807a35088e5b88ef8cd82e0779ce 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/lttngerr.h>
 #include <common/common.h>
 #include <common/defaults.h>
+#include <common/sessiond-comm/sessiond-comm.h>
 
 #include "channel.h"
 #include "kernel.h"
index 7fc455438fab9cc856b6b37204997a16bccf7919..0144f78248ee8c908077be0ec3b2f9aa66add057 100644 (file)
@@ -22,8 +22,8 @@
 #include <unistd.h>
 #include <urcu/list.h>
 
+#include <common/error.h>
 #include <common/sessiond-comm/sessiond-comm.h>
-#include <common/lttngerr.h>
 
 #include "context.h"
 #include "kernel.h"
index 31c0c971572c8e57aefb49a57e1078b46d07ac76..4a86c22cdd6aa694896c1314e026c837dd5a117d 100644 (file)
@@ -21,8 +21,8 @@
 #include <string.h>
 
 #include <lttng/lttng.h>
+#include <common/error.h>
 #include <common/sessiond-comm/sessiond-comm.h>
-#include <common/lttngerr.h>
 
 #include "channel.h"
 #include "event.h"
index eda1fa313f3353971bd28ffe51c1131b928a1428..0a8a2bb24f09bf1e7c5849e4bd2dfefa54dafdee 100644 (file)
@@ -24,7 +24,7 @@
 #include <urcu.h>
 #include <urcu/futex.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
 
 #include "futex.h"
 
index 2ebd5acbdd79dec5f7441362ccf89bd925c74c95..afa5e604fbefff9a9a2465fb5809cfe884d19f60 100644 (file)
@@ -24,9 +24,8 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <common/kernel-ctl/kernel-ctl.h>
-#include <common/lttngerr.h>
 #include <common/common.h>
+#include <common/kernel-ctl/kernel-ctl.h>
 
 #include "kernel.h"
 
index 8b512f01d8dcda417c41c0c11dcb3aaca7ca1d5f..d7ed4eb0b0a7fc0ec18b99d7fd73a1a8c8b1485e 100644 (file)
 #include <config.h>
 
 #include <bin/lttng-consumerd/lttng-consumerd.h>
-#include <common/lttngerr.h>
-#include <common/kernel-consumer/kernel-consumer.h>
-#include <common/ust-consumer/ust-consumer.h>
 #include <common/common.h>
-#include <common/defaults.h>
 #include <common/compat/poll.h>
+#include <common/defaults.h>
+#include <common/kernel-consumer/kernel-consumer.h>
+#include <common/ust-consumer/ust-consumer.h>
 
 #include "lttng-sessiond.h"
 #include "channel.h"
index ba2cefaaeff64f8e4ae53150b794e5d43f085561..97fc94fe535f939e8e46b17ff4005fe7e6141ab8 100644 (file)
@@ -25,9 +25,8 @@
 #include <sys/types.h>
 #include <urcu.h>
 
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/lttngerr.h>
 #include <common/common.h>
+#include <common/sessiond-comm/sessiond-comm.h>
 
 #include "session.h"
 
index 64c712e85234a65ce50c37397d0d2cb0ef256f0e..77c09995cf194d41620317c90e4ce6b961b8b1af 100644 (file)
@@ -26,7 +26,7 @@
 #include <unistd.h>
 #include <urcu.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
 
 #include "shm.h"
 
index 79e4a2f4e28b7e64a1f83fa242cf4677a570a7c4..7de98b03a4eb745f746fee239e71e1db7901b2ab 100644 (file)
@@ -22,7 +22,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <common/lttngerr.h>
 #include <common/common.h>
 #include <common/defaults.h>
 
index ed6658d7f8a6389e2e4f74e7d2a876c26db16ee0..80644ac8330b438da015b7f149ff10cee002bb5b 100644 (file)
@@ -21,7 +21,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <common/lttngerr.h>
 #include <common/common.h>
 #include <common/defaults.h>
 
index bd91b3c39decb8102b8c1b856fcc505ef0519cb9..e2b32a51ae464f012c3e72832c29285b05e1c0be 100644 (file)
@@ -27,7 +27,6 @@
 #include <unistd.h>
 #include <urcu/compiler.h>
 
-#include <common/lttngerr.h>
 #include <common/common.h>
 
 #include "ust-app.h"
index 63381cea4df702a4bf998702fdbead9429fd8275..26ebfac496c30ed9aa33d53028f36f8cd0495a92 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
-#include <common/lttngerr.h>
 #include <common/common.h>
+#include <common/consumer.h>
 #include <common/defaults.h>
 #include <common/sessiond-comm/sessiond-comm.h>
-#include <common/consumer.h>
 
 #include "ust-consumer.h"
 
index 313f4cf782511e8b0fbab6cb9ecf64bcb22ef7b9..6c4ef0636927a346485e54685c98623704531c05 100644 (file)
@@ -24,7 +24,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
 
 #include "utils.h"
 
index 9caa7b4034333fc6fd70e41fe17fbfa071e594cf..887502bf012ad3699a1ac813789602dda7d494f4 100644 (file)
@@ -20,7 +20,6 @@
 #define _LTTNG_CMD_H
 
 #include <lttng/lttng.h>
-#include <common/lttngerr.h>
 #include <common/common.h>
 #include <common/defaults.h>
 
index 9d2bfbb665206b7a239ccf3476416793c0840463..d326378f7a57f5ecc42168eb9f7a477e244d0017 100644 (file)
@@ -25,7 +25,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
 
 #include "conf.h"
 
index 3181d90120e0ccac3eb19221f0d9e4de1b40b122..2ee93253fe7b50f7ddfc139c58bde769465ec09c 100644 (file)
@@ -26,7 +26,7 @@
 #include <config.h>
 
 #include <lttng/lttng.h>
-#include <common/lttngerr.h>
+#include <common/error.h>
 
 #include "command.h"
 
index 25d463adf92ce49db5642ae488321ce5817116f4..e993f0f7231c8c5b71ef6363e37598f5ba4bda5a 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <stdlib.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
 
 #include "conf.h"
 
index ade89de867914de7e5fcc0a596559161464ff5ac..e9ec3db82b0b18a2e107c500aea33e55eed55c9b 100644 (file)
@@ -4,7 +4,7 @@ SUBDIRS = hashtable kernel-ctl sessiond-comm kernel-consumer ust-consumer
 
 AM_CFLAGS = -fno-strict-aliasing
 
-noinst_HEADERS = lttngerr.h lttng-kernel.h defaults.h macros.h
+noinst_HEADERS = lttng-kernel.h defaults.h macros.h
 
 noinst_LTLIBRARIES = libcommon.la
 
index 952a10a55bcf0a8c89c1ec9cb23a2a84a79b277a..cc4a4c7a9b063553e37fe921a20ac9114d84682f 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef _COMMON_H
 #define _COMMON_H
 
-#include "lttngerr.h"
+#include "error.h"
 #include "macros.h"
 #include "runas.h"
 
index 460bc3b373b4ffb1c7d4f00f381ca49cac1c6890..dc1a3b92689904ff4cbc8db49e3d5a3a353b0dcb 100644 (file)
@@ -23,7 +23,7 @@
 #include <unistd.h>
 #include <config.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
 #include <common/defaults.h>
 
 #include "poll.h"
index 7b15c737e6a0333ce5044ce2402d62d35aa1f643..51bf22c865ddd6dff74359e39e54e5a8adf22e94 100644 (file)
@@ -19,8 +19,8 @@
 #include <sys/resource.h>
 #include <sys/time.h>
 
-#include <lttngerr.h>
 #include <common/defaults.h>
+#include <common/error.h>
 
 #include "poll.h"
 
index cba9e64063fb0c2a948867b3a15335ec7d44c418..b605591e478a1c2a40dd13a25228bd2ad80bc684 100644 (file)
@@ -30,7 +30,6 @@
 #include <unistd.h>
 
 #include <common/common.h>
-#include <common/lttngerr.h>
 #include <common/kernel-ctl/kernel-ctl.h>
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/kernel-consumer/kernel-consumer.h>
diff --git a/src/common/error.h b/src/common/error.h
new file mode 100644 (file)
index 0000000..2ce6f57
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C)  2011 - David Goulet <david.goulet@polymtl.ca>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; only version 2 of the License.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#ifndef _ERROR_H
+#define _ERROR_H
+
+#include <errno.h>
+#include <stdio.h>
+
+/* Stringify the expansion of a define */
+#define XSTR(d) STR(d)
+#define STR(s) #s
+
+extern int opt_quiet;
+extern int opt_verbose;
+
+#define PRINT_ERR   0x1
+#define PRINT_WARN  0x2
+#define PRINT_BUG   0x3
+#define PRINT_MSG   0x4
+#define PRINT_DBG   0x10
+#define PRINT_DBG2  0x20
+#define PRINT_DBG3  0x30
+
+/*
+ * Macro for printing message depending on command line option and verbosity.
+ */
+#define __lttng_print(type, fmt, args...)                                 \
+       do {                                                                  \
+               if (opt_quiet == 0) {                                             \
+                       if (type == PRINT_MSG) {                                      \
+                               fprintf(stdout, fmt, ## args);                            \
+                       } else if (((type & PRINT_DBG) && opt_verbose == 1) ||        \
+                                       ((type & (PRINT_DBG | PRINT_DBG2)) &&                 \
+                                               opt_verbose == 2) ||                              \
+                                       ((type & (PRINT_DBG | PRINT_DBG2 | PRINT_DBG3)) &&    \
+                                               opt_verbose == 3)) {                              \
+                               fprintf(stderr, fmt, ## args);                            \
+                       } else if (type & (PRINT_ERR | PRINT_WARN | PRINT_BUG)) {     \
+                               fprintf(stderr, fmt, ## args);                            \
+                       }                                                             \
+               }                                                                 \
+       } while (0);
+
+#define MSG(fmt, args...) \
+       __lttng_print(PRINT_MSG, fmt "\n", ## args)
+#define ERR(fmt, args...) \
+       __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args)
+#define WARN(fmt, args...) \
+       __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ## args)
+#define BUG(fmt, args...) \
+       __lttng_print(PRINT_BUG, "BUG: " fmt "\n", ## args)
+
+/* Three level of debug. Use -v, -vv or -vvv for the levels */
+#define DBG(fmt, args...) __lttng_print(PRINT_DBG, "DEBUG1: " fmt \
+               " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
+#define DBG2(fmt, args...) __lttng_print(PRINT_DBG2, "DEBUG2: " fmt \
+               " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
+#define DBG3(fmt, args...) __lttng_print(PRINT_DBG3, "DEBUG3: " fmt \
+               " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
+
+#define _PERROR(fmt, args...) \
+       __lttng_print(PRINT_ERR, "perror " fmt "\n", ## args)
+
+#define PERROR(call, args...) \
+    do { \
+               char *buf; \
+               char tmp[200]; \
+               buf = strerror_r(errno, tmp, sizeof(tmp)); \
+               _PERROR(call ": %s", ## args, buf); \
+       } while(0);
+
+#endif /* _ERROR_H */
diff --git a/src/common/lttngerr.h b/src/common/lttngerr.h
deleted file mode 100644 (file)
index b14f232..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C)  2011 - David Goulet <david.goulet@polymtl.ca>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; only version 2
- * of the License.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
-
-#ifndef _LTTNGERR_H
-#define _LTTNGERR_H
-
-#include <errno.h>
-#include <stdio.h>
-
-/* Stringify the expansion of a define */
-#define XSTR(d) STR(d)
-#define STR(s) #s
-
-extern int opt_quiet;
-extern int opt_verbose;
-
-#define PRINT_ERR   0x1
-#define PRINT_WARN  0x2
-#define PRINT_BUG   0x3
-#define PRINT_MSG   0x4
-#define PRINT_DBG   0x10
-#define PRINT_DBG2  0x20
-#define PRINT_DBG3  0x30
-
-/*
- * Macro for printing message depending on command line option and verbosity.
- */
-#define __lttng_print(type, fmt, args...)                                 \
-       do {                                                                  \
-               if (opt_quiet == 0) {                                             \
-                       if (type == PRINT_MSG) {                                      \
-                               fprintf(stdout, fmt, ## args);                            \
-                       } else if (((type & PRINT_DBG) && opt_verbose == 1) ||        \
-                                       ((type & (PRINT_DBG | PRINT_DBG2)) &&                 \
-                                               opt_verbose == 2) ||                              \
-                                       ((type & (PRINT_DBG | PRINT_DBG2 | PRINT_DBG3)) &&    \
-                                               opt_verbose == 3)) {                              \
-                               fprintf(stderr, fmt, ## args);                            \
-                       } else if (type & (PRINT_ERR | PRINT_WARN | PRINT_BUG)) {     \
-                               fprintf(stderr, fmt, ## args);                            \
-                       }                                                             \
-               }                                                                 \
-       } while (0);
-
-#define MSG(fmt, args...) \
-       __lttng_print(PRINT_MSG, fmt "\n", ## args)
-#define ERR(fmt, args...) \
-       __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args)
-#define WARN(fmt, args...) \
-       __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ## args)
-#define BUG(fmt, args...) \
-       __lttng_print(PRINT_BUG, "BUG: " fmt "\n", ## args)
-
-/* Three level of debug. Use -v, -vv or -vvv for the levels */
-#define DBG(fmt, args...) __lttng_print(PRINT_DBG, "DEBUG1: " fmt \
-               " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
-#define DBG2(fmt, args...) __lttng_print(PRINT_DBG2, "DEBUG2: " fmt \
-               " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
-#define DBG3(fmt, args...) __lttng_print(PRINT_DBG3, "DEBUG3: " fmt \
-               " [in %s() at " __FILE__ ":" XSTR(__LINE__) "]\n", ## args, __func__)
-
-#define _PERROR(fmt, args...) \
-       __lttng_print(PRINT_ERR, "perror " fmt "\n", ## args)
-
-#define PERROR(call, args...) \
-    do { \
-               char *buf; \
-               char tmp[200]; \
-               buf = strerror_r(errno, tmp, sizeof(tmp)); \
-               _PERROR(call ": %s", ## args, buf); \
-       } while(0);
-
-#endif /* _LTTNGERR_H */
index cc503412689f55f48524ef515d608a9f1a4cdf4b..497a96ad8028996e14939c0f2f1d0676db2bea75 100644 (file)
@@ -30,7 +30,7 @@
 #include <sched.h>
 #include <sys/mman.h>
 
-#include <common/lttngerr.h>
+#include <common/error.h>
 
 #include "runas.h"
 
index 838afedba2a712297f73687b44e446a17fec4537..9fbc7358c0e4b583b231603e08a7b8a1ee3aa3e2 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/lttngerr.h>
 #include <common/common.h>
 #include <common/defaults.h>
+#include <common/sessiond-comm/sessiond-comm.h>
 #include <lttng/lttng.h>
 
 /* Socket to session daemon for communication */
This page took 0.053983 seconds and 4 git commands to generate.