1 /*
2 * Copyright (c) Huawei Technologies Co., Ltd. 2020-2023. All rights reserved.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "unistd.h"
17 #include "cstddef"
18 #include "cfenv"
19 #include "sys/mman.h"
20 #if not defined __APPLE__
21 #include "sys/prctl.h"
22 #endif
23 #include "sys/types.h"
24 #include "sys/stat.h"
25 #include "sys/uio.h"
26 #include "sys/utsname.h"
27 #include "fcntl.h"
28 #include "cstdio"
29 #include "sys/time.h"
30 #include "ctime"
31 #include "err.h"
32 #include "cstring"
33 #include "cerrno"
34 #include "dirent.h"
35 #include "util.h"
36
37 using namespace std;
38
39 constexpr int BUFFER = 1024;
40 constexpr int IOV_SIZE = 2;
41
42 static const vector<int> pipe2Flags {
43 O_CLOEXEC,
44 O_DIRECT,
45 O_CLOEXEC | O_DIRECT,
46 };
47
PrepareArgsPipe2(benchmark::internal::Benchmark * b)48 static void PrepareArgsPipe2(benchmark::internal::Benchmark* b)
49 {
50 for (auto f : pipe2Flags) {
51 b->Args({f});
52 }
53 }
54
ReadWriteTest(benchmark::State & state,bool isRead)55 void ReadWriteTest(benchmark::State& state, bool isRead)
56 {
57 size_t chunkSize = state.range(0);
58 int fd = open("/dev/zero", O_RDWR, OPEN_MODE);
59 if (fd == -1) {
60 perror("open ReadWriteTest");
61 }
62 char* bufRead = new char[chunkSize];
63 const char *bufWrite = "hello world!";
64 if (isRead) {
65 memset(bufRead, 0, chunkSize * sizeof(char));
66 }
67
68 while (state.KeepRunning()) {
69 if (isRead) {
70 if (read(fd, bufRead, chunkSize) == -1) {
71 perror("Read proc");
72 }
73 } else {
74 if (write(fd, bufWrite, chunkSize) == -1) {
75 perror("write proc");
76 }
77 }
78 }
79 state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(chunkSize));
80 delete[] bufRead;
81 close(fd);
82 }
83
84 template <typename Fn>
PreadWriteTest(benchmark::State & state,Fn f,bool buffered)85 void PreadWriteTest(benchmark::State &state, Fn f, bool buffered)
86 {
87 size_t chunkSize = state.range(0);
88 int fp = open("/dev/zero", O_RDWR, OPEN_MODE);
89 char *buf = new char[chunkSize];
90 off64_t offset = 0;
91 while (state.KeepRunning()) {
92 if (f(fp, buf, strlen(buf), offset) == -1) {
93 errx(1, "ERROR: op of %zu bytes failed.", chunkSize);
94 }
95 }
96
97 state.SetBytesProcessed(int64_t(state.iterations()) * int64_t(chunkSize));
98 delete[] buf;
99 close(fp);
100 }
101
102 // Obtain the identification code of the current process
Bm_function_Getpid(benchmark::State & state)103 static void Bm_function_Getpid(benchmark::State &state)
104 {
105 pid_t pid;
106 for (auto _ : state) {
107 pid = getpid();
108 benchmark::DoNotOptimize(pid);
109 }
110 state.SetBytesProcessed(state.iterations());
111 }
112
Bm_function_Geteuid(benchmark::State & state)113 static void Bm_function_Geteuid(benchmark::State &state)
114 {
115 uid_t uid;
116 for (auto _ : state) {
117 uid = geteuid();
118 benchmark::DoNotOptimize(uid);
119 }
120 state.SetBytesProcessed(state.iterations());
121 }
122
Bm_function_Close(benchmark::State & state)123 static void Bm_function_Close(benchmark::State &state)
124 {
125 for (auto _ : state) {
126 state.PauseTiming();
127 int fd = open("/dev/zero", O_RDONLY, OPEN_MODE);
128 if (fd == -1) {
129 perror("open Close");
130 }
131 state.ResumeTiming();
132 benchmark::DoNotOptimize(close(fd));
133 }
134 state.SetBytesProcessed(state.iterations());
135 }
136
137 constexpr int SECOND = 50;
138
Bm_function_Usleep(benchmark::State & state)139 static void Bm_function_Usleep(benchmark::State &state)
140 {
141 for (auto _ : state) {
142 benchmark::DoNotOptimize(usleep(SECOND));
143 }
144 state.SetItemsProcessed(state.iterations());
145 }
146
Bm_function_Pwrite64(benchmark::State & state)147 void Bm_function_Pwrite64(benchmark::State &state)
148 {
149 PreadWriteTest(state, pwrite, true);
150 }
151
Bm_function_Pread64(benchmark::State & state)152 void Bm_function_Pread64(benchmark::State &state)
153 {
154 PreadWriteTest(state, pread, true);
155 }
156
157 // Stores the destination path of the symbolic link file into a buffer and returns the length of the destination path
Bm_function_Readlink(benchmark::State & state)158 static void Bm_function_Readlink(benchmark::State &state)
159 {
160 char path[BUFFER] = {0};
161 ssize_t len;
162 int i = symlink("/dev/zero", "/data/local/tmp/tmplink");
163 if (i == -1) {
164 perror("symlink");
165 exit(-1);
166 }
167 for (auto _ : state) {
168 len = readlink("/data/local/tmp/tmplink", path, sizeof(path));
169 benchmark::DoNotOptimize(len);
170 }
171 remove("/data/local/tmp/tmplink");
172 }
173
Bm_function_Readlinkat(benchmark::State & state)174 static void Bm_function_Readlinkat(benchmark::State &state)
175 {
176 char path[BUFFER] = {0};
177 ssize_t len;
178 int i = symlink("/dev/zero", "/data/local/tmp/tmplink");
179 if (i == -1) {
180 perror("symlink");
181 }
182 DIR *dir = opendir("/data/local/tmp");
183 if (dir == nullptr) {
184 perror("opendir");
185 }
186 int fd = dirfd(dir);
187 for (auto _ : state) {
188 len = readlinkat(fd, "./tmplink", path, sizeof(path));
189 benchmark::DoNotOptimize(len);
190 }
191 closedir(dir);
192 remove("/data/local/tmp/tmplink");
193 }
194
195 extern "C" ssize_t __readlinkat_chk(int dirfd, const char*, char*, size_t, size_t);
196
Bm_function_Readlinkat_chk(benchmark::State & state)197 static void Bm_function_Readlinkat_chk(benchmark::State& state)
198 {
199 char path[BUFFER] = {0};
200 ssize_t len;
201 int i = symlink("/dev/zero", "/data/local/tmp/tmplink");
202 if (i == -1) {
203 perror("symlink");
204 }
205 DIR *dir = opendir("/data/local/tmp");
206 if (dir == nullptr) {
207 perror("opendir");
208 }
209 int fd = dirfd(dir);
210 for (auto _ : state) {
211 len = __readlinkat_chk(fd, "./tmplink", path, sizeof(path), __builtin_object_size(path, 1));
212 benchmark::DoNotOptimize(len);
213 }
214 closedir(dir);
215 remove("/data/local/tmp/tmplink");
216 }
217
Bm_function_Getuid(benchmark::State & state)218 static void Bm_function_Getuid(benchmark::State &state)
219 {
220 uid_t uid;
221 for (auto _ : state) {
222 uid = getuid();
223 benchmark::DoNotOptimize(uid);
224 }
225 state.SetItemsProcessed(state.iterations());
226 }
227
Bm_function_Getegid(benchmark::State & state)228 static void Bm_function_Getegid(benchmark::State &state)
229 {
230 gid_t gid;
231 for (auto _ : state) {
232 gid = getegid();
233 benchmark::DoNotOptimize(gid);
234 }
235 state.SetItemsProcessed(state.iterations());
236 }
237
Bm_function_Read(benchmark::State & state)238 static void Bm_function_Read(benchmark::State &state)
239 {
240 ReadWriteTest(state, true);
241 }
242
Bm_function_Write(benchmark::State & state)243 static void Bm_function_Write(benchmark::State &state)
244 {
245 ReadWriteTest(state, false);
246 }
247
Bm_function_Access_exist(benchmark::State & state)248 static void Bm_function_Access_exist(benchmark::State &state)
249 {
250 const char *filename = "/data";
251 for (auto _ : state) {
252 benchmark::DoNotOptimize(access(filename, F_OK));
253 }
254 state.SetBytesProcessed(state.iterations());
255 }
256
Bm_function_Access_read(benchmark::State & state)257 static void Bm_function_Access_read(benchmark::State &state)
258 {
259 const char *filename = "/data";
260 for (auto _ : state) {
261 benchmark::DoNotOptimize(access(filename, R_OK));
262 }
263 state.SetBytesProcessed(state.iterations());
264 }
265
Bm_function_Access_write(benchmark::State & state)266 static void Bm_function_Access_write(benchmark::State &state)
267 {
268 const char *filename = "/data";
269 for (auto _ : state) {
270 benchmark::DoNotOptimize(access(filename, W_OK));
271 }
272 state.SetBytesProcessed(state.iterations());
273 }
274
Bm_function_Access_execute(benchmark::State & state)275 static void Bm_function_Access_execute(benchmark::State &state)
276 {
277 const char *filename = "/data";
278 for (auto _ : state) {
279 benchmark::DoNotOptimize(access(filename, X_OK));
280 }
281 state.SetBytesProcessed(state.iterations());
282 }
283
284 static const char *g_writevvariable1[] = {"Pretend inferiority and", "hello,",
285 "non sa module libtoken_sync_manager_service.z.so",
286 "The variable device_company was",
287 "but never appeared in a",
288 "The build continued as if",
289 "product_name=rk3568", "build/toolchain/ohos:"};
290 static const char *g_writevvariable2[] = {"encourage others arrogance!", "world!", ":token_sync_manager_service",
291 "set as a build argument", "declare_args() block in any buildfile",
292 "that argument was unspecified", "ohos_build_type=", "ohos_clang_arm64"};
293 // Write the contents of multiple buffers to the file descriptor at once
Bm_function_Writev(benchmark::State & state)294 static void Bm_function_Writev(benchmark::State &state)
295 {
296 int fd = open("/dev/zero", O_RDWR, OPEN_MODE);
297 const char *str1 = g_writevvariable1[state.range(0)];
298 const char *str2 = g_writevvariable2[state.range(0)];
299 struct iovec iov[IOV_SIZE];
300 ssize_t nwritten;
301 iov[0].iov_base = (void *)str1;
302 iov[0].iov_len = strlen(str1);
303 iov[1].iov_base = (void *)str2;
304 iov[1].iov_len = strlen(str2);
305
306 for (auto _ : state) {
307 nwritten = writev(fd, iov, IOV_SIZE);
308 benchmark::DoNotOptimize(nwritten);
309 }
310 close(fd);
311 }
312
Bm_function_Uname(benchmark::State & state)313 static void Bm_function_Uname(benchmark::State &state)
314 {
315 for (auto _ : state) {
316 struct utsname buffer;
317 benchmark::DoNotOptimize(uname(&buffer));
318 }
319 state.SetItemsProcessed(state.iterations());
320 }
321
Bm_function_Lseek(benchmark::State & state)322 static void Bm_function_Lseek(benchmark::State &state)
323 {
324 const char *filepath = "/data/local/tmp/lseel_test.txt";
325 int fd = open(filepath, O_CREAT | O_RDONLY, OPEN_MODE);
326 if (fd == -1) {
327 perror("open lseek");
328 }
329 int testNumber = 10;
330 const char *bufStr = "lseek_test";
331 write(fd, bufStr, testNumber);
332 for (auto _ : state) {
333 lseek(fd, 0, SEEK_END);
334 lseek(fd, 0, SEEK_SET);
335 }
336 close(fd);
337 remove(filepath);
338 state.SetItemsProcessed(state.iterations());
339 }
340
Bm_function_Dup(benchmark::State & state)341 static void Bm_function_Dup(benchmark::State &state)
342 {
343 int fd = -1;
344 for (auto _ : state) {
345 fd = dup(STDOUT_FILENO);
346 if (fd == -1) {
347 perror("dup");
348 }
349
350 state.PauseTiming();
351 close(fd);
352 state.ResumeTiming();
353 }
354 }
355
Bm_function_Pipe2(benchmark::State & state)356 static void Bm_function_Pipe2(benchmark::State &state)
357 {
358 int flags = state.range(0);
359 for (auto _ : state) {
360 int fd[2];
361 if (pipe2(fd, flags) < 0) {
362 perror("pipe");
363 }
364
365 state.PauseTiming();
366 close(fd[0]);
367 close(fd[1]);
368 state.ResumeTiming();
369 }
370 }
371
Bm_function_Getopt(benchmark::State & state)372 static void Bm_function_Getopt(benchmark::State &state)
373 {
374 for (auto _ : state) {
375 int argc = 4;
376 char* argv[] = {
377 (char*)"exe",
378 (char*)"-ab",
379 (char*)"-c",
380 (char*)"foo"
381 };
382 int opt = 0;
383 while (opt != -1) {
384 opt = getopt(argc, argv, "abc:");
385 }
386 }
387 }
388
Bm_function_Fsync(benchmark::State & state)389 static void Bm_function_Fsync(benchmark::State &state)
390 {
391 const char *filepath = "/data/local/tmp/fsync_test";
392 int fd = open(filepath, O_CREAT | O_WRONLY, OPEN_MODE);
393 if (fd < 0) {
394 perror("open fsync");
395 }
396 int testNumber = 4;
397 write(fd, "test", testNumber);
398 for (auto _ : state) {
399 fsync(fd);
400 }
401 close(fd);
402 remove(filepath);
403 }
404
Bm_function_Fdatasync(benchmark::State & state)405 static void Bm_function_Fdatasync(benchmark::State &state)
406 {
407 const char *filepath = "/data/local/tmp/fdatasync_test";
408 int fd = open(filepath, O_CREAT | O_WRONLY, OPEN_MODE);
409 if (fd < 0) {
410 perror("open fdatasync");
411 }
412 int testNumber = 4;
413 write(fd, "test", testNumber);
414 for (auto _ : state) {
415 fdatasync(fd);
416 }
417 close(fd);
418 remove(filepath);
419 }
420
Bm_function_Ftruncate(benchmark::State & state)421 static void Bm_function_Ftruncate(benchmark::State &state)
422 {
423 const char *filepath = "/data/local/tmp/ftruncate_test";
424 char buf[BUFFER] = {0};
425 memset(buf, 'a', BUFFER);
426 int fd = open(filepath, O_CREAT | O_WRONLY, OPEN_MODE);
427 if (fd < 0) {
428 perror("open ftruncate");
429 }
430 write(fd, buf, BUFFER);
431 for (auto _ : state) {
432 ftruncate(fd, 0);
433 }
434 close(fd);
435 remove(filepath);
436 }
437
Bm_function_Unlink(benchmark::State & state)438 static void Bm_function_Unlink(benchmark::State &state)
439 {
440 const char *filepath = "/data/local/tmp/unlink_test";
441 int fd = open(filepath, O_CREAT | O_RDWR, OPEN_MODE);
442 if (fd < 0) {
443 perror("open unlink");
444 }
445 for (auto _ : state) {
446 unlink(filepath);
447 }
448 close(fd);
449 }
450
451 // Used to check file access permissions
452 // function default behavior
Bm_function_Faccessat_Normal(benchmark::State & state)453 static void Bm_function_Faccessat_Normal(benchmark::State &state)
454 {
455 int dirfd = AT_FDCWD;
456 const char* path = "musl_benchmark";
457 int mode = F_OK | R_OK | W_OK | X_OK;
458 for (auto _ : state) {
459 benchmark::DoNotOptimize(faccessat(dirfd, path, mode, AT_EACCESS));
460 }
461 }
462
463 // avoid dealing with symbolic links
Bm_function_Faccessat_Nofollow(benchmark::State & state)464 static void Bm_function_Faccessat_Nofollow(benchmark::State &state)
465 {
466 int dirfd = AT_FDCWD;
467 const char* path = "musl_benchmark";
468 int mode = F_OK | R_OK | W_OK | X_OK;
469 for (auto _ : state) {
470 benchmark::DoNotOptimize(faccessat(dirfd, path, mode, AT_SYMLINK_NOFOLLOW));
471 }
472 }
473
474 // Used to read data from a file descriptor into multiple buffers
Bm_function_Readv(benchmark::State & state)475 static void Bm_function_Readv(benchmark::State &state)
476 {
477 int fd = open("/dev/zero", O_RDONLY, OPEN_MODE);
478 if (fd == -1) {
479 perror("readv fail");
480 }
481
482 const size_t nbytes = state.range(0);
483 const size_t bufferalignment1 = state.range(1);
484 const size_t bufferalignment2 = state.range(2);
485 std::vector<char> buffer1;
486 std::vector<char> buffer2;
487 char* iovbuffer1 = GetAlignedPtr(&buffer1, bufferalignment1, nbytes);
488 char* iovbuffer2 = GetAlignedPtr(&buffer2, bufferalignment2, nbytes);
489
490 struct iovec iov[IOV_SIZE];
491 ssize_t numRead;
492
493 iov[0].iov_base = iovbuffer1;
494 iov[0].iov_len = buffer1.size();
495 iov[1].iov_base = iovbuffer2;
496 iov[1].iov_len = buffer2.size();
497
498 for (auto _ : state) {
499 numRead = readv(fd, iov, IOV_SIZE);
500 benchmark::DoNotOptimize(numRead);
501 }
502 close(fd);
503 }
504
505 // System functions that change file owners and groups
Bm_function_Chown(benchmark::State & state)506 static void Bm_function_Chown(benchmark::State &state)
507 {
508 const char *filename = "/data/data/chown.txt";
509 int fd = open(filename, O_RDWR | O_CREAT, OPEN_MODE);
510 if (fd == -1) {
511 perror("open chown");
512 }
513 for (auto _ : state) {
514 if (chown(filename, 1, 1) != 0) {
515 perror("chown proc");
516 }
517 }
518 close(fd);
519 remove(filename);
520 state.SetItemsProcessed(state.iterations());
521 }
522
Bm_function_Getpgrp(benchmark::State & state)523 static void Bm_function_Getpgrp(benchmark::State &state)
524 {
525 int pgid = -1;
526 for (auto _ : state) {
527 pgid = getpgrp();
528 if (pgid == -1) {
529 perror("getpgrp proc");
530 }
531 benchmark::DoNotOptimize(pgid);
532 }
533 }
534
535 // Deletes a file or directory under the specified path
536 // delete file
Bm_function_Unlinkat_ZeroFlag(benchmark::State & state)537 static void Bm_function_Unlinkat_ZeroFlag(benchmark::State &state)
538 {
539 const char* path = "/data/data/testUnlinkatZero.txt";
540 int fd = -1;
541 for (auto _ : state) {
542 state.PauseTiming();
543 fd = open(path, O_RDWR | O_CREAT, OPEN_MODE);
544 if (fd == -1) {
545 perror("open fstatUnlinkat zero");
546 }
547 state.ResumeTiming();
548 if (unlinkat(fd, path, 0) != 0) {
549 perror("unlinkat zero proc");
550 }
551 state.PauseTiming();
552 close(fd);
553 state.ResumeTiming();
554 }
555 }
556
557 // delete directory
Bm_function_Unlinkat_AT_REMOVEDIR(benchmark::State & state)558 static void Bm_function_Unlinkat_AT_REMOVEDIR(benchmark::State &state)
559 {
560 const char* path = "/data/data/testUnlinkatAtRemoveDir";
561 for (auto _ : state) {
562 state.PauseTiming();
563 if (mkdir(path, S_IRWXU | S_IRWXG | S_IXGRP | S_IROTH | S_IXOTH) == -1) {
564 perror("mkdir unlinkat removedir");
565 }
566 state.ResumeTiming();
567 if (unlinkat(AT_FDCWD, path, AT_REMOVEDIR) != 0) {
568 perror("unlinkat removedir proc");
569 }
570 }
571 }
572
Bm_function_Execlp_ls(benchmark::State & state)573 static void Bm_function_Execlp_ls(benchmark::State &state)
574 {
575 pid_t pid = fork();
576 if (pid < 0) {
577 perror("fork execlp ls");
578 }
579 for (auto _ : state) {
580 if (pid == 0) {
581 benchmark::DoNotOptimize(execlp("/bin/ls", "ls", "/tmp", nullptr));
582 }
583 }
584 }
585
Bm_function_Sysconf(benchmark::State & state)586 static void Bm_function_Sysconf(benchmark::State &state)
587 {
588 for (auto _ : state) {
589 benchmark::DoNotOptimize(sysconf(_SC_PAGESIZE));
590 }
591 }
592
Bm_function_Prctl(benchmark::State & state)593 static void Bm_function_Prctl(benchmark::State &state)
594 {
595 size_t pagesize = sysconf(_SC_PAGE_SIZE);
596 if (pagesize <= 0) {
597 perror("pagesize is lower than zero");
598 } else {
599 void *addr = mmap(nullptr, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
600 if (addr == nullptr) {
601 perror("mmap error");
602 }
603 static char addrName[] = "prctl_test";
604 for (auto _ : state) {
605 benchmark::DoNotOptimize(prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, addr, pagesize, addrName));
606 }
607 munmap(addr, pagesize);
608 }
609 }
610
611 MUSL_BENCHMARK(Bm_function_Getpid);
612 MUSL_BENCHMARK(Bm_function_Geteuid);
613 MUSL_BENCHMARK_WITH_ARG(Bm_function_Pwrite64, "COMMON_ARGS");
614 MUSL_BENCHMARK(Bm_function_Readlink);
615 MUSL_BENCHMARK(Bm_function_Readlinkat);
616 MUSL_BENCHMARK(Bm_function_Readlinkat_chk);
617 MUSL_BENCHMARK_WITH_ARG(Bm_function_Pread64, "COMMON_ARGS");
618 MUSL_BENCHMARK(Bm_function_Close);
619 MUSL_BENCHMARK(Bm_function_Usleep);
620 MUSL_BENCHMARK(Bm_function_Getuid);
621 MUSL_BENCHMARK(Bm_function_Getegid);
622 MUSL_BENCHMARK_WITH_ARG(Bm_function_Read, "COMMON_ARGS");
623 MUSL_BENCHMARK(Bm_function_Access_exist);
624 MUSL_BENCHMARK(Bm_function_Access_read);
625 MUSL_BENCHMARK(Bm_function_Access_write);
626 MUSL_BENCHMARK(Bm_function_Access_execute);
627 MUSL_BENCHMARK_WITH_ARG(Bm_function_Writev, "BENCHMARK_8");
628 MUSL_BENCHMARK(Bm_function_Uname);
629 MUSL_BENCHMARK_WITH_ARG(Bm_function_Write, "BENCHMARK_8");
630 MUSL_BENCHMARK(Bm_function_Lseek);
631 MUSL_BENCHMARK(Bm_function_Dup);
632 MUSL_BENCHMARK_WITH_APPLY(Bm_function_Pipe2, PrepareArgsPipe2);
633 MUSL_BENCHMARK(Bm_function_Getopt);
634 MUSL_BENCHMARK(Bm_function_Fsync);
635 MUSL_BENCHMARK(Bm_function_Fdatasync);
636 MUSL_BENCHMARK(Bm_function_Ftruncate);
637 MUSL_BENCHMARK(Bm_function_Unlink);
638 MUSL_BENCHMARK(Bm_function_Faccessat_Normal);
639 MUSL_BENCHMARK(Bm_function_Faccessat_Nofollow);
640 MUSL_BENCHMARK_WITH_ARG(Bm_function_Readv, "ALIGNED_TWOBUF");
641 MUSL_BENCHMARK(Bm_function_Chown);
642 MUSL_BENCHMARK(Bm_function_Getpgrp);
643 MUSL_BENCHMARK(Bm_function_Unlinkat_ZeroFlag);
644 MUSL_BENCHMARK(Bm_function_Unlinkat_AT_REMOVEDIR);
645 MUSL_BENCHMARK(Bm_function_Execlp_ls);
646 MUSL_BENCHMARK(Bm_function_Sysconf);
647 MUSL_BENCHMARK(Bm_function_Prctl);
648