Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754670AbbFKO0x (ORCPT ); Thu, 11 Jun 2015 10:26:53 -0400 Received: from mga02.intel.com ([134.134.136.20]:57583 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbbFKO0w convert rfc822-to-8bit (ORCPT ); Thu, 11 Jun 2015 10:26:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,595,1427785200"; d="scan'208";a="586057868" From: "Liang, Kan" To: Arnaldo Carvalho de Melo CC: "linux-kernel@vger.kernel.org" , "andi@firstfloor.org" Subject: RE: [PATCH 1/1] perf,tools: error out unsupported group leader immediately for perf stat Thread-Topic: [PATCH 1/1] perf,tools: error out unsupported group leader immediately for perf stat Thread-Index: AQHQpEz/isX6qP12tkyVSmwcWnl5pJ2m0BmAgACJbAA= Date: Thu, 11 Jun 2015 14:26:47 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F07701875CF4@SHSMSX103.ccr.corp.intel.com> References: <1434004360-8570-1-git-send-email-kan.liang@intel.com> <20150611140335.GB2696@kernel.org> In-Reply-To: <20150611140335.GB2696@kernel.org> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: 1791 Lines: 52 > > Em Thu, Jun 11, 2015 at 02:32:40AM -0400, kan.liang@intel.com escreveu: > > perf stat ignores the unsupported event and continue to count > > supported event. But if the unsupported event is group leader, perf > > tool will crash. After applying this patch, the unsupported group > > leader will error out immediately. > > > Without this patch: > > $ perf stat -x, -e '{node-prefetch-refs,cycles}' -- sleep 1 > > perf: util/evsel.c:1009: get_group_fd: Assertion `!(fd == -1)' failed. > > Aborted (core dumped) > > > With this patch: > > $ perf stat -x, -e '{node-prefetch-refs,cycles}' -- sleep 1 > > Error: > > The node-prefetch-refs event is not supported. > > I get something different, maybe I am missing a patch? > > With this patch: > > [acme@zoo linux]$ perf stat -x, -e '{node-prefetch-refs,cycles}' -- sleep 1 > Error: > The sys_perf_event_open() syscall returned with 22 (Invalid argument) > for event (node-prefetch-refs). > /bin/dmesg may provide additional information. > No CONFIG_PERF_EVENTS=y kernel support configured? > [acme@zoo linux]$ > I don't have other patches for this issue. It looks they have different error code, ENOENT VS. EINVAL. I have no idea why. > Applying it anyway, as it avoids a core dump and the message, albeit not > optimal, points to a problem with that event. > > Have you tried this with other tools, like perf record? Yes. Perf record and perf top will error out immediately if any unsupported event found. So they don't have such issue. Thanks, Kan > > - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/