From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753190AbcJKMOr (ORCPT ); Tue, 11 Oct 2016 08:14:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33908 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338AbcJKMOl (ORCPT ); Tue, 11 Oct 2016 08:14:41 -0400 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Peter Zijlstra , David Ahern , Namhyung Kim , Sukadev Bhattiprolu Subject: [PATCH 2/6] perf header: Display missing features Date: Tue, 11 Oct 2016 14:14:08 +0200 Message-Id: <1476188052-32316-3-git-send-email-jolsa@kernel.org> In-Reply-To: <1476188052-32316-1-git-send-email-jolsa@kernel.org> References: <1476188052-32316-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.38]); Tue, 11 Oct 2016 12:14:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Display missing features in header info, like: $ perf report --header-only # ======== # captured on: Mon Oct 10 09:39:47 2016 ... # missing features: HEADER_TRACING_DATA HEADER_CPU_TOPOLOGY ... Link: http://lkml.kernel.org/n/tip-bh5gp84gobdmyl345dcp64se@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/header.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index b227dfab56c3..59b67aefa8b2 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2251,7 +2251,7 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full) struct perf_header *header = &session->header; int fd = perf_data_file__fd(session->file); struct stat st; - int ret; + int ret, bit; hd.fp = fp; hd.full = full; @@ -2264,6 +2264,14 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full) perf_header__process_sections(header, fd, &hd, perf_file_section__fprintf_info); + + fprintf(fp, "# missing features: "); + for_each_clear_bit(bit, header->adds_features, HEADER_LAST_FEATURE) { + if (bit) + fprintf(fp, "%s ", feat_ops[bit].name); + } + + fprintf(fp, "\n"); return 0; } -- 2.7.4