From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753137AbcJKMOp (ORCPT ); Tue, 11 Oct 2016 08:14:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53630 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752327AbcJKMOl (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 1/6] perf report: Move captured info to generic header info Date: Tue, 11 Oct 2016 14:14:07 +0200 Message-Id: <1476188052-32316-2-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.39]); Tue, 11 Oct 2016 12:14:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's not displayed in TUI now, putting it into generic part. Link: http://lkml.kernel.org/n/tip-5fk88kejqgi50ye7xdkhiloz@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/header.c | 9 +++++++++ tools/perf/util/session.c | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 85dd0db0a127..b227dfab56c3 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2250,9 +2250,18 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full) struct header_print_data hd; struct perf_header *header = &session->header; int fd = perf_data_file__fd(session->file); + struct stat st; + int ret; + hd.fp = fp; hd.full = full; + ret = fstat(fd, &st); + if (ret == -1) + return -1; + + fprintf(fp, "# captured on: %s", ctime(&st.st_ctime)); + perf_header__process_sections(header, fd, &hd, perf_file_section__fprintf_info); return 0; diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 5d61242a6e64..f268201048a0 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -2025,20 +2025,10 @@ out_delete_map: void perf_session__fprintf_info(struct perf_session *session, FILE *fp, bool full) { - struct stat st; - int fd, ret; - if (session == NULL || fp == NULL) return; - fd = perf_data_file__fd(session->file); - - ret = fstat(fd, &st); - if (ret == -1) - return; - fprintf(fp, "# ========\n"); - fprintf(fp, "# captured on: %s", ctime(&st.st_ctime)); perf_header__fprintf_info(session, fp, full); fprintf(fp, "# ========\n#\n"); } -- 2.7.4