gras_trp_plugin_t plug = xbt_new0(s_gras_trp_plugin_t, 1);
- DEBUG1("Create plugin %s", name);
+ XBT_DEBUG("Create plugin %s", name);
plug->name = xbt_strdup(name);
xbt_assert0(LOBYTE(wsaData.wVersion) == 2 &&
HIBYTE(wsaData.wVersion) == 0,
"Cannot find a usable WinSock DLL");
- INFO0("Found and initialized winsock2");
+ XBT_INFO("Found and initialized winsock2");
} /* The WinSock DLL is acceptable. Proceed. */
#elif HAVE_WINSOCK_H
{
WSADATA wsaData;
xbt_assert0(WSAStartup(0x0101, &wsaData) == 0,
"Cannot find a usable WinSock DLL");
- INFO0("Found and initialized winsock");
+ XBT_INFO("Found and initialized winsock");
}
#endif
void gras_trp_exit(void)
{
- DEBUG1("gras_trp value %d", _gras_trp_started);
+ XBT_DEBUG("gras_trp value %d", _gras_trp_started);
if (_gras_trp_started == 0) {
return;
}
if (plug->exit) {
plug->exit(plug);
} else if (plug->data) {
- DEBUG1("Plugin %s lacks exit(). Free data anyway.", plug->name);
+ XBT_DEBUG("Plugin %s lacks exit(). Free data anyway.", plug->name);
free(plug->data);
}
gras_socket_t sock = xbt_new0(s_gras_socket_t, 1);
- VERB1("Create a new socket (%p)", (void *) sock);
+ XBT_VERB("Create a new socket (%p)", (void *) sock);
sock->plugin = NULL;
*dst = sock;
- XBT_OUT;
+ XBT_OUT();
}
/**
gras_trp_plugin_t trp;
gras_socket_t sock;
- DEBUG2("Create a server socket from plugin %s on port %d",
+ XBT_DEBUG("Create a server socket from plugin %s on port %d",
gras_if_RL()? "tcp" : "sg", port);
trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
sock->meas = measurement;
/* Call plugin socket creation function */
- DEBUG1("Prepare socket with plugin (fct=%p)", trp->socket_server);
+ XBT_DEBUG("Prepare socket with plugin (fct=%p)", trp->socket_server);
TRY {
trp->socket_server(trp, port, sock);
- DEBUG3("in=%c out=%c accept=%c",
+ XBT_DEBUG("in=%c out=%c accept=%c",
sock->incoming ? 'y' : 'n',
sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
} CATCH(e) {
trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
- DEBUG1("Create a client socket from plugin %s",
+ XBT_DEBUG("Create a client socket from plugin %s",
gras_if_RL()? "tcp" : "sg");
/* defaults settings */
gras_trp_socket_new(0, &sock);
/* plugin-specific */
TRY {
(*trp->socket_client) (trp,host,port,sock);
- DEBUG3("in=%c out=%c accept=%c",
+ XBT_DEBUG("in=%c out=%c accept=%c",
sock->incoming ? 'y' : 'n',
sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
} CATCH(e) {
gras_socket_t sock_iter = NULL;
unsigned int cursor;
- XBT_IN;
- VERB1("Close %p", sock);
+ XBT_IN("");
+ XBT_VERB("Close %p", sock);
if (sock == _gras_lastly_selected_socket) {
xbt_assert0(!gras_opt_trp_nomoredata_on_close || !sock->moredata,
"Closing a socket having more data in buffer while the nomoredata_on_close option is activated");
if (sock->moredata)
- CRITICAL0
+ XBT_CRITICAL
("Closing a socket having more data in buffer. Option nomoredata_on_close disabled, so continuing.");
_gras_lastly_selected_socket = NULL;
}
/* FIXME: Issue an event when the socket is closed */
- DEBUG1("sockets pointer before %p", sockets);
+ XBT_DEBUG("sockets pointer before %p", sockets);
if (sock) {
/* FIXME: Cannot get the dynar mutex, because it can be already locked */
// _xbt_dynar_foreach(sockets,cursor,sock_iter) {
for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
_xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
if (sock == sock_iter) {
- DEBUG2("remove sock cursor %d dize %lu\n", cursor,
+ XBT_DEBUG("remove sock cursor %d dize %lu\n", cursor,
xbt_dynar_length(sockets));
xbt_dynar_cursor_rm(sockets, &cursor);
if (sock->plugin->socket_close)
/* free the memory */
free(sock);
- XBT_OUT;
+ XBT_OUT();
return;
}
}
- WARN1
+ XBT_WARN
("Ignoring request to free an unknown socket (%p). Execution stack:",
sock);
xbt_backtrace_display_current();
}
- XBT_OUT;
+ XBT_OUT();
}
/**
char *chunk = NULL;
unsigned long int sent_sofar;
- XBT_IN;
+ XBT_IN("");
THROW0(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
if (gras_if_RL())
"Socket not suited for data send (was created with gras_socket_server(), not gras_socket_client())");
for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
- CDEBUG5(gras_trp_meas,
+ XBT_CDEBUG(gras_trp_meas,
"Sent %lu msgs of %lu (size of each: %ld) to %s:%d",
sent_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
(*peer->plugin->raw_send) (peer, chunk, msg_size);
}
- CDEBUG5(gras_trp_meas,
+ XBT_CDEBUG(gras_trp_meas,
"Sent %lu msgs of %lu (size of each: %ld) to %s:%d", sent_sofar,
msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
if (gras_if_RL())
free(chunk);
- XBT_OUT;
+ XBT_OUT();
}
/** \brief Receive a chunk of data over a measurement socket
char *chunk = NULL;
unsigned long int got_sofar;
- XBT_IN;
+ XBT_IN("");
THROW0(unknown_error,0,"measurement sockets were broken in this release of SimGrid and should be ported back in the future."
"If you depend on it, sorry, you have to use an older version, or wait for the future version using it...");
xbt_assert0(peer->incoming, "Socket not suited for data receive");
for (got_sofar = 0; got_sofar < msg_amount; got_sofar++) {
- CDEBUG5(gras_trp_meas,
+ XBT_CDEBUG(gras_trp_meas,
"Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
(peer->plugin->raw_recv) (peer, chunk, msg_size);
}
- CDEBUG5(gras_trp_meas,
+ XBT_CDEBUG(gras_trp_meas,
"Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
gras_socket_peer_port(peer));
if (gras_if_RL())
free(chunk);
- XBT_OUT;
+ XBT_OUT();
}
/**
res = (peer->plugin->socket_accept) (peer);
res->meas = peer->meas;
- CDEBUG1(gras_trp_meas, "meas_accepted onto %d", res->sd);
+ XBT_CDEBUG(gras_trp_meas, "meas_accepted onto %d", res->sd);
return res;
}
unsigned int it;
gras_socket_t s;
- INFO1("** Dump the socket set %s", name);
+ XBT_INFO("** Dump the socket set %s", name);
xbt_dynar_foreach(procdata->sockets, it, s) {
- INFO4(" %p -> %s:%d %s",
+ XBT_INFO(" %p -> %s:%d %s",
s, gras_socket_peer_name(s), gras_socket_peer_port(s),
s->valid ? "(valid)" : "(peer dead)");
}
- INFO1("** End of socket set %s", name);
+ XBT_INFO("** End of socket set %s", name);
}
/*