Skip to content

Commit e72f8e9

Browse files
weissiJohannes Weiss
andauthored
shorten thread name to fit Linux's 16 char limit (#28)
Whilst Profile Recorder is sampling the process, it renames the thread that controls the sampling. Currently it set it to `ProfileRecorder-sampling` but Linux has a 16 character limit for thread names, so it gets truncated. Let's name it `swipr-sampling` (swipr for SWIft Profile Recorder) instead. Please note, the intent is that nobody ever even sees this thread name because it won't appear in the samples (it filters out its own thread) and unless it's actively sampling it won't set that thread name. So the only time when you'd see this thread name is if you either sampled the process with an external profiler whilst also concurrently sampling with Profile Recorder at the same time. Or of course, in case Profile Recorder has a bug and crashes the process. Co-authored-by: Johannes Weiss <[email protected]>
1 parent ba334f1 commit e72f8e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/CProfileRecorderSampler/sampler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ swipr_request_sample(FILE *output,
237237
(unsigned long long)current_time.tv_sec,
238238
(unsigned long long)current_time.tv_nsec);
239239

240-
swipr_os_dep_set_current_thread_name("ProfileRecorder-sampling");
240+
swipr_os_dep_set_current_thread_name("swipr-sampling");
241241
for (size_t sample_no=0; sample_no<sample_count; sample_no++) {
242242
err = swipr_make_sample(minidumps, SWIPR_MAX_MUTATOR_THREADS, &num_minidumps);
243243
if (err) {

0 commit comments

Comments
 (0)