From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760008AbcBYGaL (ORCPT ); Thu, 25 Feb 2016 01:30:11 -0500 Received: from torg.zytor.com ([198.137.202.12]:54856 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759375AbcBYG1L (ORCPT ); Thu, 25 Feb 2016 01:27:11 -0500 Date: Wed, 24 Feb 2016 21:42:21 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: a.p.zijlstra@chello.nl, jolsa@kernel.org, tglx@linutronix.de, acme@redhat.com, eranian@google.com, dsahern@gmail.com, hpa@zytor.com, linux-kernel@vger.kernel.org, ak@linux.intel.com, mingo@kernel.org, namhyung@kernel.org Reply-To: a.p.zijlstra@chello.nl, jolsa@kernel.org, tglx@linutronix.de, eranian@google.com, acme@redhat.com, dsahern@gmail.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, ak@linux.intel.com, namhyung@kernel.org In-Reply-To: <1455525293-8671-4-git-send-email-jolsa@kernel.org> References: <1455525293-8671-4-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Introduce cl_offset function Git-Commit-ID: d392711095f12942a61e2963f5ab0076ac651e73 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d392711095f12942a61e2963f5ab0076ac651e73 Gitweb: http://git.kernel.org/tip/d392711095f12942a61e2963f5ab0076ac651e73 Author: Jiri Olsa AuthorDate: Mon, 15 Feb 2016 09:34:33 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 23 Feb 2016 12:09:22 -0300 perf tools: Introduce cl_offset function It'll be used in following patches. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1455525293-8671-4-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/sort.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 46f159f..5b9c624 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h @@ -168,6 +168,12 @@ static inline u64 cl_address(u64 address) return (address & ~(cacheline_size - 1)); } +static inline u64 cl_offset(u64 address) +{ + /* return the cacheline of the address */ + return (address & (cacheline_size - 1)); +} + enum sort_mode { SORT_MODE__NORMAL, SORT_MODE__BRANCH,