Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Pliz don't have two log channels with the same name
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 11 Dec 2017 00:40:29 +0000 (01:40 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 11 Dec 2017 00:40:32 +0000 (01:40 +0100)
This was breaking in a weird way. On Linux, the internal replay
channel was used for both the parameter setting and the use (it
resulted in more things to be shown when setting replay.thres:verb).
On Mac, the parameter setting did not reach the channel usage, and
nothing was shown.

The fact that the linker accepted these two competing definitions of
strong identifiers is weird. According to my teachings, this should
have failed :)

examples/s4u/replay-comm/s4u-replay-comm.cpp
examples/s4u/replay-comm/s4u-replay-comm.tesh
examples/s4u/replay-storage/s4u-replay-storage.cpp
examples/s4u/replay-storage/s4u-replay-storage.tesh

index 5d5b515..4c5db1e 100644 (file)
@@ -8,10 +8,10 @@
 #include "xbt/str.h"
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(replay, "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(replay_comm, "Messages specific for this msg example");
 
 #define ACT_DEBUG(...)                                                                                                 \
-  if (XBT_LOG_ISENABLED(replay, xbt_log_priority_verbose)) {                                                           \
+  if (XBT_LOG_ISENABLED(replay_comm, xbt_log_priority_verbose)) {                                                      \
     char* NAME = xbt_str_join_array(action, " ");                                                                      \
     XBT_DEBUG(__VA_ARGS__);                                                                                            \
     xbt_free(NAME);                                                                                                    \
@@ -20,7 +20,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(replay, "Messages specific for this msg example");
 
 static void log_action(const char* const* action, double date)
 {
-  if (XBT_LOG_ISENABLED(replay, xbt_log_priority_verbose)) {
+  if (XBT_LOG_ISENABLED(replay_comm, xbt_log_priority_verbose)) {
     char* name = xbt_str_join_array(action, " ");
     XBT_VERB("%s %f", name, date);
     xbt_free(name);
index 6409afa..00006b2 100644 (file)
@@ -1,14 +1,12 @@
 ! output sort 19
-$ ${bindir:=.}/s4u-replay-comm --log=replay.thres=verbose ${platfdir}/small_platform_fatpipe.xml s4u-replay-comm-split_d.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
-> [  0.000000] (p0@Tremblay) Prepare to replay file 's4u-replay-comm-split-p0.txt'
-> [  0.000000] (p1@Ruby) Prepare to replay file 's4u-replay-comm-split-p1.txt'
+$ ${bindir:=.}/s4u-replay-comm --log=replay_comm.thres=verbose ${platfdir}/small_platform_fatpipe.xml s4u-replay-comm-split_d.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [ 20.703314] (p0@Tremblay) p0 recv p1 20.703314
 > [ 20.703314] (p1@Ruby) p1 send p0 1e10 20.703314
 > [ 30.897513] (p0@Tremblay) p0 compute 1e9 10.194200
 > [ 30.897513] (p1@Ruby) p1 compute 1e9 10.194200
 > [ 30.897513] (maestro@) Simulation time 30.8975
 
-$ ${bindir:=.}/s4u-replay-comm --log=replay.thres=verbose ${platfdir}/small_platform_fatpipe.xml s4u-replay-comm_d.xml s4u-replay-comm.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-replay-comm --log=replay_comm.thres=verbose ${platfdir}/small_platform_fatpipe.xml s4u-replay-comm_d.xml s4u-replay-comm.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [ 20.703314] (p0@Tremblay) p0 recv p1 20.703314
 > [ 20.703314] (p1@Ruby) p1 send p0 1e10 20.703314
 > [ 30.897513] (p0@Tremblay) p0 compute 1e9 10.194200
index 8d84d0a..543b21e 100644 (file)
 #include <xbt/replay.hpp>
 #include <xbt/str.h>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(storage_replay, "Messages specific for this example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(replay_storage, "Messages specific for this example");
 
 static std::unordered_map<std::string, simgrid::s4u::File*> opened_files;
 
 #define ACT_DEBUG(...)                                                                                                 \
-  if (XBT_LOG_ISENABLED(storage_replay, xbt_log_priority_verbose)) {                                                   \
+  if (XBT_LOG_ISENABLED(replay_storage, xbt_log_priority_verbose)) {                                                   \
     char* NAME = xbt_str_join_array(action, " ");                                                                      \
     XBT_DEBUG(__VA_ARGS__);                                                                                            \
     xbt_free(NAME);                                                                                                    \
@@ -24,7 +24,7 @@ static std::unordered_map<std::string, simgrid::s4u::File*> opened_files;
 
 static void log_action(const char* const* action, double date)
 {
-  if (XBT_LOG_ISENABLED(storage_replay, xbt_log_priority_verbose)) {
+  if (XBT_LOG_ISENABLED(replay_storage, xbt_log_priority_verbose)) {
     char* name = xbt_str_join_array(action, " ");
     XBT_VERB("%s %f", name, date);
     xbt_free(name);
index de04643..a7a63a1 100644 (file)
@@ -1,5 +1,5 @@
 ! output sort 19
-$ ${bindir:=.}/s4u-replay-storage --log=storage_replay.thres=verbose ${platfdir}/storage/storage.xml s4u-replay-storage_d.xml s4u-replay-storage.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-replay-storage --log=replay_storage.thres=verbose ${platfdir}/storage/storage.xml s4u-replay-storage_d.xml s4u-replay-storage.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (p0@denise) p0 open /home/lib/libsimgrid.so.3.6.2 0.000000
 > [  0.063552] (p0@denise) p0 read /home/lib/libsimgrid.so.3.6.2 12710497 0.063552
 > [  0.063552] (p0@denise) p0 close /home/lib/libsimgrid.so.3.6.2 0.000000