Просмотр исходного кода

Move logsys.c into corosync binary instead of a shared object

Our preferred shared logging system is exported via the libqb library.  As
a result, the corosync project no longer needs to export logsys.so and the
code can be directly included in the binary.  The header file can also be
removed.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Steven Dake 14 лет назад
Родитель
Сommit
8ad583a54c

+ 2 - 3
TODO

@@ -11,9 +11,8 @@
 --------------------------------------
 1. quorum debugging and rework
 2. remove external plug-in api
-3. remove logsys.h from external headers
-4. allow a cluster name to autogenerate a mcastaddr
-5. ring status change via corosync-notifyd
+3. allow a cluster name to autogenerate a mcastaddr
+4. ring status change via corosync-notifyd
 
 --------------------------------------
  Current priority list for Needle 2.1

+ 0 - 3
corosync.spec.in

@@ -244,7 +244,6 @@ This package contains corosync libraries.
 %{_libdir}/libcmap.so.*
 %{_libdir}/libevs.so.*
 %{_libdir}/libtotem_pg.so.*
-%{_libdir}/liblogsys.so.*
 %{_libdir}/libicmap.so.*
 %{_libdir}/libquorum.so.*
 %{_libdir}/libvotequorum.so.*
@@ -296,7 +295,6 @@ The Corosync Cluster Engine APIs.
 %dir %{_includedir}/corosync/engine
 %{_includedir}/corosync/engine/config.h
 %{_includedir}/corosync/engine/coroapi.h
-%{_includedir}/corosync/engine/logsys.h
 %{_includedir}/corosync/engine/icmap.h
 %{_includedir}/corosync/engine/quorum.h
 %{_libdir}/libcfg.so
@@ -304,7 +302,6 @@ The Corosync Cluster Engine APIs.
 %{_libdir}/libcmap.so
 %{_libdir}/libevs.so
 %{_libdir}/libtotem_pg.so
-%{_libdir}/liblogsys.so
 %{_libdir}/libquorum.so
 %{_libdir}/libvotequorum.so
 %{_libdir}/libpload.so

+ 1 - 1
cts/agents/syncv2.c

@@ -59,7 +59,7 @@
 #include <corosync/mar_gen.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/list.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 LOGSYS_DECLARE_SUBSYS ("TST2");
 

+ 5 - 24
exec/Makefile.am

@@ -42,24 +42,22 @@ if BUILD_RDMA
 TOTEM_SRC		+= totemiba.c
 endif
 
-LOGSYS_SRC		= logsys.c
 ICMAP_SRC		= icmap.c
 LCRSO_SRC		= vsf_ykd.c coroparse.c vsf_quorum.c
 LCRSO_OBJS		= $(LCRSO_SRC:%.c=%.o)
 LCRSO			= $(LCRSO_SRC:%.c=%.lcrso)
 
-lib_LIBRARIES		= libtotem_pg.a liblogsys.a libicmap.a
+lib_LIBRARIES		= libtotem_pg.a libicmap.a
 sbin_PROGRAMS		= corosync
 
 libtotem_pg_a_SOURCES	= $(TOTEM_SRC)
-liblogsys_a_SOURCES	= $(LOGSYS_SRC)
 libicmap_a_SOURCES	= $(ICMAP_SRC)
 
 corosync_SOURCES 	= main.c ipc_glue.c util.c sync.c apidef.c service.c \
 			  timer.c totemconfig.c mainconfig.c quorum.c schedwrk.c \
-			  ../lcr/lcr_ifact.c evil.c syncv2.c
-corosync_LDADD	  	= -ltotem_pg -llogsys -licmap $(LIBQB_LIBS) $(statgrab_LIBS)
-corosync_DEPENDENCIES	= libtotem_pg.so.$(SONAME) liblogsys.so.$(SONAME) libicmap.so.$(SONAME)
+			  ../lcr/lcr_ifact.c evil.c syncv2.c logsys.c
+corosync_LDADD	  	= -ltotem_pg -licmap $(LIBQB_LIBS) $(statgrab_LIBS)
+corosync_DEPENDENCIES	= libtotem_pg.so.$(SONAME) libicmap.so.$(SONAME)
 corosync_LDFLAGS	= $(OS_DYFLAGS) -L./
 
 TOTEM_OBJS		= $(TOTEM_SRC:%.c=%.o)
@@ -80,18 +78,13 @@ EXTRA_DIST		= $(LCRSO_SRC)
 
 if BUILD_DARWIN
 %.lcrso: %.o
-	$(CC) $(LDFLAGS) $(CFLAGS) -L$(top_builddir)/exec -llogsys -licmap -bundle -bind_at_load -bundle_loader ./corosync $^ -o $@
+	$(CC) $(LDFLAGS) $(CFLAGS) -L$(top_builddir)/exec -licmap -bundle -bind_at_load -bundle_loader ./corosync $^ -o $@
 
 libtotem_pg.so.$(SONAME): $(TOTEM_OBJS)
 	$(CC) $(LDFLAGS) $(DARWIN_OPTS) $(TOTEM_OBJS) -o $@ -lpthread
 	ln -sf libtotem_pg.so.$(SONAME) libtotem_pg.so
 	ln -sf libtotem_pg.so.$(SONAME) libtotem_pg.so.$(SOMAJOR)
 
-liblogsys.so.$(SONAME): $(LOGSYS_OBJS)
-	$(CC) $(LDFLAGS) $(DARWIN_OPTS) $(LOGSYS_OBJS) -o $@ -lpthread
-	ln -sf liblogsys.so.$(SONAME) liblogsys.so
-	ln -sf liblogsys.so.$(SONAME) liblogsys.so.$(SOMAJOR)
-
 libicmap.so.$(SONAME): $(ICMAP_OBJS)
 	$(CC) $(LDFLAGS) $(DARWIN_OPTS) $(ICMAP_OBJS) -o $@ -lpthread
 	ln -sf libicmap.so.$(SONAME) libicmap.so
@@ -108,11 +101,6 @@ libtotem_pg.so.$(SONAME): $(TOTEM_OBJS)
 	ln -sf libtotem_pg.so.$(SONAME) libtotem_pg.so
 	ln -sf libtotem_pg.so.$(SONAME) libtotem_pg.so.$(SOMAJOR)
 
-liblogsys.so.$(SONAME): $(LOGSYS_OBJS)
-	$(LD) $(LDFLAGS) -G $(LOGSYS_OBJS) -o $@ -lpthread
-	ln -sf liblogsys.so.$(SONAME) liblogsys.so
-	ln -sf liblogsys.so.$(SONAME) liblogsys.so.$(SOMAJOR)
-
 else
 
 %.lcrso: %.o
@@ -125,13 +113,6 @@ libtotem_pg.so.$(SONAME): $(TOTEM_OBJS)
 	ln -sf libtotem_pg.so.$(SONAME) libtotem_pg.so
 	ln -sf libtotem_pg.so.$(SONAME) libtotem_pg.so.$(SOMAJOR)
 
-liblogsys.so.$(SONAME): $(LOGSYS_OBJS)
-	$(CC) -shared -o $@ \
-		-Wl,-soname=liblogsys.so.$(SOMAJOR) \
-		$(LDFLAGS) $^ -lpthread
-	ln -sf liblogsys.so.$(SONAME) liblogsys.so
-	ln -sf liblogsys.so.$(SONAME) liblogsys.so.$(SOMAJOR)
-
 libicmap.so.$(SONAME): $(ICMAP_OBJS)
 	$(CC) -shared -o $@ \
 		-Wl,-soname=libicmap.so.$(SOMAJOR) \

+ 1 - 1
exec/apidef.c

@@ -46,7 +46,7 @@
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totemip.h>
 #include <corosync/totem/totem.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include "util.h"
 #include "timer.h"
 #include "sync.h"

+ 1 - 1
exec/coroparse.c

@@ -58,7 +58,7 @@
 #include <corosync/lcr/lcr_comp.h>
 #include <qb/qbutil.h>
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 #include <corosync/engine/config.h>
 

+ 2 - 2
exec/evil.c

@@ -70,9 +70,9 @@
 #include <corosync/corodefs.h>
 #include <corosync/list.h>
 #include <corosync/lcr/lcr_ifact.h>
-#include <corosync/engine/config.h>
+#include <corosync/config.h>
 #include <corosync/engine/coroapi.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <qb/qbipcs.h>
 #include "sync.h"
 #include "evil.h"

+ 1 - 1
exec/ipc_glue.c

@@ -51,7 +51,7 @@
 #include <corosync/corotypes.h>
 #include <corosync/corodefs.h>
 #include <corosync/totem/totempg.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 
 #include "mainconfig.h"

+ 1 - 1
exec/logsys.c

@@ -48,7 +48,7 @@
 #include <qb/qblog.h>
 
 #include <corosync/list.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 /*
  * syslog prioritynames, facility names to value mapping

+ 1 - 1
exec/main.c

@@ -108,7 +108,7 @@
 #include <corosync/lcr/lcr_ifact.h>
 #include <corosync/totem/totempg.h>
 #include <corosync/engine/config.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 
 #include "quorum.h"

+ 1 - 1
exec/mainconfig.c

@@ -49,7 +49,7 @@
 #include <corosync/corotypes.h>
 #include <corosync/list.h>
 #include <corosync/totem/totem.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 
 #include "util.h"

+ 1 - 1
exec/mainconfig.h

@@ -35,7 +35,7 @@
 #ifndef MAINCONFIG_H_DEFINED
 #define MAINCONFIG_H_DEFINED
 
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/list.h>
 #include <corosync/engine/coroapi.h>
 

+ 1 - 1
exec/quorum.c

@@ -55,7 +55,7 @@
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totem.h>
 #include <corosync/lcr/lcr_ifact.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 #include "quorum.h"
 #include "main.h"

+ 1 - 1
exec/service.c

@@ -45,7 +45,7 @@
 #include <corosync/corotypes.h>
 #include "mainconfig.h"
 #include "util.h"
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 
 #include "timer.h"

+ 1 - 1
exec/sync.c

@@ -55,7 +55,7 @@
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totem.h>
 #include <corosync/lcr/lcr_ifact.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <qb/qbipc_common.h>
 #include "quorum.h"
 #include "sync.h"

+ 1 - 1
exec/syncv2.c

@@ -54,7 +54,7 @@
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totem.h>
 #include <corosync/lcr/lcr_ifact.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <qb/qbipc_common.h>
 #include "schedwrk.h"
 #include "quorum.h"

+ 2 - 2
exec/totemconfig.c

@@ -53,8 +53,8 @@
 #include <corosync/list.h>
 #include <qb/qbdefs.h>
 #include <corosync/totem/totem.h>
-#include <corosync/engine/config.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/config.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 
 #ifdef HAVE_LIBNSS

+ 1 - 1
exec/totemiba.c

@@ -74,7 +74,7 @@
 #include <qb/qbdefs.h>
 #include <qb/qbloop.h>
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include "totemiba.h"
 #include "wthread.h"
 

+ 1 - 1
exec/totemnet.c

@@ -46,7 +46,7 @@
 #include <qb/qbloop.h>
 
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 struct transport {
 	const char *name;

+ 1 - 1
exec/totempg.c

@@ -103,7 +103,7 @@
 #include <qb/qbipcs.h>
 #include <corosync/totem/totempg.h>
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 #include "totemmrp.h"
 #include "totemsrp.h"

+ 1 - 1
exec/totemrrp.c

@@ -64,7 +64,7 @@
 #include <qb/qbdefs.h>
 #include <qb/qbloop.h>
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 #include "totemnet.h"
 #include "totemrrp.h"

+ 1 - 1
exec/totemsrp.c

@@ -83,7 +83,7 @@
 #include <corosync/list.h>
 
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 #include "totemsrp.h"
 #include "totemrrp.h"

+ 1 - 1
exec/totemudp.c

@@ -64,7 +64,7 @@
 #include <qb/qbdefs.h>
 #include <qb/qbloop.h>
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include "totemudp.h"
 
 #include "crypto.h"

+ 1 - 1
exec/totemudpu.c

@@ -64,7 +64,7 @@
 #include <corosync/list.h>
 #include <corosync/swab.h>
 #define LOGSYS_UTILS_ONLY 1
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include "totemudpu.h"
 
 #include "crypto.h"

+ 1 - 1
exec/util.c

@@ -46,7 +46,7 @@
 #include <corosync/corotypes.h>
 #include <corosync/corodefs.h>
 #include <corosync/list.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include "util.h"
 
 LOGSYS_DECLARE_SUBSYS ("MAIN");

+ 1 - 1
exec/vsf_quorum.c

@@ -65,7 +65,7 @@
 #include <corosync/lcr/lcr_ifact.h>
 #include <corosync/mar_gen.h>
 #include <corosync/engine/coroapi.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/quorum.h>
 #include <corosync/engine/icmap.h>
 

+ 1 - 1
exec/vsf_ykd.c

@@ -56,7 +56,7 @@
 #include <sched.h>
 #include <time.h>
 
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/corotypes.h>
 #include <qb/qbipc_common.h>
 #include <corosync/mar_gen.h>

+ 2 - 2
include/Makefile.am

@@ -36,11 +36,11 @@ CS_H			= hdb.h cs_config.h cpg.h cfg.h evs.h mar_gen.h swab.h 	\
 			list.h corotypes.h quorum.h votequorum.h sam.h cmap.h
 
 CS_INTERNAL_H		= ipc_cfg.h ipc_cpg.h ipc_evs.h ipc_pload.h ipc_quorum.h 	\
-			jhash.h pload.h quorum.h sq.h ipc_votequorum.h ipc_cmap.h
+			jhash.h pload.h quorum.h sq.h ipc_votequorum.h ipc_cmap.h logsys.h
 
 LCR_H			= lcr_ckpt.h lcr_comp.h	lcr_ifact.h
 
-ENGINE_H		= config.h coroapi.h logsys.h quorum.h icmap.h
+ENGINE_H		= config.h coroapi.h quorum.h icmap.h
 
 TOTEM_H			= totem.h totemip.h totempg.h
 

+ 0 - 0
include/corosync/engine/logsys.h → include/corosync/logsys.h


+ 1 - 1
services/cfg.c

@@ -59,7 +59,7 @@
 #include <corosync/totem/totem.h>
 #include <corosync/ipc_cfg.h>
 #include <corosync/lcr/lcr_comp.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/engine/icmap.h>
 #include <corosync/corodefs.h>

+ 1 - 1
services/cmap.c

@@ -52,7 +52,7 @@
 #include <corosync/mar_gen.h>
 #include <corosync/ipc_cmap.h>
 #include <corosync/lcr/lcr_comp.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/engine/icmap.h>
 

+ 1 - 1
services/cpg.c

@@ -63,7 +63,7 @@
 #include <corosync/list.h>
 #include <corosync/jhash.h>
 #include <corosync/lcr/lcr_comp.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/coroapi.h>
 
 #include <corosync/cpg.h>

+ 1 - 1
services/evs.c

@@ -58,7 +58,7 @@
 #include <corosync/mar_gen.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/coroapi.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/list.h>
 
 #include <corosync/evs.h>

+ 1 - 1
services/mon.c

@@ -44,7 +44,7 @@
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/list.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 #include "../exec/fsm.h"
 

+ 1 - 1
services/pload.c

@@ -64,7 +64,7 @@
 #include <corosync/engine/coroapi.h>
 #include <corosync/ipc_pload.h>
 #include <corosync/list.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 
 LOGSYS_DECLARE_SUBSYS ("PLOAD");
 

+ 1 - 1
services/testquorum.c

@@ -57,7 +57,7 @@
 #include <corosync/corotypes.h>
 #include <qb/qbipc_common.h>
 #include <corosync/corodefs.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 
 #include <corosync/mar_gen.h>

+ 1 - 1
services/votequorum.c

@@ -64,7 +64,7 @@
 #include <corosync/cfg.h>
 #include <corosync/list.h>
 #include <corosync/lcr/lcr_comp.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/mar_gen.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/engine/quorum.h>

+ 1 - 1
services/wd.c

@@ -46,7 +46,7 @@
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/engine/coroapi.h>
 #include <corosync/list.h>
-#include <corosync/engine/logsys.h>
+#include <corosync/logsys.h>
 #include <corosync/engine/icmap.h>
 #include "../exec/fsm.h"
 

+ 1 - 9
test/Makefile.am

@@ -36,8 +36,7 @@ INCLUDES       		= -I$(top_builddir)/include/corosync -I$(top_srcdir)/include
 noinst_PROGRAMS		= testevs evsbench evsverify cpgverify testcpg testcpg2 cpgbench \
 			testquorum testvotequorum1 testvotequorum2	\
 			stress_cpgfdget stress_cpgcontext cpgbound testsam \
-			testcpgzc cpgbenchzc testzcgc stress_cpgzc \
-			logsys_s logsys_t1 logsys_t2
+			testcpgzc cpgbenchzc testzcgc stress_cpgzc
 
 testevs_LDADD		= -levs $(LIBQB_LIBS)
 testevs_LDFLAGS		= -L../lib
@@ -73,13 +72,6 @@ cpgbench_LDADD		= -lcpg $(LIBQB_LIBS)
 cpgbench_LDFLAGS	= -L../lib
 cpgbenchzc_LDADD	= -lcpg $(LIBQB_LIBS)
 cpgbenchzc_LDFLAGS	= -L../lib
-logsys_s_SOURCES	= logsys_s.c logsys_s1.c logsys_s2.c
-logsys_s_LDADD		= -llogsys  $(LIBQB_LIBS)
-logsys_s_LDFLAGS	= -L../exec
-logsys_t1_LDADD		= -llogsys  $(LIBQB_LIBS)
-logsys_t1_LDFLAGS	= -L../exec
-logsys_t2_LDADD		= -llogsys  $(LIBQB_LIBS)
-logsys_t2_LDFLAGS	= -L../exec
 testsam_LDADD		= -lsam -lcmap -lquorum $(LIBQB_LIBS)
 testsam_LDFLAGS		= -L../lib
 

+ 0 - 57
test/logsys_s.c

@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2007 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <syslog.h>
-#include <assert.h>
-
-#include <corosync/engine/logsys.h>
-
-LOGSYS_DECLARE_SYSTEM ("logsystestsubsystems",
-	LOGSYS_MODE_OUTPUT_STDERR | LOGSYS_MODE_OUTPUT_SYSLOG,
-	LOG_DAEMON,
-	LOGSYS_LEVEL_INFO);
-LOGSYS_DECLARE_SUBSYS ("MAIN");
-
-extern void logsys_s1_print (void);
-extern void logsys_s2_print (void);
-
-int main (void) {
-	qb_log_thread_start();
-	logsys_s1_print();
-	logsys_s2_print();
-	return (0);
-}

+ 0 - 50
test/logsys_s1.c

@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2007 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <syslog.h>
-#include <assert.h>
-
-#include <corosync/engine/logsys.h>
-
-void logsys_s1_print (void);
-
-LOGSYS_DECLARE_SUBSYS ("SYS1");
-
-void logsys_s1_print (void) {
-	log_printf (LOGSYS_LEVEL_ALERT, "This is an alert log message\n");
-	log_printf (LOGSYS_LEVEL_WARNING, "This is a warning log message\n");
-}

+ 0 - 52
test/logsys_s2.c

@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2007 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <syslog.h>
-#include <assert.h>
-
-#include <corosync/engine/logsys.h>
-
-void logsys_s2_print (void);
-
-LOGSYS_DECLARE_SUBSYS ("SYS2");
-
-void logsys_s2_print (void) {
-	logsys_config_logfile_priority_set("SYS2", LOGSYS_LEVEL_DEBUG);
-	log_printf (LOGSYS_LEVEL_ALERT, "This is an alert log message\n");
-	log_printf (LOGSYS_LEVEL_WARNING, "This is a warning log message\n");
-	log_printf (LOGSYS_LEVEL_DEBUG, "This is a debug log message\n");
-}

+ 0 - 54
test/logsys_t1.c

@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <syslog.h>
-#include <assert.h>
-
-#include <corosync/engine/logsys.h>
-
-LOGSYS_DECLARE_SYSTEM ("logsystestNOsubsystems",
-	LOGSYS_MODE_OUTPUT_STDERR | LOGSYS_MODE_OUTPUT_SYSLOG,
-	LOG_DAEMON,
-	LOGSYS_LEVEL_DEBUG);
-LOGSYS_DECLARE_SUBSYS("MAIN");
-
-int main (void) {
-	log_printf (LOGSYS_LEVEL_ALERT, "This is an alert log message\n");
-	log_printf (LOGSYS_LEVEL_WARNING, "This is a warning log message\n");
-	log_printf (LOGSYS_LEVEL_DEBUG, "This is a debug log message\n");
-	return (0);
-}

+ 0 - 85
test/logsys_t2.c

@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2007 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Lon Hohberger (lhh@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdint.h>
-#include <assert.h>
-
-#include <corosync/engine/logsys.h>
-
-LOGSYS_DECLARE_SYSTEM ("logtest_t2",
-	LOGSYS_MODE_OUTPUT_STDERR | LOGSYS_MODE_THREADED,
-	LOG_DAEMON,
-	LOGSYS_LEVEL_INFO);
-
-LOGSYS_DECLARE_SUBSYS("MAIN");
-
-int
-main(int argc, char **argv)
-{
-	/*
-	 * fork could occur here and the file to output to could be set
-	 */
-	logsys_config_mode_set (NULL, LOGSYS_MODE_OUTPUT_STDERR | LOGSYS_MODE_THREADED);
-
-
-	log_printf(LOGSYS_LEVEL_NOTICE, "Hello, world!\n");
-	log_printf(LOGSYS_LEVEL_DEBUG, "If you see this, the logger's busted\n");
-
-	logsys_config_logfile_priority_set (NULL, LOGSYS_LEVEL_ALERT);
-	logsys_config_apply();
-
-	log_printf(LOGSYS_LEVEL_DEBUG, "If you see this, the logger's busted\n");
-	log_printf(LOGSYS_LEVEL_CRIT, "If you see this, the logger's busted\n");
-	log_printf(LOGSYS_LEVEL_ALERT, "Alert 1\n");
-
-	logsys_config_logfile_priority_set (NULL, LOGSYS_LEVEL_NOTICE);
-	logsys_config_apply();
-
-	log_printf(LOGSYS_LEVEL_CRIT, "Crit 1\n");
-	log_printf(LOGSYS_LEVEL_INFO, "If you see this, the logger's busted\n");
-
-	logsys_config_logfile_priority_set (NULL, LOGSYS_LEVEL_DEBUG);
-	logsys_config_apply();
-
-	log_printf(LOGSYS_LEVEL_DEBUG, "Debug 1\n");
-
-	logsys_config_mode_set (NULL, LOGSYS_MODE_OUTPUT_STDERR);
-
-	log_printf(LOGSYS_LEVEL_DEBUG, "Debug 2\n");
-
-	return 0;
-}

+ 0 - 66
test/logsysrec.c

@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2008 Red Hat, Inc.
- *
- * All rights reserved.
- *
- * Author: Steven Dake (sdake@redhat.com)
- *
- * This software licensed under BSD license, the text of which follows:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice,
- *   this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * - Neither the name of the MontaVista Software, Inc. nor the names of its
- *   contributors may be used to endorse or promote products derived from this
- *   software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <stdint.h>
-#include <corosync/engine/logsys.h>
-
-LOGSYS_DECLARE_SYSTEM ("logtest_rec",
-	LOGSYS_MODE_OUTPUT_STDERR | LOGSYS_MODE_THREADED,
-	LOG_DAEMON,
-	LOG_INFO);
-
-#define LOGREC_ID_CHECKPOINT_CREATE 2
-#define LOGREC_ARGS_CHECKPOINT_CREATE 2
-
-int main(int argc, char **argv)
-{
-	int i;
-
-	for (i = 0; i < 10000; i++) {
-		log_printf (LOGSYS_LEVEL_NOTICE,
-			"This is a test of %s(%d)\n", "stringparse", i);
-
-		log_rec (LOGSYS_ENCODE_RECID(LOGSYS_LEVEL_NOTICE,
-					     logsys_subsys_id,
-					     LOGREC_ID_CHECKPOINT_CREATE),
-			"record1", 8, "record22", 9, "record333", 10, "record444", 11, LOGSYS_REC_END);
-	}
-	logsys_atexit ();
-	logsys_log_rec_store ("fdata");
-
-	return 0;
-}