[PATCH] D29954: [PGO] Suspend SIGKILL for PR_SET_PDEATHSIG in profile-write

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 13:41:50 PST 2017


On Wed, Feb 15, 2017 at 1:34 PM, Rong Xu <xur at google.com> wrote:

> Usleep() is in milliseconds.
>


 The  usleep()  function  suspends execution of the calling
       process for usec microseconds.  The sleep may  be  length-
       ened  slightly by any system activity or by the time spent
       processing the call.


Also:

4.3BSD, POSIX.1-2001. POSIX.1-2001 declares this function obsolete; use
nanosleep(2) instead. POSIX.1-2008 removes the specification of usleep().



> 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.
>
>
but the test can not depend on the timing.


> 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.
>

you can use llvm-profdata show command on empty file -- it will give error
message.


David

>
>
>
>
>
> On Feb 15, 2017 1:22 PM, "David Li via Phabricator" <
> reviews at reviews.llvm.org> wrote:
>
>> davidxl added inline comments.
>>
>>
>> ================
>> Comment at: test/profile/Linux/prctl.c:17
>> +int main(int argc, char **argv)
>> +{
>> +    pid_t pid = fork();
>> ----------------
>> format the test in llvm style.
>>
>>
>> ================
>> Comment at: test/profile/Linux/prctl.c:23
>> +        int sum = 0;
>> +        /* child process: sleep 50ms and get to runtime before the
>> +         * main process exits. */
>> ----------------
>> 50 us or microsec
>>
>>
>> ================
>> Comment at: test/profile/Linux/prctl.c:33
>> +    {
>> +        /* parent process: sleep 10ms to get into profile runtime first.
>> */
>> +        usleep(10);
>> ----------------
>> 10us
>>
>>
>> ================
>> Comment at: test/profile/Linux/prctl.c:40
>> +// CHECK: Total functions: 1
>> +// CHECK: Maximum function count: 5000
>> +// CHECK: Maximum internal block count: 1
>> ----------------
>> Just check size of profile data? It is not guaranteed that child process
>> will have a chance to dump.
>>
>>
>> https://reviews.llvm.org/D29954
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170215/634ba05c/attachment.html>


More information about the llvm-commits mailing list