Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp286375pxu; Tue, 1 Dec 2020 11:13:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHOkGme4zc0tjelubWX4/DSzcKI4/YOJM5g+18YDL+IxsfWlz2vD5rAm1EanjwJ4Gwnox1 X-Received: by 2002:a17:906:cd06:: with SMTP id oz6mr1872730ejb.25.1606849994936; Tue, 01 Dec 2020 11:13:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606849994; cv=none; d=google.com; s=arc-20160816; b=Fs9t5CtdzYQjfWeVJxmcvNtWZULmY7ht9cdDqEbUXaSlS9DYEupmXNIbu2C39zqlho mBnpuYIYLSrOrYjJga5JliBus762fvt9QBE+QpTSid/HV8ovZJAhvt9n/jrJM3bBKu6Y Iwta8dLpGmwHWqbP02G84zy0BfCyD6Zk+JtnS7DyD61I9Wyx30q1iEYvuUfGXUz2MxBQ uP/cnd/+u7fnx3/cbyP69DIemeoexW50XoUsGu4NbRqqAqs/1x9K2LQ6MwzOqqfxajIy P0bUlZqA+obWzEYKsLRQEShm0xvynN4vnpLlYfdziy1cGnMvIHJRyAywLQTiKREPogsm RXUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jxGy1IU1fFcWp6k3pkgDhm/kEu5lCs4ZoIk7tIztZrU=; b=erGzRgsxRveXOCoTBtkGgof+I6cyXRfb0wBYP4tKDl68u0iUVzQ6pb87lkg6v8AOfM d8zakUS8pY8x8kPiLTPT58B5qQexgtamZebqa7+gLB/RX4UW6uAP7d5uMS0XoK48A6hd Lg5XnUaWypo2DpyoBmcUGfhvaW4ESWNh7lkZO93qf5fDR7yACS2d+NRzLVod4oTyVgrV LGVV7G8kO9R5/7BJDODVx/QK/4xYNLEL1Tts1Q54i/PKJ+eyAnezCE2Bk8c5uqDaANcy 6us1fbxxAE80lW96fQB0yaCGSJWxktOnlPNeq/sg41w8BKBsYkQy04AVmSYs2kxn5seW Cd6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=biuGj1jt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si466528edj.278.2020.12.01.11.12.51; Tue, 01 Dec 2020 11:13:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=biuGj1jt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730273AbgLATLE (ORCPT + 99 others); Tue, 1 Dec 2020 14:11:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55659 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgLATLD (ORCPT ); Tue, 1 Dec 2020 14:11:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606849777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jxGy1IU1fFcWp6k3pkgDhm/kEu5lCs4ZoIk7tIztZrU=; b=biuGj1jtCKZn+ZO1bDZJyOlMlYzfuCVqHgUuRQNdyx5mWqGo73Cf2vvLbm7cGh2KX10R3d OlBO4BqzSkgZETyTHnscDAvapRM0BY5temSrxpM/W9sRJKj+MQg6v1S4ALh1D7z7vME8BX yXk9hv/ze+3RFeMah3ExEd50Dv0PHss= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-160-5H57SKGgNzCmFFcCUxpjrw-1; Tue, 01 Dec 2020 14:09:33 -0500 X-MC-Unique: 5H57SKGgNzCmFFcCUxpjrw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ADFBB185E480; Tue, 1 Dec 2020 19:09:31 +0000 (UTC) Received: from krava (unknown [10.40.193.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 366B619C44; Tue, 1 Dec 2020 19:09:28 +0000 (UTC) Date: Tue, 1 Dec 2020 20:09:28 +0100 From: Jiri Olsa To: Petr Malat Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Adrian Hunter , Kan Liang , Alexey Budankov Subject: Re: [PATCH v2 1/3] Revert "perf session: Fix decompression of PERF_RECORD_COMPRESSED records" Message-ID: <20201201190928.GB3169083@krava> References: <20201124095923.3683-1-oss@malat.biz> <20201124102919.15312-1-oss@malat.biz> <20201124143645.GD2088148@krava> <20201124181519.GA29264@ntb.petris.klfree.czf> <20201130114020.GA29476@ntb.petris.klfree.czf> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201130114020.GA29476@ntb.petris.klfree.czf> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 30, 2020 at 12:40:20PM +0100, Petr Malat wrote: > Hi Jiří, > were you able to reproduce the issue? I may also upload perf-archive > if that would help. oh yea ;-) seems like those 2 commits you reverted broke 32 bits perf for data files > 32MB but the fix you did does not work for Alexey's test he mentioned in the commit: $ perf record -z -- some_long_running_workload $ perf report --stdio -vv it's failing for me with: # ./perf report Couldn't allocate memory for decompression 0xfe6f3a [0x60]: failed to process type: 81 [Operation not permitted] Error: failed to process sample # To display the perf.data header info, please use --header/--header-only options. # I think that's why here's special handling for compressed events, but I'll need to check on that in more detail, I was hoping for Alexey to answer ;-) jirka > Petr > > On Tue, Nov 24, 2020 at 07:15:19PM +0100, Petr Malat wrote: > > Hi! > > On Tue, Nov 24, 2020 at 03:36:45PM +0100, Jiri Olsa wrote: > > > On Tue, Nov 24, 2020 at 11:29:15AM +0100, Petr Malat wrote: > > > > Both mmapped and compressed events can be split by the buffer boundary, > > > > it doesn't make sense to handle them differently. > > > I'm going to need more than this, if there's a problem > > > with current code please share more details, what's > > > broken and how it shows > > It's easy to trigger the problem - make a perf recording larger than > > MMAP_SIZE (32MB on 32-bit platform) and run perf report on it. There > > is a small chance recorded events will be aligned on the 32 MB > > boundary and in that case just repeat the test. > > > > The problem was introduced by "perf session: Avoid infinite loop when > > seeing invalid header.size", which instead of aborting the execution > > when there is a truncated event at the end of the file just terminated > > execution whenever there is a split event. Later then the problem has > > been noticed for compressed events and fixed by "perf session: Fix > > decompression of PERF_RECORD_COMPRESSED records" by effectively > > reverting "perf session: Avoid infinite loop when seeing invalid > > header.size" for compressed events, which left uncompressed events > > broken. > > > > I think the best is to revert these 2 changes and fix the original > > problem by aborting when there is no actual shift during remapping - as > > long as we shift, it's clear we must approach the end of the file so > > such an algorithm can't loop forever. > > BR, > > Petr >