From d42e8e2c9bb0afde676ea6514d8f49aafb4082ae Mon Sep 17 00:00:00 2001 From: XanderYe Date: Sun, 23 Jan 2022 18:09:49 +0800 Subject: [PATCH] perf: use ld_preload on other 9 processes --- build/Centos6-DNF/root/run | 62 +++++++++++++++++++++++++++++++------- build/Centos7-DNF/root/run | 62 +++++++++++++++++++++++++++++++------- 2 files changed, 102 insertions(+), 22 deletions(-) diff --git a/build/Centos6-DNF/root/run b/build/Centos6-DNF/root/run index ca0142f..66e42e3 100755 --- a/build/Centos6-DNF/root/run +++ b/build/Centos6-DNF/root/run @@ -2,6 +2,12 @@ find /home/neople/ -name '*.log' -type f -print -exec rm -f {} \; find /home/neople/ -name '*.pid' -type f -print -exec rm -f {} \; find /home/neople/ -name 'core.*' -type f -print -exec rm -f {} \; +if $PRELOAD_LD;then + echo "start game use LD_PRELOAD mode" +else + echo "start game use normal mode" +fi + cd /root ./GateRestart @@ -15,13 +21,21 @@ cd /home/neople/monitor chmod 777 * rm -f /home/neople/monitor/pid/*.pid rm -rf /home/neople/monitor/log/*.* -./df_monitor_r mnt_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_monitor_r mnt_siroco start & +else + ./df_monitor_r mnt_siroco start & +fi cd /home/neople/manager chmod 777 * rm -f /home/neople/manager/pid/*.pid rm -rf /home/neople/manager/log/*.* -./df_manager_r manager start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_manager_r manager start & +else + ./df_manager_r manager start & +fi cd /home/neople/relay chmod 777 * @@ -33,31 +47,51 @@ cd /home/neople/bridge chmod 777 * rm -f /home/neople/bridge/pid/*.pid rm -rf /home/neople/bridge/log/*.* -./df_bridge_r bridge start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_bridge_r bridge start & +else + ./df_bridge_r bridge start & +fi cd /home/neople/channel chmod 777 * rm -f /home/neople/channel/pid/*.pid rm -rf /home/neople/channel/log/*.* -./df_channel_r channel start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_channel_r channel start & +else + ./df_channel_r channel start & +fi cd /home/neople/dbmw_guild chmod 777 * rm -f /home/neople/dbmw_guild/pid/*.pid rm -rf /home/neople/dbmw_guild/log/*.* -./df_dbmw_r dbmw_gld_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_gld_siroco start & +else + ./df_dbmw_r dbmw_gld_siroco start & +fi cd /home/neople/dbmw_mnt chmod 777 * rm -f /home/neople/dbmw_mnt/pid/*.pid rm -rf /home/neople/dbmw_mnt/log/*.* -./df_dbmw_r dbmw_mnt_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_mnt_siroco start & +else + ./df_dbmw_r dbmw_mnt_siroco start & +fi cd /home/neople/dbmw_stat chmod 777 * rm -f /home/neople/dbmw_stat/pid/*.pid rm -rf /home/neople/dbmw_stat/log/*.* -./df_dbmw_r dbmw_stat_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_stat_siroco start & +else + ./df_dbmw_r dbmw_stat_siroco start & +fi cd /home/neople/auction chmod 777 * @@ -75,13 +109,21 @@ cd /home/neople/guild chmod 777 * rm -f /home/neople/guild/pid/*.pid rm -rf /home/neople/guild/log/*.* -./df_guild_r gld_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_guild_r gld_siroco start & +else + ./df_guild_r gld_siroco start & +fi cd /home/neople/statics chmod 777 * rm -f /home/neople/statics/pid/*.pid rm -rf /home/neople/statics/log/*.* -./df_statics_r stat_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_statics_r stat_siroco start & +else + ./df_statics_r stat_siroco start & +fi cd /home/neople/coserver chmod 777 * @@ -121,12 +163,10 @@ sleep 2 if $PRELOAD_LD;then LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start & - echo "start game use LD_PRELOAD mode" sleep 2 LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start & else ./df_game_r siroco11 start & - echo "start game use normal mode" sleep 2 ./df_game_r siroco52 start & fi diff --git a/build/Centos7-DNF/root/run b/build/Centos7-DNF/root/run index ca0142f..66e42e3 100755 --- a/build/Centos7-DNF/root/run +++ b/build/Centos7-DNF/root/run @@ -2,6 +2,12 @@ find /home/neople/ -name '*.log' -type f -print -exec rm -f {} \; find /home/neople/ -name '*.pid' -type f -print -exec rm -f {} \; find /home/neople/ -name 'core.*' -type f -print -exec rm -f {} \; +if $PRELOAD_LD;then + echo "start game use LD_PRELOAD mode" +else + echo "start game use normal mode" +fi + cd /root ./GateRestart @@ -15,13 +21,21 @@ cd /home/neople/monitor chmod 777 * rm -f /home/neople/monitor/pid/*.pid rm -rf /home/neople/monitor/log/*.* -./df_monitor_r mnt_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_monitor_r mnt_siroco start & +else + ./df_monitor_r mnt_siroco start & +fi cd /home/neople/manager chmod 777 * rm -f /home/neople/manager/pid/*.pid rm -rf /home/neople/manager/log/*.* -./df_manager_r manager start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_manager_r manager start & +else + ./df_manager_r manager start & +fi cd /home/neople/relay chmod 777 * @@ -33,31 +47,51 @@ cd /home/neople/bridge chmod 777 * rm -f /home/neople/bridge/pid/*.pid rm -rf /home/neople/bridge/log/*.* -./df_bridge_r bridge start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_bridge_r bridge start & +else + ./df_bridge_r bridge start & +fi cd /home/neople/channel chmod 777 * rm -f /home/neople/channel/pid/*.pid rm -rf /home/neople/channel/log/*.* -./df_channel_r channel start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_channel_r channel start & +else + ./df_channel_r channel start & +fi cd /home/neople/dbmw_guild chmod 777 * rm -f /home/neople/dbmw_guild/pid/*.pid rm -rf /home/neople/dbmw_guild/log/*.* -./df_dbmw_r dbmw_gld_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_gld_siroco start & +else + ./df_dbmw_r dbmw_gld_siroco start & +fi cd /home/neople/dbmw_mnt chmod 777 * rm -f /home/neople/dbmw_mnt/pid/*.pid rm -rf /home/neople/dbmw_mnt/log/*.* -./df_dbmw_r dbmw_mnt_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_mnt_siroco start & +else + ./df_dbmw_r dbmw_mnt_siroco start & +fi cd /home/neople/dbmw_stat chmod 777 * rm -f /home/neople/dbmw_stat/pid/*.pid rm -rf /home/neople/dbmw_stat/log/*.* -./df_dbmw_r dbmw_stat_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_stat_siroco start & +else + ./df_dbmw_r dbmw_stat_siroco start & +fi cd /home/neople/auction chmod 777 * @@ -75,13 +109,21 @@ cd /home/neople/guild chmod 777 * rm -f /home/neople/guild/pid/*.pid rm -rf /home/neople/guild/log/*.* -./df_guild_r gld_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_guild_r gld_siroco start & +else + ./df_guild_r gld_siroco start & +fi cd /home/neople/statics chmod 777 * rm -f /home/neople/statics/pid/*.pid rm -rf /home/neople/statics/log/*.* -./df_statics_r stat_siroco start & +if $PRELOAD_LD;then + LD_PRELOAD=/lib/libhook.so ./df_statics_r stat_siroco start & +else + ./df_statics_r stat_siroco start & +fi cd /home/neople/coserver chmod 777 * @@ -121,12 +163,10 @@ sleep 2 if $PRELOAD_LD;then LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start & - echo "start game use LD_PRELOAD mode" sleep 2 LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start & else ./df_game_r siroco11 start & - echo "start game use normal mode" sleep 2 ./df_game_r siroco52 start & fi