Find attached a patch which implements some of the pload service. This
will be used to find hotspots in the code during profiling analysis
using profiling tools such as oprofile.
It essentially spams totem with as many messages can fill it's queue and
counts the messages/second and mb/sec throughput.
To run it, simply compile corosync, copy the services/*lcrso to the exec
directory, then in the test directory type ./ploadrun.
This should cause corosync to print something like:
Oct 21 11:07:34.303877 [TOTEM] entering OPERATIONAL state.
1500000 Writes 300 bytes per write 5.013 Seconds runtime 299249.542
TP/s 89.775 MB/s.
Regards
-steve
Index: test/Makefile
===================================================================
--- test/Makefile (revision 1676)
+++ test/Makefile (working copy)
@@ -42,9 +42,8 @@
override LDFLAGS += -lnsl -lsocket -lrt
endif
-LIBRARIES= ../lib/libevs.a ../lib/libcpg.a ../lib/libcfg.a ../lib/libconfdb.a ../lib/libquorum.a
-LIBS = $(LIBRARIES)
-BINARIES= testevs evsbench evsverify testcpg testcpg2 cpgbench testconfdb testquorum
+LIBS= ../lib/libevs.a ../lib/libcpg.a ../lib/libcfg.a ../lib/libconfdb.a ../lib/libquorum.a ../lib/libpload.a
+BINARIES= testevs evsbench evsbenchthd evsverify testcpg testcpg2 cpgbench testconfdb testquorum ploadrun
override CFLAGS += -I../include
override LDFLAGS += -L../lib
@@ -66,6 +65,9 @@
evsbench: evsbench.o $(LIBS)
$(CC) $(LDFLAGS) -o evsbench evsbench.o $(LIBS)
+evsbenchthd: evsbenchthd.o $(LIBS)
+ $(CC) $(LDFLAGS) -o evsbenchthd evsbenchthd.o $(LIBS)
+
evsverify: evsverify.o $(LIBS) ../exec/crypto.o
$(CC) $(LDFLAGS) -o evsverify evsverify.o $(LIBS) ../exec/crypto.o
@@ -84,6 +86,9 @@
testconfdb: testconfdb.o $(LIBRARIES)
$(CC) $(LDFLAGS) -o testconfdb testconfdb.o $(LIBS) -rdynamic
+ploadrun: ploadrun.o $(LIBRARIES)
+ $(CC) $(LDFLAGS) -o ploadrun ploadrun.o $(LIBS) -rdynamic
+
logsys_s: logsys_s.o logsys_s1.o logsys_s2.o ../exec/liblogsys.a
$(CC) -o logsys_s logsys_s.o logsys_s1.o logsys_s2.o ../exec/liblogsys.a $(LDFLAGS)
Index: services/pload.c
===================================================================
--- services/pload.c (revision 0)
+++ services/pload.c (revision 0)
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 2008 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake ([EMAIL PROTECTED])
+ *
+ * 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 <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <signal.h>
+#include <time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <corosync/swab.h>
+#include <corosync/saAis.h>
+#include <corosync/ipc_gen.h>
+#include <corosync/lcr/lcr_comp.h>
+#include <corosync/engine/coroapi.h>
+#include <corosync/ipc_pload.h>
+#include <corosync/list.h>
+#include <corosync/engine/logsys.h>
+
+LOGSYS_DECLARE_SUBSYS ("PLOAD", LOG_INFO);
+
+enum pload_exec_message_req_types {
+ MESSAGE_REQ_EXEC_PLOAD_START = 0,
+ MESSAGE_REQ_EXEC_PLOAD_MCAST = 1
+};
+
+/*
+ * Service Interfaces required by service_message_handler struct
+ */
+static int pload_exec_init_fn (
+ struct corosync_api_v1 *corosync_api);
+
+static void pload_confchg_fn (
+ enum totem_configuration_type configuration_type,
+ unsigned int *member_list, int member_list_entries,
+ unsigned int *left_list, int left_list_entries,
+ unsigned int *joined_list, int joined_list_entries,
+ struct memb_ring_id *ring_id);
+
+static void message_handler_req_exec_pload_start (void *msg, unsigned int nodeid);
+
+static void message_handler_req_exec_pload_mcast (void *msg, unsigned int nodeid);
+
+static void req_exec_pload_start_endian_convert (void *msg);
+
+static void req_exec_pload_mcast_endian_convert (void *msg);
+
+static void message_handler_req_pload_start (void *conn, void *msg);
+
+static int pload_lib_init_fn (void *conn);
+
+static int pload_lib_exit_fn (void *conn);
+
+static char buffer[1000000];
+
+static unsigned int msgs_delivered = 0;
+
+static unsigned int msgs_wanted = 0;
+
+static unsigned int msg_size = 0;
+
+static unsigned int msg_code = 0;
+
+static unsigned int msgs_sent = 0;
+
+
+static struct corosync_api_v1 *api;
+
+static struct corosync_lib_handler pload_lib_engine[] =
+{
+ { /* 0 */
+ .lib_handler_fn = message_handler_req_pload_start,
+ .response_size = sizeof (struct res_lib_pload_start),
+ .response_id = MESSAGE_RES_PLOAD_START,
+ .flow_control = COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
+ }
+};
+
+static struct corosync_exec_handler pload_exec_engine[] =
+{
+ {
+ .exec_handler_fn = message_handler_req_exec_pload_start,
+ .exec_endian_convert_fn = req_exec_pload_start_endian_convert
+ },
+ {
+ .exec_handler_fn = message_handler_req_exec_pload_mcast,
+ .exec_endian_convert_fn = req_exec_pload_mcast_endian_convert
+ }
+};
+
+struct corosync_service_engine pload_service_engine = {
+ .name = "corosync profile loading service",
+ .id = PLOAD_SERVICE,
+ .private_data_size = 0,
+ .flow_control = COROSYNC_LIB_FLOW_CONTROL_REQUIRED,
+ .lib_init_fn = pload_lib_init_fn,
+ .lib_exit_fn = pload_lib_exit_fn,
+ .lib_engine = pload_lib_engine,
+ .lib_engine_count = sizeof (pload_lib_engine) / sizeof (struct corosync_lib_handler),
+ .exec_engine = pload_exec_engine,
+ .exec_engine_count = sizeof (pload_exec_engine) / sizeof (struct corosync_exec_handler),
+ .confchg_fn = pload_confchg_fn,
+ .exec_init_fn = pload_exec_init_fn,
+ .exec_dump_fn = NULL
+};
+
+static DECLARE_LIST_INIT (confchg_notify);
+
+/*
+ * Dynamic loading descriptor
+ */
+
+static struct corosync_service_engine *pload_get_service_engine_ver0 (void);
+
+static struct corosync_service_engine_iface_ver0 pload_service_engine_iface = {
+ .corosync_get_service_engine_ver0 = pload_get_service_engine_ver0
+};
+
+static struct lcr_iface corosync_pload_ver0[1] = {
+ {
+ .name = "corosync_pload",
+ .version = 0,
+ .versions_replace = 0,
+ .versions_replace_count = 0,
+ .dependencies = 0,
+ .dependency_count = 0,
+ .constructor = NULL,
+ .destructor = NULL,
+ .interfaces = NULL,
+ }
+};
+
+static struct lcr_comp pload_comp_ver0 = {
+ .iface_count = 1,
+ .ifaces = corosync_pload_ver0
+};
+
+static struct corosync_service_engine *pload_get_service_engine_ver0 (void)
+{
+ return (&pload_service_engine);
+}
+
+__attribute__ ((constructor)) static void pload_comp_register (void) {
+ lcr_interfaces_set (&corosync_pload_ver0[0], &pload_service_engine_iface);
+
+ lcr_component_register (&pload_comp_ver0);
+}
+
+static int pload_exec_init_fn (
+ struct corosync_api_v1 *corosync_api)
+{
+ api = corosync_api;
+
+ return 0;
+}
+
+static void pload_confchg_fn (
+ enum totem_configuration_type configuration_type,
+ unsigned int *member_list, int member_list_entries,
+ unsigned int *left_list, int left_list_entries,
+ unsigned int *joined_list, int joined_list_entries,
+ struct memb_ring_id *ring_id)
+{
+}
+
+static int pload_lib_init_fn (void *conn)
+{
+ return (0);
+}
+
+static int pload_lib_exit_fn (void *conn)
+{
+ return (0);
+}
+
+static void message_handler_req_pload_start (void *conn, void *msg)
+{
+ struct req_lib_pload_start *req_lib_pload_start = (struct req_lib_pload_start *)msg;
+ struct req_exec_pload_start req_exec_pload_start;
+ struct iovec iov;
+
+ req_exec_pload_start.header.id =
+ SERVICE_ID_MAKE (PLOAD_SERVICE, MESSAGE_REQ_EXEC_PLOAD_START);
+ req_exec_pload_start.msg_code = req_lib_pload_start->msg_code;
+ req_exec_pload_start.msg_size = req_lib_pload_start->msg_size;
+ req_exec_pload_start.msg_count = req_lib_pload_start->msg_count;
+ req_exec_pload_start.time_interval = req_lib_pload_start->time_interval;
+ iov.iov_base = &req_exec_pload_start;
+ iov.iov_len = sizeof (struct req_exec_pload_start);
+
+ api->totem_mcast (&iov, 1, TOTEM_AGREED);
+}
+
+static void req_exec_pload_start_endian_convert (void *msg)
+{
+}
+
+static void req_exec_pload_mcast_endian_convert (void *msg)
+{
+}
+
+int send_message (enum totem_callback_token_type type, void *arg)
+{
+ struct req_exec_pload_mcast req_exec_pload_mcast;
+ struct iovec iov[2];
+ unsigned int res;
+
+ req_exec_pload_mcast.header.id =
+ SERVICE_ID_MAKE (PLOAD_SERVICE, MESSAGE_REQ_EXEC_PLOAD_MCAST);
+ req_exec_pload_mcast.header.size = sizeof (struct req_exec_pload_mcast) + msg_size;
+ req_exec_pload_mcast.msg_code = msg_code;
+ iov[0].iov_base = &req_exec_pload_mcast;
+ iov[0].iov_len = sizeof (struct req_exec_pload_mcast);
+ iov[1].iov_base = buffer;
+ iov[1].iov_len = msg_size;
+
+ do {
+ res = api->totem_mcast (iov, 2, TOTEM_AGREED);
+ if (res == -1) {
+ break;
+ } else {
+ msgs_sent++;
+ }
+ } while (msgs_sent <= msgs_wanted);
+ if (msgs_sent == msgs_wanted) {
+ return (0);
+ } else {
+ return (-1);
+ }
+}
+
+void *token_callback;
+void start_mcasting (void)
+{
+ api->totem_callback_token_create (
+ &token_callback,
+ TOTEM_CALLBACK_TOKEN_RECEIVED,
+ 1,
+ send_message,
+ &token_callback);
+}
+
+static void message_handler_req_exec_pload_start (
+ void *msg,
+ unsigned int nodeid)
+{
+ struct req_exec_pload_start *req_exec_pload_start = (struct req_exec_pload_start *)msg;
+
+ msgs_wanted = req_exec_pload_start->msg_count;
+ msg_size = req_exec_pload_start->msg_size;
+ msg_code = req_exec_pload_start->msg_code;
+
+ start_mcasting ();
+}
+
+# define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
+ } while (0)
+
+struct timeval tv1;
+struct timeval tv2;
+struct timeval tv_elapsed;
+static void message_handler_req_exec_pload_mcast (
+ void *msg,
+ unsigned int nodeid)
+{
+ if (msgs_delivered == 0) {
+ gettimeofday (&tv1, NULL);
+ }
+ msgs_delivered += 1;
+ if (msgs_delivered == msgs_wanted) {
+ gettimeofday (&tv2, NULL);
+ timersub (&tv2, &tv1, &tv_elapsed);
+ printf ("%5d Writes ", msgs_delivered);
+ printf ("%5d bytes per write ", msg_size);
+ printf ("%7.3f Seconds runtime ",
+ (tv_elapsed.tv_sec + (tv_elapsed.tv_usec / 1000000.0)));
+ printf ("%9.3f TP/s ",
+ ((float)msgs_delivered) / (tv_elapsed.tv_sec + (tv_elapsed.tv_usec / 1000000.0)));
+ printf ("%7.3f MB/s.\n",
+ ((float)msgs_delivered) * ((float)msg_size) / ((tv_elapsed.tv_sec + (tv_elapsed.tv_usec / 1000000.0)) * 1000000.0));
+ }
+}
Index: services/Makefile
===================================================================
--- services/Makefile (revision 1676)
+++ services/Makefile (working copy)
@@ -50,12 +50,12 @@
endif
# LCR objects
-LCR_SRC = evs.c cfg.c cpg.c confdb.c
-LCR_OBJS = evs.o cfg.o cpg.o confdb.o $(AMF_OBJS)
+LCR_SRC = evs.c cfg.c cpg.c confdb.c pload.c
+LCR_OBJS = evs.o cfg.o cpg.o confdb.o $(AMF_OBJS) pload.o
override CFLAGS += -fPIC
-all: service_evs.lcrso service_cfg.lcrso service_cpg.lcrso service_confdb.lcrso
+all: service_evs.lcrso service_cfg.lcrso service_cpg.lcrso service_confdb.lcrso service_pload.lcrso
ifeq (${COROSYNC_COMPAT}, DARWIN)
@@ -71,6 +71,9 @@
service_cpg.lcrso: cpg.o
$(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load cpg.o -o $@
+service_pload.lcrso: pload.o
+ $(CC) $(LDFLAGS) -bundle $(LDFLAGS) -bundle_loader ../exec/corosync -bind_at_load pload.o -o $@
+
else
service_evs.lcrso: evs.o
@@ -85,6 +88,9 @@
service_cpg.lcrso: cpg.o
$(CC) -shared -Wl,-soname,service_cpg.lcrso cpg.o -o $@
+service_pload.lcrso: pload.o
+ $(CC) -shared -Wl,-soname,service_pload.lcrso pload.o -o $@
+
endif
clean:
Index: include/corosync/ipc_pload.h
===================================================================
--- include/corosync/ipc_pload.h (revision 0)
+++ include/corosync/ipc_pload.h (revision 0)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2008 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake ([EMAIL PROTECTED])
+ *
+ * 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.
+ */
+#ifndef IPC_PLOAD_H_DEFINED
+#define IPC_PLOAD_H_DEFINED
+
+#include "saAis.h"
+#include "pload.h"
+#include "ipc_gen.h"
+
+enum req_lib_evs_types {
+ MESSAGE_REQ_PLOAD_START = 0,
+};
+
+enum res_lib_evs_types {
+ MESSAGE_RES_PLOAD_START = 0,
+};
+
+struct res_lib_pload_start {
+ mar_res_header_t header;
+ unsigned int dataset[1024];
+};
+
+struct res_lib_pload_mcast {
+ mar_res_header_t header;
+};
+
+struct req_lib_pload_start {
+ mar_req_header_t header;
+ unsigned int msg_code;
+ unsigned int msg_size;
+ unsigned int msg_count;
+ unsigned int time_interval;
+};
+
+struct req_lib_pload_mcast {
+ mar_req_header_t header;
+ unsigned int code;
+};
+
+struct req_exec_pload_start {
+ mar_req_header_t header;
+ unsigned int msg_code;
+ unsigned int msg_count;
+ unsigned int msg_size;
+ unsigned int time_interval;
+};
+
+struct req_exec_pload_mcast {
+ mar_req_header_t header;
+ unsigned int msg_code;
+};
+
+#endif /* IPC_PLOAD_H_DEFINED */
Index: include/corosync/pload.h
===================================================================
--- include/corosync/pload.h (revision 0)
+++ include/corosync/pload.h (revision 0)
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2008 Red Hat, Inc.
+ *
+ * All rights reserved.
+ *
+ * Author: Steven Dake ([EMAIL PROTECTED])
+ *
+ * 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.
+ */
+#ifndef COROSYNC_PLOAD_H_DEFINED
+#define COROSYNC_PLOAD_H_DEFINED
+
+#include <sys/types.h>
+#include <netinet/in.h>
+
+/**
+ * @defgroup corosync Other API services provided by corosync
+ */
+/**
+ * @addtogroup pload_corosync
+ *
+ * @{
+ */
+
+typedef uint64_t pload_handle_t;
+
+typedef enum {
+ PLOAD_OK = 1,
+ PLOAD_ERR_LIBRARY = 2,
+ PLOAD_ERR_TIMEOUT = 5,
+ PLOAD_ERR_TRY_AGAIN = 6,
+ PLOAD_ERR_INVALID_PARAM = 7,
+ PLOAD_ERR_NO_MEMORY = 8,
+ PLOAD_ERR_BAD_HANDLE = 9,
+ PLOAD_ERR_ACCESS = 11,
+ PLOAD_ERR_NOT_EXIST = 12,
+ PLOAD_ERR_EXIST = 14,
+ PLOAD_ERR_NOT_SUPPORTED = 20,
+ PLOAD_ERR_SECURITY = 29,
+ PLOAD_ERR_TOO_MANY_GROUPS=30
+} pload_error_t;
+
+typedef struct {
+ int callback;
+} pload_callbacks_t;
+
+/** @} */
+
+/*
+ * Create a new pload connection
+ */
+pload_error_t pload_initialize (
+ pload_handle_t *handle,
+ pload_callbacks_t *callbacks);
+
+/*
+ * Close the pload handle
+ */
+pload_error_t pload_finalize (
+ pload_handle_t handle);
+
+/*
+ * Get a file descriptor on which to poll. pload_handle_t is NOT a
+ * file descriptor and may not be used directly.
+ */
+pload_error_t pload_fd_get (
+ pload_handle_t handle,
+ int *fd);
+
+unsigned int pload_start (
+ pload_handle_t handle,
+ unsigned int code,
+ unsigned int msg_count,
+ unsigned int msg_size);
+
+#endif /* COROSYNC_PLOAD_H_DEFINED */
Index: include/corosync/totem/totem.h
===================================================================
--- include/corosync/totem/totem.h (revision 1676)
+++ include/corosync/totem/totem.h (working copy)
@@ -141,6 +141,7 @@
TOTEM_CONFIGURATION_TRANSITIONAL
};
+#define TOTEM_CALLBACK_TOKEN_TYPE
enum totem_callback_token_type {
TOTEM_CALLBACK_TOKEN_RECEIVED = 1,
TOTEM_CALLBACK_TOKEN_SENT = 2
Index: include/corosync/ipc_gen.h
===================================================================
--- include/corosync/ipc_gen.h (revision 1676)
+++ include/corosync/ipc_gen.h (working copy)
@@ -48,6 +48,7 @@
CPG_SERVICE = 8,
CONFDB_SERVICE = 10,
QUORUM_SERVICE = 11,
+ PLOAD_SERVICE = 12
};
enum req_init_types {
Index: include/corosync/engine/coroapi.h
===================================================================
--- include/corosync/engine/coroapi.h (revision 1676)
+++ include/corosync/engine/coroapi.h (working copy)
@@ -88,6 +88,13 @@
};
#endif
+#if !defined(TOTEM_CALLBACK_TOKEN_TYPE)
+enum totem_callback_token_type {
+ TOTEM_CALLBACK_TOKEN_RECEIVED = 1,
+ TOTEM_CALLBACK_TOKEN_SENT = 2
+};
+#endif
+
enum corosync_lib_flow_control {
COROSYNC_LIB_FLOW_CONTROL_REQUIRED = 1,
COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED = 2
@@ -398,6 +405,14 @@
char *(*totem_ip_print) (struct totem_ip_address *addr);
+
+ int (*totem_callback_token_create) (
+ void **handle_out,
+ enum totem_callback_token_type type,
+ int delete,
+ int (*callback_fn) (enum totem_callback_token_type type, void *),
+ void *data);
+
/*
* Totem open process groups API for those service engines
* wanting their own groups
Index: exec/service.c
===================================================================
--- exec/service.c (revision 1676)
+++ exec/service.c (working copy)
@@ -78,6 +78,10 @@
.name = "corosync_confdb",
.ver = 0,
},
+ {
+ .name = "corosync_pload",
+ .ver = 0,
+ },
};
struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
Index: exec/apidef.c
===================================================================
--- exec/apidef.c (revision 1676)
+++ exec/apidef.c (working copy)
@@ -86,6 +86,7 @@
.totem_ifaces_get = totempg_ifaces_get,
.totem_ifaces_print = totempg_ifaces_print,
.totem_ip_print = totemip_print,
+ .totem_callback_token_create = totempg_callback_token_create,
.tpg_init = totempg_groups_initialize,
.tpg_exit = NULL, /* missing from totempg api */
.tpg_join = (typedef_tpg_join)totempg_groups_join,
Index: lib/Makefile
===================================================================
--- lib/Makefile (revision 1676)
+++ lib/Makefile (working copy)
@@ -42,6 +42,7 @@
libevs.a libevs.so.2.0.0 \
libcfg.a libcfg.so.2.0.0 \
libquorum.a libquorum.so.2.0.0 \
+ libpload.a libpload.so.2.0.0 \
libcoroutil.a libcoroutil.so.2.0.0
libcoroutil.a: util.o
@@ -68,6 +69,9 @@
libcfg.so.2.0.0: util.o cfg.o
$(CC) $(DARWIN_OPTS) util.o cfg.o -o $@
+libpload.so.2.0.0: util.o pload.o
+ $(CC) $(DARWIN_OPTS) util.o pload.o -o $@
+
else
libcoroutil.so.2.0.0: util.o
@@ -88,6 +92,9 @@
libcfg.so.2.0.0: util.o cfg.o
$(CC) -shared -Wl,-soname,libcfg.so.2,-version-script=$(srcdir)$(subdir)libcfg.versions util.o cfg.o -o $@
+libpload.so.2.0.0: util.o pload.o
+ $(CC) -shared -Wl,-soname,libpload.so.2,-version-script=$(srcdir)$(subdir)libpload.versions util.o cfg.o -o $@
+
endif
libevs.a: util.o evs.o
@@ -105,6 +112,9 @@
libcfg.a: util.o cfg.o
$(AR) -rc libcfg.a util.o cfg.o
+libpload.a: util.o pload.o
+ $(AR) -rc libpload.a util.o pload.o
+
clean:
rm -f *.o libcfg.so* libcoroutil.so* libcoroutil.a \
libevs.so* libevs.a libcpg.so* libcpg.a libcfg.a libconfdb.so* \
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais