[Devel] [PATCH 3/8] cr_tests: eventfd: use labels.[ch|lds] from libcrtest
Matt Helsley
matthltc at us.ibm.com
Tue Mar 9 14:48:15 PST 2010
Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
---
eventfd/libeptest.h | 46 +---------------------------------------------
1 files changed, 1 insertions(+), 45 deletions(-)
diff --git a/eventfd/libeptest.h b/eventfd/libeptest.h
index b6629e8..3f1522e 100644
--- a/eventfd/libeptest.h
+++ b/eventfd/libeptest.h
@@ -6,6 +6,7 @@
#include <sys/epoll.h>
#include "libcrtest/libcrtest.h"
+#include "libcrtest/labels.h"
extern FILE *logfp;
@@ -26,48 +27,3 @@ do { \
/* like perror() except to the log */
#define log_error(s) log("FAIL", "%s: %s\n", (s), strerror(errno))
-
-/*
- * A LABEL is a point in the program we can goto where it's interesting to
- * checkpoint. These enable us to have a set of labels that can be specified
- * on the commandline.
- */
-extern const char __attribute__((__section__(".LABELs"))) *first_label;
-extern const char __attribute__((__section__(".LABELs"))) *last_label;
-
-#define num_labels ((&last_label - &first_label) - 1)
-
-static inline const char * labels(int i)
-{
- return (&first_label)[num_labels - i];
-}
-
-/* Print the labels that this program has to pout */
-void print_labels(FILE *pout);
-
-/* Signal ready for and await the checkpoint */
-void do_ckpt(void);
-
-/* The spot (LABEL or label number) where we should test checkpoint/restart */
-extern char const *ckpt_label;
-extern int ckpt_op_num;
-
-#define stringify(expr) #expr
-
-/* Label a spot in the code... */
-#define label(lbl, ret, action) \
-do { \
- static char __attribute__((__section__(".LABELs"))) *___ ##lbl## _l = stringify(lbl); \
- goto lbl ; \
-lbl: \
-\
- log("INFO", "label: %s: \"%s\"\n", \
- labels(op_num), stringify(action)); \
-\
- ret = action ; \
-\
- if ((ckpt_op_num == op_num) || (ckpt_op_num == -1) || \
- (strcmp(ckpt_label, ___ ##lbl## _l) == 0)) \
- do_ckpt(); \
- op_num++; \
-} while(0)
--
1.6.3.3
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list