<div dir="auto">Usleep() is in milliseconds.<div dir="auto"><br><div dir="auto">As for the check, parent should get to the profile dump first as it sleeps  for 10ms. 80MB profile take 1 second to write. We should get the merged profile in any system with rasonable scheduler.</div><div dir="auto"><br></div><div dir="auto">I did not use 0 size check also because I don't find the support in FileCheck. I would need to use a shell command for this.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Feb 15, 2017 1:22 PM, "David Li via Phabricator" <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added inline comments.<br>
<br>
<br>
================<br>
Comment at: test/profile/Linux/prctl.c:17<br>
+int main(int argc, char **argv)<br>
+{<br>
+    pid_t pid = fork();<br>
----------------<br>
format the test in llvm style.<br>
<br>
<br>
================<br>
Comment at: test/profile/Linux/prctl.c:23<br>
+        int sum = 0;<br>
+        /* child process: sleep 50ms and get to runtime before the<br>
+         * main process exits. */<br>
----------------<br>
50 us or microsec<br>
<br>
<br>
================<br>
Comment at: test/profile/Linux/prctl.c:33<br>
+    {<br>
+        /* parent process: sleep 10ms to get into profile runtime first. */<br>
+        usleep(10);<br>
----------------<br>
10us<br>
<br>
<br>
================<br>
Comment at: test/profile/Linux/prctl.c:40<br>
+// CHECK: Total functions: 1<br>
+// CHECK: Maximum function count: 5000<br>
+// CHECK: Maximum internal block count: 1<br>
----------------<br>
Just check size of profile data? It is not guaranteed that child process will have a chance to dump.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D29954" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D29954</a><br>
<br>
<br>
<br>
</blockquote></div></div>