From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B25C8C433F5 for ; Mon, 4 Oct 2021 07:01:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EF166120F for ; Mon, 4 Oct 2021 07:01:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232970AbhJDHDO (ORCPT ); Mon, 4 Oct 2021 03:03:14 -0400 Received: from mga12.intel.com ([192.55.52.136]:36898 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232983AbhJDHCv (ORCPT ); Mon, 4 Oct 2021 03:02:51 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="205446684" X-IronPort-AV: E=Sophos;i="5.85,345,1624345200"; d="scan'208";a="205446684" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 00:00:58 -0700 X-IronPort-AV: E=Sophos;i="5.85,345,1624345200"; d="scan'208";a="621727121" Received: from abaydur-mobl1.ccr.corp.intel.com (HELO [10.249.230.47]) ([10.249.230.47]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 00:00:55 -0700 Subject: Re: [PATCH] perf report: Output non-zero offset for decompressed records To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel , Andi Kleen , Adrian Hunter , Alexander Antonov , Alexei Budankov , Riccardo Mancini References: <20210929091445.18274-1-alexey.v.bayduraev@linux.intel.com> From: "Bayduraev, Alexey V" Organization: Intel Corporation Message-ID: <6ab9dd72-ccac-4ce1-6456-ef7786911639@linux.intel.com> Date: Mon, 4 Oct 2021 10:00:52 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04.10.2021 9:42, Jiri Olsa wrote: > On Wed, Sep 29, 2021 at 12:14:45PM +0300, Alexey Bayduraev wrote: >> Print offset of PERF_RECORD_COMPRESSED record instead of zero for >> decompressed records in raw trace dump (-D option of perf-report): >> >> 0x17cf08 [0x28]: event: 9 >> >> instead of: >> >> 0 [0x28]: event: 9 >> >> The fix is not critical, because currently file_pos for compressed >> events is used in perf_session__process_event only to show offsets >> in the raw dump. > > hi, > I don't mind the change just curious, because I see also: > > perf_session__process_event > perf_session__process_user_event > lseek(fd, file_offset, ... > > which is not raw dump as the comment suggests Hi, Yes, but this "lseek" only works for user events, whereas the PERF_RECORD_COMPRESSED record shouln't contain such events. Currently, the PERF_RECORD_COMPRESSED container can only pack kernel events. Regards, Alexey > > thanks, > jirka > >> >> This patch was separated from patchset: >> https://lore.kernel.org/lkml/cover.1629186429.git.alexey.v.bayduraev@linux.intel.com/ >> and was already rewieved. >> >> Acked-by: Namhyung Kim >> Acked-by: Andi Kleen >> Reviewed-by: Riccardo Mancini >> Tested-by: Riccardo Mancini >> Signed-off-by: Alexey Bayduraev >> --- >> tools/perf/util/session.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c >> index 069c2cfdd3be..352f16076e01 100644 >> --- a/tools/perf/util/session.c >> +++ b/tools/perf/util/session.c >> @@ -2116,7 +2116,7 @@ fetch_decomp_event(u64 head, size_t mmap_size, char *buf, bool needs_swap) >> static int __perf_session__process_decomp_events(struct perf_session *session) >> { >> s64 skip; >> - u64 size, file_pos = 0; >> + u64 size; >> struct decomp *decomp = session->decomp_last; >> >> if (!decomp) >> @@ -2132,7 +2132,7 @@ static int __perf_session__process_decomp_events(struct perf_session *session) >> size = event->header.size; >> >> if (size < sizeof(struct perf_event_header) || >> - (skip = perf_session__process_event(session, event, file_pos)) < 0) { >> + (skip = perf_session__process_event(session, event, decomp->file_pos)) < 0) { >> pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n", >> decomp->file_pos + decomp->head, event->header.size, event->header.type); >> return -EINVAL; >> -- >> 2.19.0 >> >