Skip to content

Commit

Permalink
Thread names
Browse files Browse the repository at this point in the history
- `dnsperf`: Fix thread name length, glibc is limited to 16 characters
  • Loading branch information
jelu committed Jan 9, 2024
1 parent db0893a commit 55011c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dnsperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,12 +1582,12 @@ threadinfo_init(threadinfo_t* tinfo, const config_t* config,
}
tinfo->current_sock = 0;

char name[32];
char name[16]; // glibc is limited to 16 characters
PERF_THREAD(&tinfo->receiver, do_recv, tinfo);
snprintf(name, sizeof(name), "dnsperf-recv-%04d", idx);
snprintf(name, sizeof(name), "perf-recv-%04d", idx);
perf_os_thread_setname(tinfo->receiver, name);
PERF_THREAD(&tinfo->sender, do_send, tinfo);
snprintf(name, sizeof(name), "dnsperf-send-%04d", idx);
snprintf(name, sizeof(name), "perf-send-%04d", idx);
perf_os_thread_setname(tinfo->sender, name);
}

Expand Down

0 comments on commit 55011c6

Please sign in to comment.