Received: by 10.223.176.5 with SMTP id f5csp1929036wra; Thu, 8 Feb 2018 05:55:52 -0800 (PST) X-Google-Smtp-Source: AH8x225MknjIqlS2yWQgmaXqZHVkiz1aVVPW94vK8EhJ6jExM74B3pG65pA6zZE6HXyCI7/WhlMi X-Received: by 2002:a17:902:781:: with SMTP id 1-v6mr691414plj.411.1518098152036; Thu, 08 Feb 2018 05:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518098152; cv=none; d=google.com; s=arc-20160816; b=PK6Fy1v1VaFFyvwS5r6PJe7Yb7KsqzTKXaJHkjPKKKOvx01M4NDwPG2elAGfaWdbLc xNvvl8luHUwzcS/LWFuMNAVz+R1Cs/EXkTSbG252HI78bBVeAWUxtj2nAOblmhB/Mw3+ JPwPGCtnQDWA03qIlNuAZd7Q35u6uKBKr6LHvqt8MQdvxnEKTJC/wOzjj2Y8rIe7gZlB YpR8pPTHu2pAkOUrfLjKAojGKW6tiHyfCJaBbIZ8BkFScDU+1XHJtEbeeFQZyLa50BLI akqWRGm/rbzvHVrvasZYVkWzq1KFQbz2y017e9lqUMsX60g4PgTpP5jSMNkA3QGHtVBI bcbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=hlENsj5GB269UWWkWpe2EyorpnERNp5YR6KTV3m+x3Y=; b=PGbCTez9YeXWtvCybQ5V+sO5ZsZITnRTE4kOCA9AvrmZ0tRsN5tEr62Hwuq2m6c+fz OrkYHsujkHRGNo9mpg8OO5FQ6h23C8Tl1xL/Z61p4Y2Pfxq/Sv21yWJFHVsI3V28zgG2 kPDz7ZdH7LLmz7KAbfdp3SuQXeQVrAKa6IFq/emGQCYteDuvItvNTtS+f5h0j/wDdNOH WeiUcjAE3MJN5UhFZ6Ah+tEsAifJP6BVGeVo/usq75femPJVI/r7dGZY28vZnR9Y2aXm /rHu85bFAfEUR5EfAuL3GNxf4gM8kLuW1bJv2k6JgtxNEYxjXrWdjDhXzPpsWY3R5U4B pryQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q25si25588pfh.116.2018.02.08.05.55.38; Thu, 08 Feb 2018 05:55:52 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752315AbeBHNyg (ORCPT + 99 others); Thu, 8 Feb 2018 08:54:36 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35230 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752281AbeBHNyd (ORCPT ); Thu, 8 Feb 2018 08:54:33 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2AC2E76F94; Thu, 8 Feb 2018 13:54:33 +0000 (UTC) Received: from krava (unknown [10.43.17.63]) by smtp.corp.redhat.com (Postfix) with SMTP id 400672156A30; Thu, 8 Feb 2018 13:54:31 +0000 (UTC) Date: Thu, 8 Feb 2018 14:54:30 +0100 From: Jiri Olsa To: John Garry Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, namhyung@kernel.org, ak@linux.intel.com, wcohen@redhat.com, will.deacon@arm.com, ganapatrao.kulkarni@cavium.com, linux-kernel@vger.kernel.org, linuxarm@huawei.com, zhangshaokun@hisilicon.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 5/9] perf utils: add support for arch standard events Message-ID: <20180208135430.GD10234@krava> References: <1517939104-230881-1-git-send-email-john.garry@huawei.com> <1517939104-230881-6-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517939104-230881-6-git-send-email-john.garry@huawei.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 08 Feb 2018 13:54:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 08 Feb 2018 13:54:33 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jolsa@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote: SNIP > @@ -940,6 +1090,7 @@ int main(int argc, char *argv[]) > const char *output_file; > const char *start_dirname; > struct stat stbuf; > + struct event_struct *es1, *es2; > > prog = basename(argv[0]); > if (argc < 4) { > @@ -984,17 +1135,28 @@ int main(int argc, char *argv[]) > > maxfds = get_maxfds(); > mapfile = NULL; > + rc = nftw(ldirname, preprocess_arch_std_files, get_maxfds(), 0); you could use maxfds variable in here jirka