OSDN Git Service

simpleperf: report symbols of native libraries in apk file.
[android-x86/system-extras.git] / simpleperf / runtest / function_fork.cpp
1 #include <unistd.h>
2
3 constexpr int LOOP_COUNT = 100000000;
4
5 void ParentFunction() {
6   for (volatile int i = 0; i < LOOP_COUNT; ++i) {
7   }
8 }
9
10 void ChildFunction() {
11   for (volatile int i = 0; i < LOOP_COUNT; ++i) {
12   }
13 }
14
15 int main() {
16   pid_t pid = fork();
17   if (pid == 0) {
18     ChildFunction();
19     return 0;
20   } else {
21     ParentFunction();
22   }
23   return 0;
24 }