mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jie Yu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MESOS-2590) Let the slave control the duration of the perf sampler instead of relying on a sleep command.
Date Thu, 02 Apr 2015 23:10:00 GMT

    [ https://issues.apache.org/jira/browse/MESOS-2590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14393690#comment-14393690
] 

Jie Yu commented on MESOS-2590:
-------------------------------

I ran strace on perf to see what's the difference:

{noformat:title=succeeded case}
# perf stat -a -x, --log-fd 1 --pid 10940 --event cycles,task-clock -- sleep 1
...
write(1, "30615138,cycles\n", 1630615138,cycles
)       = 16
write(1, "16.322481,task-clock\n", 2116.322481,task-clock
)  = 21
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
close(1)                                = 0
rt_sigaction(SIGCHLD, {SIG_DFL, [CHLD], SA_RESTORER|SA_RESTART, 0x7fbd1473b030}, {0x4210c0,
[CHLD], SA_RESTORER|SA_RESTART, 0x7fbd1473b030}, 8) = 0
kill(61376, SIGCHLD)                    = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
exit_group(0)                           = ?
{noformat}

{noformat:title=failed case (sending sigint)}
# perf stat -a -x, --log-fd 1 --pid 10940 --event cycles,task-clock
...
write(1, "327818256,cycles\n", 17327818256,cycles
)      = 17
write(1, "167.419056,task-clock\n", 22167.419056,task-clock
) = 22
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
close(1)                                = 0
rt_sigaction(SIGINT, {SIG_DFL, [INT], SA_RESTORER|SA_RESTART, 0x7fd6169cb030}, {0x4210c0,
[INT], SA_RESTORER|SA_RESTART, 0x7fd6169cb030}, 8) = 0
kill(62331, SIGINT)                     = 0
--- SIGINT (Interrupt) @ 0 (0) ---
+++ killed by SIGINT +++
{noformat}

So the only difference is that in the succeeded case, exit_group(0) is called. Will that affect
pipe behavior?

> Let the slave control the duration of the perf sampler instead of relying on a sleep
command.
> ---------------------------------------------------------------------------------------------
>
>                 Key: MESOS-2590
>                 URL: https://issues.apache.org/jira/browse/MESOS-2590
>             Project: Mesos
>          Issue Type: Improvement
>            Reporter: Jie Yu
>            Assignee: Jie Yu
>              Labels: twitter
>
> Right now, we use a sleep command to control the duration of perf sampling:
> {noformat}
> sudo perf stat -a -x, --log-fd 1 --pid 10940 -- sleep 10
> {noformat}
> This causes an additional process (i.e., the sleep process) to be forked and causes troubles
for us to terminate the perf sampler once the slave exits (See MESOS-2462).
> Seems that the additional sleep process is not necessary. The slave can just monitor
the duration and send a SIGINT to the perf process when duration elapsed. This will cause
the perf process to output the stats and terminate.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message