Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1241295imm; Fri, 12 Oct 2018 14:27:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV60pt1oHpq1qTJt8UA5YlRA628Osk253XoVJUMYD8YiIIsb4gOZXJwkiBYAUi129YyZ+g7FB X-Received: by 2002:a62:1b45:: with SMTP id b66-v6mr7679298pfb.94.1539379671876; Fri, 12 Oct 2018 14:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539379671; cv=none; d=google.com; s=arc-20160816; b=R4IK9xDuyr7b3VK/0xVOeYJeCzfqqq/wDmsaxKEm6sQc/yNta+BolkrK1NCtitfa5w OBnuvjslYrkCdbiJSNe1aPforZFDnE1cutv41oqGseYJRiSNw5Nzr+550Yjb5qR7Jf2E 3LlaZRrSS2RRX2beJ8pVDjSPtCUE3jZxlw83h6GUrKy2XIUqu2JdpoV5Uxb9fVCaU810 pZdNl9NqaoQDATFJh624fabRU3PAVxBh/BZEq6mOzWRCLN+TFdhR1/PWWdHebgUsuF2S 44HUHE0k1eT+MkSv1o77+TEBJWf1uTkDiW1PDj/TMop77XkI1lUOTTR9Brfnhe8iLKCe js4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=Ky/hwcktm81qh6cVpdbTrJeL1bzyNIt4g7dMkNUjmuY=; b=NWFwyVxxCYem2kH1eItR/lA+kRcMrWQNfhA2+2NFEvXR06LlEluDYtHjVo084hyEoZ TxfFqueVg5AidjBpM5pTGk+BhWamMXXRFYgJIXgyShk/cZBCAPRchGqHuJaZBRH+jQx2 DHFbJwQW2EbUfK82OIza6d9en6gNb6hovMSTB2QETAqm5wg7ebsj+uJhui8yQdLEzSE8 6D9m15NhnNmwXv+BmG+Eo3KGevMpzi70KuQ40XPV4VgIsxE49sTlshjrpsZ6T8gjrDuo wJixS7hGHjdNoRpjAN8nYWGOs3i/e0EmpmmO7pEMpozoxWRGJ/hmT6Ow/lsKrE6cQHrU uacA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EiZ592V3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p18-v6si2412018pgb.217.2018.10.12.14.27.36; Fri, 12 Oct 2018 14:27:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EiZ592V3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726255AbeJMFAp (ORCPT + 99 others); Sat, 13 Oct 2018 01:00:45 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:37596 "EHLO mail-wr1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbeJMFAp (ORCPT ); Sat, 13 Oct 2018 01:00:45 -0400 Received: by mail-wr1-f47.google.com with SMTP id y11-v6so14808110wrd.4 for ; Fri, 12 Oct 2018 14:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=Ky/hwcktm81qh6cVpdbTrJeL1bzyNIt4g7dMkNUjmuY=; b=EiZ592V3M8YCvv8yLdOkXjOkn8HMy/HNBRqw0RyLq1oxSSuLiktR4pKKUvMb9yAoRo dtn1maFkI9OiZt0/HLJ39W6qnw39mX4LV/97KWORIQWzweFeSXeTvFmEfd3kRcIcQjPM H6Ch7C+JQIvJToktehOEnu1ery7V2khixAE5uvK/3eYZVupS77eRvPVV05LHrUKJVAsy CiAbQbr8aq6CRB/aAPlM/tQfy2TccrwZe0fhDNWWKIDUKzt6Ow1kmY09FW3Z4rLzwbBk ZPj63L4to01P3v60BiyMfnT+o+LeEBFA4aC6gjVOsCWKc4x6NkzTN5ALReoYjq1I1S6T 7F8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Ky/hwcktm81qh6cVpdbTrJeL1bzyNIt4g7dMkNUjmuY=; b=FON1EnGvPToflocBF9qQNJnGDQ5z855ixGpwgb5BQVboGp4dyEq92LOwJv0uQ+cfmD NiY4uROz561OJe5WdPrK1NCx4nn9tucUeroypHDrbHD6eygEQvPd8ebxkyQ2Mdd+LLW6 wqt0kZmbkrDjDDy1z7vkTTQ+ZH7a004tMXGUgQKiEPXu9sHxg4vXlkyLSvjib9UgCXv8 40XaqsizVm7roJMIOLU8Aegl2lnxfx+83mh6e8KbsQv7s2QwLnsPAB7oXar9nbOnRYOi a4b20gYrHL5uO7NaHwgTRrXcDL05OO2K5jD9NoZZi2y6AT4KmPl4iVR2HoJAwDQK3q4M Tm4Q== X-Gm-Message-State: ABuFfojW0MgCfbgEIHU3SWo/pLJrkxU4h9sH3YN3Xs0dGU0WNy1lkenP DlzSmPm06JLdYP67TeD/HKzspZwxmmlLG9Y7a0WORjBIfK0= X-Received: by 2002:adf:ed06:: with SMTP id a6-v6mr6194417wro.262.1539379580663; Fri, 12 Oct 2018 14:26:20 -0700 (PDT) MIME-Version: 1.0 From: Stephane Eranian Date: Fri, 12 Oct 2018 14:26:09 -0700 Message-ID: Subject: [BUG] perf stat: hangs with -p and process completes To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I am running into a perf stat issue with the -p option which allows you to attach to a running process. If that process happens to terminate while under monitoring perf hangs in there and never terminates. The proper behavior would be to stop. I can see the issue in that the attached process is not a child, so wait() would not work. To reproduce: $ sleep 10 & $ perf stat -p $! doing the same with perf record works, so there is a solution to this problem.