Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1232650imm; Tue, 5 Jun 2018 11:05:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI/hwNAXn1l+uMghgy6en/96+OdM7yoRtKTYhITmV/pkql8yy3et0DGrpp7ulyEx+y87Mev X-Received: by 2002:a62:50d6:: with SMTP id g83-v6mr26488947pfj.31.1528221902321; Tue, 05 Jun 2018 11:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528221902; cv=none; d=google.com; s=arc-20160816; b=jmA+pFjhPiJJgSRcb/hioi/uaJczjPVPcO1CWUev5wlJDITSFHGt9SR6b6sOTDJ9FB hENjrbRnD2IgaaJ3GDMluXwXVbvYzdASylOzptZouXQN13GSwwfxuLfl5WM24DJogsUh M5E6xG1FW/gZF/38Rg10rwcZEio/59OwkTh71B5fWwjLvzcxtf4oadSpVMBJA0OF/T1X 7hmKBvRrEGFcovtsofVcl6NKXHlgn3yJTzxUZ7YyO0ZEVZt43a6q7Gi3pF/CwQ+Lyihx sowIUA3JnNv/DGiBylbWDsfcU3axTy1phWNFAFAijnBRzLi63j5Y5WGnbXC1HpUK6l2L qgog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nZYxPt0gJjVKI/LriPFiOl6VtDfjAe/Woogc3uwcHf4=; b=JaoT4N36y3HyxHmTGExuSfhHdaeQseP/Kyan0rPYx3x8FWXV4JZMoStRRbzj0OA5ot pmkfUivBsqihMGNDaPWeLfIhqSeV8tWYepAhPyjCSef9f/6UNoJg4LHPyQ3X83+A634o Lj8TURY1/k3ewP+Wsu83aTKYw/5KyccrB7UiaFZteDp7UGun/VxtsxiU0j0pO7NEVlmM EseAsqfW3c0IFz/ItImfph6myU82QDtjNFMsH1exxunSRKU7niJIwFyb1Je5rYdq8GWV +LPVA7NEuZ7WF44K1lSkpQTSV+bjBsY7GBV1hve73qTJPy4Z58vEJ5dyD181YIs/znDp xHtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ml0dqUA3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8-v6si35974416pgv.169.2018.06.05.11.04.42; Tue, 05 Jun 2018 11:05:02 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=ml0dqUA3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752316AbeFERvW (ORCPT + 99 others); Tue, 5 Jun 2018 13:51:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:45782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292AbeFERvU (ORCPT ); Tue, 5 Jun 2018 13:51:20 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DFE632075B; Tue, 5 Jun 2018 17:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528221080; bh=TEBtNk3wKuqUHueKjgrvIG8O+47onjJnu4FDtJ4y0kU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ml0dqUA3rEbkQdnXJT3yd7xrMQte+576N13/Zdu18tN9pKlpXJdZKCvJsXXSbA8BL v+HbJ31iUAcYVCDCr8AvV7A/IgfsG3GO0Oa5HI57mYFwxfee+pUKUD7S2n26tHYw53 7rZrNxR2RxlQlViVm6Jj0uyvQQIInw3Y25EUbbWs= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 13/46] perf annotate: Stop using symbol_conf.nr_events global in symbol__hists() Date: Tue, 5 Jun 2018 14:49:57 -0300 Message-Id: <20180605175030.32549-14-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180605175030.32549-1-acme@kernel.org> References: <20180605175030.32549-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo Since now we have evsel->evlist->nr_entries in the single place calling this function, use it. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-9mgosbqa977h39j4i9ys8t75@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index f11199f0be27..7c194b04a2da 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -21,6 +21,7 @@ #include "debug.h" #include "annotate.h" #include "evsel.h" +#include "evlist.h" #include "block-range.h" #include "string2.h" #include "arch/common.h" @@ -867,7 +868,7 @@ static struct cyc_hist *symbol__cycles_hist(struct symbol *sym) return notes->src->cycles_hist; } -static struct annotated_source *symbol__hists(struct symbol *sym) +static struct annotated_source *symbol__hists(struct symbol *sym, int nr_hists) { struct annotation *notes = symbol__annotation(sym); @@ -881,7 +882,7 @@ static struct annotated_source *symbol__hists(struct symbol *sym) if (notes->src->histograms == NULL) { alloc_histograms: annotated_source__alloc_histograms(notes->src, symbol__size(sym), - symbol_conf.nr_events); + nr_hists); } return notes->src; @@ -895,7 +896,7 @@ static int symbol__inc_addr_samples(struct symbol *sym, struct map *map, if (sym == NULL) return 0; - src = symbol__hists(sym); + src = symbol__hists(sym, evsel->evlist->nr_entries); if (src == NULL) return -ENOMEM; return __symbol__inc_addr_samples(sym, map, src, evsel->idx, addr, sample); -- 2.14.3