diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-08-08 15:29:48 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-08-13 08:39:16 +0000 |
| commit | f21a18ca2012d229fb7061b37f26c8fa7de96e59 (patch) | |
| tree | b391e531f3ceba02fcbbe17381e068e853ce8ff7 /executor | |
| parent | 24d82c00908b7ce88f806bc92f0e5e5590a836bb (diff) | |
executor: set process name before taking snapshot
It's not necessary to set process name in snapshot mode
since we execute only 1 program each time.
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/executor.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/executor/executor.cc b/executor/executor.cc index 35fa27c47..02971f374 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -808,6 +808,12 @@ void realloc_output_data() void execute_one() { in_execute_one = true; +#if GOOS_linux + char buf[64]; + // Linux TASK_COMM_LEN is only 16, so the name needs to be compact. + snprintf(buf, sizeof(buf), "syz.%llu.%llu", procid, request_id); + prctl(PR_SET_NAME, buf); +#endif if (flag_snapshot) SnapshotStart(); else @@ -816,13 +822,6 @@ void execute_one() uint64 start = current_time_ms(); uint8* input_pos = input_data; -#if GOOS_linux - char buf[64]; - // Linux TASK_COMM_LEN is only 16, so the name needs to be compact. - snprintf(buf, sizeof(buf), "syz.%llu.%llu", procid, request_id); - prctl(PR_SET_NAME, buf); -#endif - if (cover_collection_required()) { if (!flag_threaded) cover_enable(&threads[0].cov, flag_comparisons, false); |
