Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754221AbcLNSbH convert rfc822-to-8bit (ORCPT ); Wed, 14 Dec 2016 13:31:07 -0500 Received: from mga14.intel.com ([192.55.52.115]:5396 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753852AbcLNSbG (ORCPT ); Wed, 14 Dec 2016 13:31:06 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,347,1477983600"; d="scan'208";a="202603001" From: "Liang, Kan" To: Jiri Olsa CC: "acme@kernel.org" , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" , "peterz@infradead.org" , "jolsa@kernel.org" , "Hunter, Adrian" , "andi@firstfloor.org" Subject: RE: [PATCH] perf tools: ignore zombie process for user profile Thread-Topic: [PATCH] perf tools: ignore zombie process for user profile Thread-Index: AQHSVjJnKH4edSLBtkyuCZ3KM60fFaEHNQqAgACK/WA= Date: Wed, 14 Dec 2016 18:26:02 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F0775367F8F6@SHSMSX103.ccr.corp.intel.com> References: <1481737685-24595-1-git-send-email-kan.liang@intel.com> <20161214175911.GA14085@krava> In-Reply-To: <20161214175911.GA14085@krava> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzk2MDYwN2YtZjQ2MC00NDVkLTk5OTEtY2U3YzU1MTFkZDRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImJIckd1RXF4R0RZVEU4SnpPWVdvVVRFQkVBWm1MWUFRbGJRa1UxU1lZcVU9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1255 Lines: 47 > > 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 The change as below make me confuse. + /* The system wide setup does not work with threads. */ + if (!evsel->system_wide) + return false; It looks the meaning of the comments is inconsistent with the code. Your original patch doesn't work well with the issue. But if I change the above code as below, the issue is fixed. if (evsel->system_wide) return false; Thanks, Kan