From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938971AbcISNLz (ORCPT ); Mon, 19 Sep 2016 09:11:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46266 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964953AbcISNLJ (ORCPT ); Mon, 19 Sep 2016 09:11:09 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Don Zickus , Joe Mario , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Andi Kleen Subject: [PATCH 22/61] perf c2c report: Add header macros Date: Mon, 19 Sep 2016 15:09:31 +0200 Message-Id: <1474290610-23241-23-git-send-email-jolsa@kernel.org> In-Reply-To: <1474290610-23241-1-git-send-email-jolsa@kernel.org> References: <1474290610-23241-1-git-send-email-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 19 Sep 2016 13:11:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding helping macros to define header objects. It will be used in following patches, that add new dimensions. The c2c report will support 2 line headers, hence we only define line[0/1] in macros. Link: http://lkml.kernel.org/n/tip-tkgrfvlw0m5awb75fk2sv1wb@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-c2c.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 7bf6248dbd75..c21124e6bb63 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -271,6 +271,46 @@ static int c2c_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, return scnprintf(hpp->buf, hpp->size, "%*s", width, text); } +#define HEADER_LOW(__h) \ + { \ + .line[1] = { \ + .text = __h, \ + }, \ + } + +#define HEADER_BOTH(__h0, __h1) \ + { \ + .line[0] = { \ + .text = __h0, \ + }, \ + .line[1] = { \ + .text = __h1, \ + }, \ + } + +#define HEADER_SPAN(__h0, __h1, __s) \ + { \ + .line[0] = { \ + .text = __h0, \ + .span = __s, \ + }, \ + .line[1] = { \ + .text = __h1, \ + }, \ + } + +#define HEADER_SPAN_LOW(__h) \ + { \ + .line[1] = { \ + .text = __h, \ + }, \ + } + +#undef HEADER_LOW +#undef HEADER_BOTH +#undef HEADER_SPAN +#undef HEADER_SPAN_LOW + static struct c2c_dimension *dimensions[] = { NULL, }; -- 2.7.4