From f21a18ca2012d229fb7061b37f26c8fa7de96e59 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 8 Aug 2024 15:29:48 +0200 Subject: 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. --- executor/executor.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'executor/executor.cc') 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); -- cgit mrf-deployment