• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisãof55a0c1a5d9ce09594250a24bec6dbb0d55a5e18 (tree)
Hora2013-05-14 13:33:15
AutorHiroaki Nakano <nakano.hiroaki@nttc...>
CommiterHiroaki Nakano

Mensagem de Log

thread id output to logfile for debug.

Mudança Sumário

Diff

--- a/doc/heartbeat-ra/sample.crm
+++ b/doc/heartbeat-ra/sample.crm
@@ -37,34 +37,34 @@ group grpUltraMonkey \
3737 ### Primitive Configuration ###
3838 primitive prmVIPcheck ocf:heartbeat:VIPcheck \
3939 params \
40- target_ip="MODIFY_TARGET_VIP" \
40+ target_ip="" \
4141 count="1" \
4242 wait="10" \
43- op start interval="0s" timeout="90s" on-fail="restart" start_delay="4s"
43+ op start interval="0s" timeout="90s" on-fail="restart" start_delay="4s“
4444
45-primitive prmVIP ocf:heartbeat:IPaddr2 \
45+primitive prmVIP1 ocf:heartbeat:IPaddr2 \
4646 params \
47- ip="MODIFY_VIP_IP" \
48- nic="MODIFY_VIP_NIC" \
49- cidr_netmask="MODIFY_VIP_NETMASK" \
47+ ip="" \
48+ nic="" \
49+ cidr_netmask="" \
5050 op start interval="0s" timeout="60s" on-fail="restart" \
5151 op monitor interval="10s" timeout="60s" on-fail="restart" \
52- op stop interval="0s" timeout="60s" on-fail="block"
52+ op stop interval="0s" timeout="60s" on-fail="fence"
5353
5454 primitive prmL7directord ocf:heartbeat:L7directord \
5555 op start interval="0s" timeout="60s" on-fail="restart" \
5656 op monitor interval="10s" timeout="60s" on-fail="restart" \
57- op stop interval="0s" timeout="60s" on-fail="block"
57+ op stop interval="0s" timeout="60s" on-fail="fence"
5858
5959 primitive prmL7vsd ocf:heartbeat:L7vsd \
6060 op start interval="0s" timeout="60s" on-fail="restart" \
6161 op monitor interval="10s" timeout="60s" on-fail="restart" \
62- op stop interval="0s" timeout="60s" on-fail="block"
62+ op stop interval="0s" timeout="60s" on-fail="fence"
6363
6464 primitive prmPingd ocf:pacemaker:pingd \
6565 params \
6666 name="default_ping_set" \
67- host_list="MODIFY_PING_TARGET_IP" \
67+ host_list="" \
6868 multiplier="100" \
6969 op start interval="0s" timeout="60s" on-fail="restart" \
7070 op monitor interval="10s" timeout="60s" on-fail="restart" \
@@ -73,7 +73,7 @@ primitive prmPingd ocf:pacemaker:pingd \
7373 primitive prmDiskd ocf:pacemaker:diskd \
7474 params \
7575 name="diskcheck_status_internal" \
76- device="MODIFY_TARGET_DISK_DEV" \
76+ device="" \
7777 interval="10" \
7878 op start interval="0s" timeout="60s" on-fail="restart" \
7979 op monitor interval="10s" timeout="60s" on-fail="restart" \
@@ -83,8 +83,8 @@ primitive prmDiskd ocf:pacemaker:diskd \
8383 # params \
8484 # priority="1" \
8585 # stonith-timeout="40s" \
86-# hostlist="MODIFY_PRYMARY_HOST" \
87-# dead_check_target="MODIFY_TARGET_IP MODIFY_TARGET_IP ..." \
86+# hostlist="" \
87+# dead_check_target="" \
8888 # standby_check_command="/usr/sbin/crm_resource -r prmVIP -W | grep -q `hostname`" \
8989 # op start interval="0s" timeout="60s" \
9090 # op monitor interval="10s" timeout="60s" \
@@ -92,12 +92,12 @@ primitive prmDiskd ocf:pacemaker:diskd \
9292
9393 #primitive prmStonith1-2 stonith:external/ipmi \
9494 # params \
95-# passwd="MODIFY_IPMI_PASSWORD" \
96-# ipaddr="MODIFY_IPMI_IP" \
95+# passwd="" \
96+# ipaddr="" \
9797 # priority="2" \
98-# userid="MODIFY_IPMI_USER" \
99-# hostname="MODIFY_PRYMARY_HOST" \
100-# interface="MODIFY_IPMI_INTERFACE" \
98+# userid="" \
99+# hostname="" \
100+# interface="" \
101101 # stonith-timeout="60s" \
102102 # op start interval="0s" timeout="60s" \
103103 # op monitor interval="3600s" timeout="60s" \
@@ -107,7 +107,7 @@ primitive prmDiskd ocf:pacemaker:diskd \
107107 # params \
108108 # priority="3" \
109109 # stonith-timeout="600s" \
110-# hostlist="MODIFY_PRYMARY_HOST" \
110+# hostlist="" \
111111 # op start interval="0s" timeout="60s" \
112112 # op monitor interval="3600s" timeout="60s" \
113113 # op stop interval="0s" timeout="60s"
@@ -116,8 +116,8 @@ primitive prmDiskd ocf:pacemaker:diskd \
116116 # params \
117117 # priority="1" \
118118 # stonith-timeout="40s" \
119-# hostlist="MODIFY_SECONDARY_HOST" \
120-# dead_check_target="MODIFY_TARGET_IP MODIFY_TARGET_IP ..." \
119+# hostlist="" \
120+# dead_check_target="" \
121121 # standby_check_command="/usr/sbin/crm_resource -r prmVIP -W | grep -q `hostname`" \
122122 # op start interval="0s" timeout="60s" \
123123 # op monitor interval="10s" timeout="60s" \
@@ -125,12 +125,12 @@ primitive prmDiskd ocf:pacemaker:diskd \
125125
126126 #primitive prmStonith2-2 stonith:external/ipmi \
127127 # params \
128-# passwd="MODIFY_IPMI_PASSWORD" \
129-# ipaddr="MODIFY_IPMI_IP" \
128+# passwd="" \
129+# ipaddr="" \
130130 # priority="2" \
131-# userid="MODIFY_IPMI_USER" \
132-# hostname="MODIFY_SECONDARY_HOST" \
133-# interface="MODIFY_IPMI_INTERFACE" \
131+# userid="" \
132+# hostname="" \
133+# interface="" \
134134 # stonith-timeout="60s" \
135135 # op start interval="0s" timeout="60s" \
136136 # op monitor interval="3600s" timeout="60s" \
@@ -140,21 +140,21 @@ primitive prmDiskd ocf:pacemaker:diskd \
140140 # params \
141141 # priority="3" \
142142 # stonith-timeout="600s" \
143-# hostlist="MODIFY_SECONDARY_HOST" \
143+# hostlist="" \
144144 # op start interval="0s" timeout="60s" \
145145 # op monitor interval="3600s" timeout="60s" \
146146 # op stop interval="0s" timeout="60s"
147147
148148 ### Resource Location ###
149149 location rsc_location-grpUltraMonkey-1 grpUltraMonkey \
150- rule 200: #uname eq MODIFY_PRYMARY_HOST \
151- rule 100: #uname eq MODIFY_SECONDARY_HOST \
150+ rule 200: #uname eq \
151+ rule 100: #uname eq \
152152 rule -INFINITY: not_defined default_ping_set or default_ping_set lt 100 \
153153 rule -INFINITY: not_defined diskcheck_status_internal or diskcheck_status_internal eq ERROR
154154 #location rsc_location-grpStonith1-2 grpStonith1 \
155-# rule -INFINITY: #uname eq MODIFY_PRYMARY_HOST
155+# rule -INFINITY: #uname eq
156156 #location rsc_location-grpStonith2-3 grpStonith2 \
157-# rule -INFINITY: #uname eq MODIFY_SECONDARY_HOST
157+# rule -INFINITY: #uname eq
158158
159159 ### Resource Colocation ###
160160 colocation rsc_colocation-grpUltraMonkey-clnPingd-1 INFINITY: grpUltraMonkey clnPingd
--- /dev/null
+++ b/l7vsd/include/gettid.h
@@ -0,0 +1,31 @@
1+#ifndef GETTID_H
2+#define GETTID_H
3+
4+#include <unistd.h>
5+#include <sys/syscall.h>
6+#include <sys/types.h>
7+
8+#include <boost/noncopyable.hpp>
9+
10+namespace l7vs
11+{
12+
13+class get_tid : boost::noncopyable
14+{
15+public:
16+ static pid_t gettid(void) {
17+ return syscall(SYS_gettid);
18+ };
19+};
20+
21+/*
22+extern "C"
23+pid_t gettid(void)
24+{
25+ return syscall(SYS_gettid);
26+}
27+*/
28+
29+}
30+
31+#endif
--- a/l7vsd/src/l7vsd.cpp
+++ b/l7vsd/src/l7vsd.cpp
@@ -35,6 +35,7 @@
3535 #include "error_code.h"
3636 #include "snmpagent.h"
3737 #include "snmpfunc.h"
38+#include "gettid.h"
3839 #define PARAM_SCHED_ALGORITHM "task_scheduler_algorithm"
3940 #define PARAM_SCHED_PRIORITY "task_scheduler_priority"
4041 #define TRAP_TIME_STRING_MAX_SIZE (20)
@@ -191,6 +192,9 @@ void l7vsd::list_virtual_service_verbose(l7vsd_response *response, error_code
191192 //! @param[out] error_code
192193 void l7vsd::add_virtual_service(const virtualservice_element *in_vselement, error_code &err)
193194 {
195+ pid_t tid;
196+ tid = get_tid::gettid();
197+
194198 Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 7, "l7vsd::add_virtual_service", __FILE__, __LINE__);
195199
196200 boost::mutex::scoped_lock command_lock(command_mutex);
@@ -207,6 +211,7 @@ void l7vsd::add_virtual_service(const virtualservice_element *in_vselement, e
207211 if (LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_MAINTHREAD)) {
208212 std::stringstream debugstr;
209213 debugstr << "l7vsd::add_virtual_service arguments:";
214+ debugstr << boost::format("tid=%d") % tid;
210215 debugstr << boost::format("*in_vselement=%s") % *in_vselement;
211216 Logger::putLogDebug(LOG_CAT_L7VSD_MAINTHREAD, 8, debugstr.str(), __FILE__, __LINE__);
212217 }
@@ -323,6 +328,9 @@ void l7vsd::add_virtual_service(const virtualservice_element *in_vselement, e
323328 //! @param[out] error_code
324329 void l7vsd::del_virtual_service(const virtualservice_element *in_vselement, error_code &err)
325330 {
331+ pid_t tid;
332+ tid = get_tid::gettid();
333+
326334 Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 9, "l7vsd::del_virtual_service", __FILE__, __LINE__);
327335
328336 boost::mutex::scoped_lock command_lock(command_mutex);
@@ -339,6 +347,7 @@ void l7vsd::del_virtual_service(const virtualservice_element *in_vselement, e
339347 if (LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_MAINTHREAD)) {
340348 std::stringstream debugstr;
341349 debugstr << "l7vsd::del_virtual_service arguments:";
350+ debugstr << boost::format("tid=%d") % tid;
342351 debugstr << boost::format("*in_vselement=%s") % *in_vselement;
343352 Logger::putLogDebug(LOG_CAT_L7VSD_MAINTHREAD, 10, debugstr.str(), __FILE__, __LINE__);
344353 }
@@ -1471,7 +1480,13 @@ std::string l7vsd::usage()
14711480 //! signal handler function
14721481 void l7vsd::sig_exit_handler()
14731482 {
1474- Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 40, "l7vsd::sig_exit_handler", __FILE__, __LINE__);
1483+ pid_t tid;
1484+ tid = get_tid::gettid();
1485+
1486+ std::stringstream debugstr;
1487+ debugstr << "l7vsd::sig_exit_handler ";
1488+ debugstr << boost::format("Thread id=%d") % tid;
1489+ Logger logger(LOG_CAT_L7VSD_MAINTHREAD, 40, debugstr.str(), __FILE__, __LINE__);
14751490
14761491 sigset_t sigmask;
14771492 sigemptyset(&sigmask);
--- a/l7vsd/src/session_thread_control.cpp
+++ b/l7vsd/src/session_thread_control.cpp
@@ -26,6 +26,7 @@
2626 #include "session_thread_control.h"
2727
2828 #include "utility.h"
29+#include "gettid.h"
2930
3031 namespace l7vs
3132 {
@@ -66,8 +67,12 @@ void session_thread_control::start_thread()
6667 //
6768 void session_thread_control::upstream_run()
6869 {
70+ pid_t tid;
71+ tid = get_tid::gettid();
72+
6973 if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) {
70- boost::format fmt("in_function : void session_thread_control::upstream_run()");
74+ boost::format fmt("in_function[%d] : void session_thread_control::upstream_run()");
75+ fmt % tid;
7176 Logger::putLogDebug(LOG_CAT_L7VSD_VIRTUALSERVICE, 1, fmt.str(), __FILE__, __LINE__);
7277 }
7378
@@ -130,8 +135,12 @@ void session_thread_control::upstream_run()
130135 //
131136 void session_thread_control::downstream_run()
132137 {
138+ pid_t tid;
139+ tid = get_tid::gettid();
140+
133141 if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) {
134- boost::format fmt("in_function : void session_thread_control::downstream_run()");
142+ boost::format fmt("in_function[%d] : void session_thread_control::downstream_run()");
143+ fmt % tid;
135144 Logger::putLogDebug(LOG_CAT_L7VSD_VIRTUALSERVICE, 4, fmt.str(), __FILE__, __LINE__);
136145 }
137146 cpu_set_t mask;
@@ -293,7 +302,7 @@ void session_thread_control::join()
293302 downthread_joining_condition.wait(down_lk);
294303
295304 if (unlikely(LOG_LV_DEBUG == l7vs::Logger::getLogLevel(l7vs::LOG_CAT_L7VSD_VIRTUALSERVICE))) {
296- boost::format fmt("out_function : void session_thread_control::stopdownstream() : up_status = %d / down_status = %d");
305+ boost::format fmt("out_function : void session_thread_control::join() : up_status = %d / down_status = %d");
297306 fmt % upthread_state % downthread_state;
298307 l7vs::Logger::putLogDebug(l7vs::LOG_CAT_L7VSD_VIRTUALSERVICE, 16, fmt.str(), __FILE__, __LINE__);
299308 }
--- a/l7vsd/src/virtualservice_tcp.cpp
+++ b/l7vsd/src/virtualservice_tcp.cpp
@@ -38,6 +38,7 @@
3838 #include "snmpagent.h"
3939 #include "utility.h"
4040 #include "logger_access_manager.h"
41+#include "gettid.h"
4142
4243 // implementation for virtualservice_tcp
4344 /*!
@@ -1542,6 +1543,9 @@ void l7vs::virtualservice_tcp::del_realserver(const l7vs::virtualservice_element
15421543 */
15431544 void l7vs::virtualservice_tcp::run()
15441545 {
1546+ pid_t tid;
1547+ tid = get_tid::gettid();
1548+
15451549 Logger funcLog(LOG_CAT_L7VSD_VIRTUALSERVICE, 80, "function: void virtualservice_tcp::run()",
15461550 __FILE__, __LINE__);
15471551
@@ -1619,6 +1623,13 @@ void l7vs::virtualservice_tcp::run()
16191623 schedmod_rep_timer->async_wait(boost::bind(&virtualservice_tcp::handle_schedmod_replication,
16201624 this, boost::asio::placeholders::error));
16211625
1626+ if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_VIRTUALSERVICE))) {
1627+ boost::format formatter("function: void virtualservice_tcp::run() "
1628+ "thread id = %d");
1629+ formatter % tid;
1630+ Logger::putLogDebug(LOG_CAT_L7VSD_VIRTUALSERVICE, 82, formatter.str(), __FILE__, __LINE__);
1631+ }
1632+
16221633 //run dispatcher(start io_service loop)
16231634 work.reset(new boost::asio::io_service::work(*dispatcher));
16241635 boost::thread_group dispatcher_thread_group;