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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6D6DC6FD1D for ; Wed, 15 Mar 2023 19:46:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BK3rbKgsqquh54M1798dMgKmFdzgDHYzxwAKCpl6JzQ=; b=2UGmiX4JMMyhlQ ujfQF7Z1vxC3ytnd4zqnSmjIOh8z0ov5gG03tbFXI/5M9aFfGClP2kSnyVirB7FB2BC9qDVKU7Ud2 BziQIJ2s5/sCPYNDO1UhhwZZFFMnp9k/97zjC0poN5G4zVN/Se/pfJ08s59K7MTfIeVQyZJlLPanL eb5aCc2uzE+/yPnbwohfOe8muDyDuAQiwxzUBLYl6PxN+seBuSuIftPSGWIRMAsbeK5LOClzOIxkR gHo7KKNwAcD2vFk03B78rnwGjXcGZ+iu7VwNVhp+Bq7JiFL25hAh8CeproJX2cRtiybJLIMvZ8biZ FM0P/eBwGJM27cchEjzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pcX4Q-00EL1w-2z; Wed, 15 Mar 2023 19:45:58 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pcX4P-00EL1g-1v for linux-arm-kernel@bombadil.infradead.org; Wed, 15 Mar 2023 19:45:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=y01ORIYDioEVK+C3RLu7PiblMjGZ/Ewum7W7plixzvo=; b=iHL5TOU2k0BQITDALiJVBw39yP oVrbw548qW9Pcn02wLkUF73ovE2LSPjJ1RZSpGVknc6vsrNNajvJUIwxiypEmMvtYu9AFGeeiHMm6 sZ3YbbPNbxRch2KfqlNTsW9FxX0zN5wrCmIpetZ3IzuvM2citjnbiO0GRuUIJzN5zuPoQAztuhmCY kJhVhPPerFku+KL8Gf5g54CYfHbODMAeDrw5907Zw5zddV/ow8JJwkQ1SU2Z9zLyQ0Nk+hJp3HcY3 UPqIbVFSVrBHSMZCZmcXLpWtCA8FW5ySFDxqkW+rNvtmTKVegDeu+uZEn80gaU5KjupSubkYMGqon 3siENRqg==; Received: from [179.97.37.151] (helo=quaco.ghostprotocols.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pcX4O-002EAT-0Y; Wed, 15 Mar 2023 19:45:56 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 9E23E4049F; Wed, 15 Mar 2023 16:45:53 -0300 (-03) Date: Wed, 15 Mar 2023 16:45:53 -0300 From: Arnaldo Carvalho de Melo To: Leo Yan Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , John Garry , James Clark , Adrian Hunter , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v5 06/16] perf kvm: Introduce histograms data structures Message-ID: References: <20230315145112.186603-1-leo.yan@linaro.org> <20230315145112.186603-7-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230315145112.186603-7-leo.yan@linaro.org> X-Url: http://acmel.wordpress.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Wed, Mar 15, 2023 at 10:51:02PM +0800, Leo Yan escreveu: > This is a preparation to support histograms in perf kvm tool. As first > step, this patch defines histograms data structures and initialize them. > > Signed-off-by: Leo Yan > Reviewed-by: James Clark > --- > tools/perf/builtin-kvm.c | 18 ++++++++++++++++++ > tools/perf/util/kvm-stat.h | 1 + > 2 files changed, 19 insertions(+) > > diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c > index d400434aa137..384992c8a01a 100644 > --- a/tools/perf/builtin-kvm.c > +++ b/tools/perf/builtin-kvm.c > @@ -85,6 +85,20 @@ static struct kvm_event_key keys[] = { > { NULL, NULL } > }; > > +struct kvm_hists { > + struct hists hists; > + struct perf_hpp_list list; > +}; > + > +static struct kvm_hists kvm_hists; > + > +static int kvm_hists__init(void) > +{ > + __hists__init(&kvm_hists.hists, &kvm_hists.list); > + perf_hpp_list__init(&kvm_hists.list); > + return 0; > +} > + Had to add: diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index c4cb34df155fec67..b06c11d306a11cab 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -85,7 +85,6 @@ static struct kvm_event_key keys[] = { DEF_SORT_NAME_KEY(time, mean), { NULL, NULL } }; -#endif // defined(HAVE_KVM_STAT_SUPPORT) && defined(HAVE_LIBTRACEEVENT) struct kvm_hists { struct hists hists; @@ -100,6 +99,7 @@ static int kvm_hists__init(void) perf_hpp_list__init(&kvm_hists.list); return 0; } +#endif // defined(HAVE_KVM_STAT_SUPPORT) && defined(HAVE_LIBTRACEEVENT) static const char *get_filename_for_perf_kvm(void) { > static const char *get_filename_for_perf_kvm(void) > { > const char *filename; > @@ -957,6 +971,8 @@ static int kvm_events_live_report(struct perf_kvm_stat *kvm) > set_term_quiet_input(&save); > init_kvm_event_record(kvm); > > + kvm_hists__init(); > + > signal(SIGINT, sig_handler); > signal(SIGTERM, sig_handler); > > @@ -1152,6 +1168,8 @@ static int kvm_events_report_vcpu(struct perf_kvm_stat *kvm) > init_kvm_event_record(kvm); > setup_pager(); > > + kvm_hists__init(); > + > ret = read_events(kvm); > if (ret) > goto exit; > diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h > index 841b3174c211..e2c17662bac7 100644 > --- a/tools/perf/util/kvm-stat.h > +++ b/tools/perf/util/kvm-stat.h > @@ -5,6 +5,7 @@ > #ifdef HAVE_KVM_STAT_SUPPORT > > #include "tool.h" > +#include "sort.h" > #include "stat.h" > #include "record.h" > > -- > 2.34.1 > -- - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel