From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D40E5C4361A for ; Thu, 3 Dec 2020 23:33:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 848B3221EA for ; Thu, 3 Dec 2020 23:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728612AbgLCXdQ (ORCPT ); Thu, 3 Dec 2020 18:33:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31818 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbgLCXdQ (ORCPT ); Thu, 3 Dec 2020 18:33:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607038310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rPlYKESO+vAmWI9EKWDeRymu2gKUUONfnoufz+hgKcM=; b=gn3HXhz/qyXctTeZPlenhJis3rMqgYZeD+O0HcS3+2xROyXtig0BHzUx5METp8GHnywCt1 dnq7b89r8WWmLRbRwQNIJPjuN8lzsIb0cBzBRrsNUMJdhHb3VQOsHPSM/2bwixifG7tB6h gOw4v4btVaGlGtFzPOX9NyR87SFc814= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-326-6Nrb_VIOOSe1-UjtzYHYFw-1; Thu, 03 Dec 2020 18:31:46 -0500 X-MC-Unique: 6Nrb_VIOOSe1-UjtzYHYFw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBFD2800D55; Thu, 3 Dec 2020 23:31:44 +0000 (UTC) Received: from krava (unknown [10.40.195.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA4D61A8A5; Thu, 3 Dec 2020 23:31:42 +0000 (UTC) Date: Fri, 4 Dec 2020 00:31:41 +0100 From: Jiri Olsa To: Song Liu Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org Subject: Re: [PATCH v1 2/2] perf-stat: enable counting events for BPF programs Message-ID: <20201203233141.GE3613628@krava> References: <20201202093709.3374099-1-songliubraving@fb.com> <20201202093709.3374099-3-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201202093709.3374099-3-songliubraving@fb.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2020 at 01:37:09AM -0800, Song Liu wrote: > Introduce perf-stat -b option, which counts events for BPF programs, like: > > [root@localhost ~]# ~/perf stat -e ref-cycles,cycles -b 254 -I 1000 > 1.487903822 115,200 ref-cycles > 1.487903822 86,012 cycles > 2.489147029 80,560 ref-cycles > 2.489147029 73,784 cycles > 3.490341825 60,720 ref-cycles > 3.490341825 37,797 cycles > 4.491540887 37,120 ref-cycles > 4.491540887 31,963 cycles hi, I'm getting compile fail with gcc 10: builtin-stat.c: In function ‘cmd_stat’: builtin-stat.c:2429:7: error: declaration of ‘err’ shadows a previous local [-Werror=shadow] 2429 | int err = perf_event__synthesize_kernel_mmap((void *)&perf_stat, | ^~~ builtin-stat.c:2104:33: note: shadowed declaration is here 2104 | int status = -EINVAL, run_idx, err; | ^~~ jirka