Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1229012imm; Tue, 5 Jun 2018 11:01:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLC9kcbT9t+fkOmDh/8v+TvRjQzF80qQPvB/vVtHycmq3SlxX6YQRhnX3m+aV7yhFf5jXGr X-Received: by 2002:a63:700e:: with SMTP id l14-v6mr11131530pgc.206.1528221714352; Tue, 05 Jun 2018 11:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528221714; cv=none; d=google.com; s=arc-20160816; b=Nwfr+lT2a00hilfXZ0s55tZPyGQAU5Tia0nEWsmFuAxt1/YHugr/D4UpLVhwDL/PEL ahYjS+vyjvxTNzZ74+Xm1teWtRbYp7uaI6hsRhfW4x4PHoqB850UB7XS8vIv2QbYQmGg MRor64eFzO4DAZj4fgSXxi3Fj/d1UAO3Y0VyoYAcxOJ1KIIc1daX31mIKSvvA+Lp14CG W1D8F0tFd3VYsr+ZVdgwqKxMURmXjNStPokE4daDrxuX478ET1QcofSeTWb4dgGemMv9 VgZ/iM8Tk6O5wTnvPXU1Ov1mvm7zdE/QNGHqS4dRNdB6kwToVwTMkLfzyq+seTsPxkL8 iiaA== 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=ILTRiG69A6tr0Kk7cMWeOeORYaLW5TMjF53SeKvq6M4=; b=y9r9pa2U6Ybx1qn3gjslZ4TK66+CYuatD+9rpVd6EQPnTf32j00TW42I/GZ/wyQNOl ZHDqtaUUsVyrKpwm93ZLmaj+vHKKv+mAQ9GgWWPVOQv5DJVoO2cY/G/vpkMCDgpgLFGg wQCvjtcHuhxNaKc7FPdWuXFFN9aI5uFHAAZTwPCIQaHEU+EZssyEq0sa0B5SVqwuV+fZ TwrbSL4eQQpmzzd0fuxy3h2xqiLSD755yb63cj/4P/V8cavq5EFTN0vDwE+/Z14SvBcV kUczBT+AKBGRyZwL7SDbmrrgKZAnxbCHPsKlCpbYslVX9HjW1dn4lvPMI3UndPV/FzGJ +25w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PIAiFhVt; 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 w21-v6si48203457plp.199.2018.06.05.11.01.40; Tue, 05 Jun 2018 11:01:54 -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=PIAiFhVt; 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 S1752542AbeFERvn (ORCPT + 99 others); Tue, 5 Jun 2018 13:51:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:46022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbeFERvl (ORCPT ); Tue, 5 Jun 2018 13:51:41 -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 668482083C; Tue, 5 Jun 2018 17:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528221100; bh=uCBAFq/rNKGfzorM0b5+jwptA/cjD6EzegfvAX3Ac28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PIAiFhVtePbyBeCK5NmxiWd+DlrbAFGLHzy+Zer4s2CpUfKnBzjbl2VRvRmCktg/G 1ztaLdef9DiCUkA6NMlhyBcHUYtVkTlbYcbxNPBmX55cuPUSN6zY6w4vdGn1XneAg+ vY/dDuhBa4qaXWGKmkkRmo168jfTCX2PDl4XxZ2Q= 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 20/46] perf srcline: Make hist_entry srcline helper consistent with map's Date: Tue, 5 Jun 2018 14:50:04 -0300 Message-Id: <20180605175030.32549-21-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 No need to have "get_srcline", plain hist_entry__srcline() is enough and shorter. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-irhzpfmgdaf6cyk0uqqexoh9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-c2c.c | 2 +- tools/perf/util/sort.c | 8 ++++---- tools/perf/util/sort.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 2126bfbcb385..307b3594525f 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -1976,7 +1976,7 @@ static int filter_cb(struct hist_entry *he) c2c_he = container_of(he, struct c2c_hist_entry, he); if (c2c.show_src && !he->srcline) - he->srcline = hist_entry__get_srcline(he); + he->srcline = hist_entry__srcline(he); calc_width(c2c_he); diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 4ab0b4ab24e4..fed2952ab45a 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -331,7 +331,7 @@ struct sort_entry sort_sym = { /* --sort srcline */ -char *hist_entry__get_srcline(struct hist_entry *he) +char *hist_entry__srcline(struct hist_entry *he) { return map__srcline(he->ms.map, he->ip, he->ms.sym); } @@ -340,9 +340,9 @@ static int64_t sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right) { if (!left->srcline) - left->srcline = hist_entry__get_srcline(left); + left->srcline = hist_entry__srcline(left); if (!right->srcline) - right->srcline = hist_entry__get_srcline(right); + right->srcline = hist_entry__srcline(right); return strcmp(right->srcline, left->srcline); } @@ -351,7 +351,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width) { if (!he->srcline) - he->srcline = hist_entry__get_srcline(he); + he->srcline = hist_entry__srcline(he); return repsep_snprintf(bf, size, "%-.*s", width, he->srcline); } diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 9e6896293bbd..f007a26d6f6d 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -292,5 +292,5 @@ int64_t sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right); int64_t sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right); -char *hist_entry__get_srcline(struct hist_entry *he); +char *hist_entry__srcline(struct hist_entry *he); #endif /* __PERF_SORT_H */ -- 2.14.3