Skip to content

Commit

Permalink
[tests] print information about which knet_handle is performing opera…
Browse files Browse the repository at this point in the history
…tions

this is necessary when a test creates multiple handles for functional testing

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Mar 27, 2019
1 parent 821e2ab commit 91fa19d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libknet/tests/test-common.c
Expand Up @@ -240,7 +240,8 @@ void flush_logs(int logfd, FILE *std)
fprintf(std, "NO HANDLE INFO IN LOG MSG!!\n");
abort();
}
fprintf(std, "[knet]: [%s] %s: %.*s\n",
fprintf(std, "[knet: %p]: [%s] %s: %.*s\n",
msg.knet_h,
knet_log_get_loglevel_name(msg.msglevel),
knet_log_get_subsystem_name(msg.subsystem),
KNET_MAX_LOG_MSG_SIZE, msg.msg);
Expand Down Expand Up @@ -363,6 +364,7 @@ knet_handle_t knet_handle_start(int logfds[2], uint8_t log_level)
knet_handle_t knet_h = knet_handle_new(1, logfds[1], log_level, 0);

if (knet_h) {
printf("knet_handle_new at %p\n", knet_h);
return knet_h;
} else {
printf("knet_handle_new failed: %s\n", strerror(errno));
Expand Down

0 comments on commit 91fa19d

Please sign in to comment.