@@ -925,7 +925,9 @@ static void *tsync_agent_thread(void *data)
int sd;
while (true) {
+ tracecmd_debug("Listening on fd:%d\n", tsync->msg_handle->fd);
sd = accept(tsync->msg_handle->fd, NULL, NULL);
+ tracecmd_debug("Accepted fd:%d\n", sd);
if (sd < 0) {
if (errno == EINTR)
continue;
@@ -22,6 +22,8 @@
#include "trace-local.h"
#include "trace-msg.h"
+#define dprint(fmt, ...) tracecmd_debug(fmt, ##__VA_ARGS__)
+
static void make_vsocks(int nr, int *fds, unsigned int *ports)
{
unsigned int port;
@@ -55,6 +57,7 @@ static void make_net(int nr, int *fds, unsigned int *ports)
die("Failed to listen on port %d\n", port);
fds[i] = fd;
ports[i] = port;
+ dprint("CPU[%d]: fd:%d port:%d\n", i, fd, port);
start_port = port + 1;
}
}
@@ -26,6 +26,8 @@
#include "trace-local.h"
#include "trace-msg.h"
+#define dprint(fmt, ...) tracecmd_debug(fmt, ##__VA_ARGS__)
+
#define MAX_OPTION_SIZE 4096
#define _VAR_DIR_Q(dir) #dir
@@ -279,6 +281,8 @@ int trace_net_make(int port, enum port_type type)
if (rp == NULL)
return -1;
+ dprint("Create listen port: %d fd:%d\n", port, sd);
+
return sd;
}
@@ -56,6 +56,8 @@
#define FUNC_STACK_TRACE "func_stack_trace"
#define TSC_CLOCK "x86-tsc"
+#define dprint(fmt, ...) tracecmd_debug(fmt, ##__VA_ARGS__)
+
enum trace_type {
TRACE_TYPE_RECORD = 1,
TRACE_TYPE_START = (1 << 1),
@@ -3139,6 +3141,9 @@ static struct addrinfo *do_getaddrinfo(const char *host, unsigned int port,
return NULL;
}
+ dprint("Attached port %s: %d to results: %p\n",
+ type == USE_TCP ? "TCP" : "UDP", port, results);
+
return results;
}
@@ -3160,6 +3165,8 @@ static int connect_addr(struct addrinfo *results)
if (rp == NULL)
return -1;
+ dprint("connect results: %p with fd: %d\n", results, sfd);
+
return sfd;
}
@@ -3193,7 +3200,9 @@ static int do_accept(int sd)
int cd;
for (;;) {
+ dprint("Wait on accept: %d\n", sd);
cd = accept(sd, NULL, NULL);
+ dprint("accepted: %d\n", cd);
if (cd < 0) {
if (errno == EINTR)
continue;