Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbcLNR7Y (ORCPT ); Wed, 14 Dec 2016 12:59:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54340 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753596AbcLNR7W (ORCPT ); Wed, 14 Dec 2016 12:59:22 -0500 Date: Wed, 14 Dec 2016 18:59:11 +0100 From: Jiri Olsa To: kan.liang@intel.com Cc: acme@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, jolsa@kernel.org, adrian.hunter@intel.com, andi@firstfloor.org Subject: Re: [PATCH] perf tools: ignore zombie process for user profile Message-ID: <20161214175911.GA14085@krava> References: <1481737685-24595-1-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1481737685-24595-1-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 14 Dec 2016 17:59:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 824 Lines: 31 On Wed, Dec 14, 2016 at 12:48:05PM -0500, kan.liang@intel.com wrote: > From: Kan Liang > > If user has zombie process, the perf record -u will error out. > Here is an example. > $ ./testd & > [1] 23796 > $ sudo perf record -e cycles -u kan > Error: > The sys_perf_event_open() syscall returned with 3 (No such process) for > event (cycles). > /bin/dmesg may provide additional information. > No CONFIG_PERF_EVENTS=y kernel support configured? > > The source code of testd is as below. > int main() { > > if (fork()) > { > while (1); > } > return 0; > } > > Zombie process is dead process. It is meaningless to profile it. > It's better to ignore it for user profile. I recently posted different patch for same issue: http://marc.info/?l=linux-kernel&m=148153895827359&w=2 jirka