Return-Path: X-Original-To: apmail-mesos-issues-archive@minotaur.apache.org Delivered-To: apmail-mesos-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9441817829 for ; Thu, 2 Apr 2015 23:10:00 +0000 (UTC) Received: (qmail 30102 invoked by uid 500); 2 Apr 2015 23:10:00 -0000 Delivered-To: apmail-mesos-issues-archive@mesos.apache.org Received: (qmail 29925 invoked by uid 500); 2 Apr 2015 23:10:00 -0000 Mailing-List: contact issues-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mesos.apache.org Delivered-To: mailing list issues@mesos.apache.org Received: (qmail 29914 invoked by uid 99); 2 Apr 2015 23:10:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2015 23:10:00 +0000 Date: Thu, 2 Apr 2015 23:10:00 +0000 (UTC) From: "Jie Yu (JIRA)" To: issues@mesos.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MESOS-2590) Let the slave control the duration of the perf sampler instead of relying on a sleep command. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)