Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1857647pxu; Tue, 24 Nov 2020 10:29:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7ClXUBuhqpFoJUj+MIUpWkDP+k/O+zstozQE7cpkYVyxgJOGoW8gJ5FhVuk5WKgGpEjDd X-Received: by 2002:a17:906:c51:: with SMTP id t17mr5605648ejf.523.1606242550914; Tue, 24 Nov 2020 10:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606242550; cv=none; d=google.com; s=arc-20160816; b=sOKRHcF+UV5wG27zCg4QWx1D5xOu0zSl9ARVAtBlsSQi1pwgER36zEQKMh/zUPMnws lk6xyOUrVbXCaIH97BrU7k78jjM6Ax/vtgMbKtLbvpocqbwgjvzvjdtQp5YQIt4NMdTg PFGjp/8+It9c1BTidbHI/34XKeFYQP65oJdai93Lz59iPmmuxaJ1RM4V/ZnZRsagyj+p Gh5Reqmqd2Fcr8bkjCL2AMNG1z4IoobvDz884pztbs9kqWlMhxz6d2B81wnreAWKx2NI U8pgAiBXkNPPi5gWzaZdjsQAlsgPHjjUzlFWPmMt9bAk3KzahyanAHq2c4GnbcevvLTs e2zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=E7iKeDCDBZ7LJEqPWQhYyIDhVTyrdGn4l+s4bIfrllk=; b=ltPu2Lag77WGFR7hDVm0OOAC9t1gABisFpseEmlMmvJC2qM0T3sb26wquEW/DB9GX+ +aKZbvN8qCH7/XaX3t8XhqZKxSqrgtp19lpXpIFNM1JHjvFAYaePtVkw4whNWv+ylAwC l1BDtBKqRW+dNUhb4+VUM6WgLhfVGoQAtKtdloWeSCZ2W+VfzvqyH1kvsAOmclTnaJb+ OnflVEt06IlNyOIcTevUWj94SI4t53pk+acPmPKDTBfe4ZXmlt5lr83i7njOpKZlqiXu D9l9X7t0xrGmrGNAxy3mY3Oik/LTJbe07JUZjcvy+nJoFdKWqLMPAchL/f/cmIm2cOPv 0Rog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@malat-biz.20150623.gappssmtp.com header.s=20150623 header.b=1Aow5cj0; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si1478419eda.107.2020.11.24.10.28.46; Tue, 24 Nov 2020 10:29:10 -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=@malat-biz.20150623.gappssmtp.com header.s=20150623 header.b=1Aow5cj0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390927AbgKXSX1 (ORCPT + 99 others); Tue, 24 Nov 2020 13:23:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390922AbgKXSX0 (ORCPT ); Tue, 24 Nov 2020 13:23:26 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B7C5C0613D6 for ; Tue, 24 Nov 2020 10:23:26 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id p22so3244541wmg.3 for ; Tue, 24 Nov 2020 10:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=malat-biz.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=E7iKeDCDBZ7LJEqPWQhYyIDhVTyrdGn4l+s4bIfrllk=; b=1Aow5cj08YgHjdvrfxI6i9PeQ1XPtwW42xCIQbwZyq4KCUWzL0XpWa+Yb5xBaLmxUz 1ZO7scWuu8l6aobb6ihOQQ0YbLt4/WnpCXIrqsygMgCcmNy5tLiMbyy6/SAUvOuk34OW QNVQR0TquV0JjNQV+wVOvoVhTt4lnwgPK4ky54RVfowYjmzFdZ5X8ZnEWCsDlVsJKIb6 Jw10UTliZjx1t23JwpeFUZWyFOoSI9eXx+lnPJrgMqEdA0FPdQiNWUPlek1VbWeipSpC /uG++JyjkdpXhoVqFJy1mxjhKhmPR86kepUxGuhB3QDd3NISvtpALkqhEd7wKRLWVd0Z xZ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=E7iKeDCDBZ7LJEqPWQhYyIDhVTyrdGn4l+s4bIfrllk=; b=ui23lEkeSOuKpX19EUcuKgucPtOx5mDB7q460Nzn0/iRKcM5ZEQWz4LNqJjzmVWoS2 sMSKYRBmEBGfcPTPcRRyFkws017TzFdOS/DejTX2lKRe/TZvuvbEl6w3PFMOLcm4hXnB GwvR1T3VeEnPp8mlOeU68qsKyvvLMAenLzLFt+ubHj69Ot8gJJXCLZ3ln7Zbj9kZc7n/ uLbmgcZtXRtEkNIISr6vfbQqX/I48w5zMGsi3ZIAEej0jrMmPfE3njaGJgGaPIKdiSGM OaRUaEtNP0TSwoAjTGCQlT+8E3YWxD0jdAdEVxy2Kl1VZIopper7gAEuuoXDHNBSKRqa 4uQA== X-Gm-Message-State: AOAM531L8hzSgj6YmvLgFvS30woPRMKEtdEFUdO9oyv1zgJoBTxyjZ1P gBUdLJgi6KxeR9+1YIIsYf8wUQ== X-Received: by 2002:a1c:7e11:: with SMTP id z17mr6002386wmc.83.1606242204824; Tue, 24 Nov 2020 10:23:24 -0800 (PST) Received: from ntb.petris.klfree.czf (snat2.klfree.cz. [81.201.48.25]) by smtp.gmail.com with ESMTPSA id g186sm7414649wmf.2.2020.11.24.10.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 10:23:24 -0800 (PST) Date: Tue, 24 Nov 2020 19:15:19 +0100 From: Petr Malat To: Jiri Olsa 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: <20201124181519.GA29264@ntb.petris.klfree.czf> References: <20201124095923.3683-1-oss@malat.biz> <20201124102919.15312-1-oss@malat.biz> <20201124143645.GD2088148@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201124143645.GD2088148@krava> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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