Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3457638pxu; Mon, 30 Nov 2020 03:43:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2xoWQlcgdpRQ4yC0bBlijCHpg+YPLFk6dgSoLmhzCW7HQZ0iyScsLDD2Od8+jWrv39E/T X-Received: by 2002:a50:ab51:: with SMTP id t17mr8243536edc.89.1606736621598; Mon, 30 Nov 2020 03:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606736621; cv=none; d=google.com; s=arc-20160816; b=O0/rBMb22lL8UxKVsSUx3nNrlJRu+rfCELT7uiXt1mYll+CBFc2EjqapYTTWrKjpYU niNqAjpsHM1Tvy1X3Y8iB7D9b0LESXB6pK5uH2fBJUAJ7uQbXmJhrxTIpLI75SxFh3Ym 1HnaCDmWu/Y6gPmVMkCBYl0+xys//rkjGWnTCX+EjAaSs2jmygJbJmE4hF3uz59KXWIc Z9dH6Il5ogXZT3h4JOQOfy3s9+b2H6rKFHzuImV7dPIlbFbKbtudmroPVqUY78/X7H10 6SSnj/GojzeLx+EUEFI+dGO6bb67JJ2TkHjZJ4cXfSRVf9jWAe6gCQC9WYBY/AQT2cHP vS5g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RKiITCXuJcTGV6hXTDksrqg/arpEfBV8bbz5G97muVg=; b=L7vS+w1OxMGgPzb/AHobrP6zjjjtxGw+S9GxM/7yw+0ZFQVB/zkYkuO15+5/PJxhEN T56yp52Gyhp7A9OhB1agtjqj25uTLdnsHy+rD1cp/boWp31owuQ1s4gZgeOok9SwZQ2f tBpra+vxgWr95FPUbQ04Lzx7JlXuACsms8lGNjHhLhW+TOXx1TbUofI0AUHziZYWqQ1f 1CDbC/5JQnHF0uvgwYJyQdB6cq6MoOeZKFJizgwfcEeArbgAvCMbKM+tIBwDVQqTwLxZ ZKjRRfKaYKJ/HQ7QJBJyy0ihaM1rbrAUIM3UsJcEvZT6FOG4ch4A0OK73hSsb9UXwsql FX7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@malat-biz.20150623.gappssmtp.com header.s=20150623 header.b=cscBK8qG; 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 u5si10593569edi.314.2020.11.30.03.43.19; Mon, 30 Nov 2020 03:43:41 -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=cscBK8qG; 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 S1728459AbgK3LlP (ORCPT + 99 others); Mon, 30 Nov 2020 06:41:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbgK3LlP (ORCPT ); Mon, 30 Nov 2020 06:41:15 -0500 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F6CBC0613CF for ; Mon, 30 Nov 2020 03:40:29 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id y22so7394447edv.1 for ; Mon, 30 Nov 2020 03:40:29 -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:content-transfer-encoding:in-reply-to :user-agent; bh=RKiITCXuJcTGV6hXTDksrqg/arpEfBV8bbz5G97muVg=; b=cscBK8qG7eZusLB1ds7dGjaTAyfQIHx6lmfKkrYVDTegEOHOgBgEYrsXplIBPrX2hl oWqFKqfwrRAuFOOPJHseKYO8UQVgm9iduC4HuikcfbfsURM80s569FC1zVdcrUTlMLP+ 82/QdOWTJcJpciXq9y5ZgEhA1DbzX74WosZ7PTpdDXi0TAxrzgyctRQISOcBKkLxn/6J TN9jzvgMX62Bvhv+fNf1yVk8AZCag5zv0oT6cKCcAfXOPsemGwurTiGfYqgTSdr8jSUs ZsGfwhur//3LYpLWCAFszBM1f0mfP/aLJ0mGG1C3si0z/wJ62QZcRPD+7o3E0Fl5RCSl 3n/w== 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:content-transfer-encoding :in-reply-to:user-agent; bh=RKiITCXuJcTGV6hXTDksrqg/arpEfBV8bbz5G97muVg=; b=HYdfnSGhdpFkQr4vUMb2Czlp9wA4P7fcSO2tUlK5ww2oQ19Iqewta7zsWzjuNUla3u Du+L0JR9ZFifIgOCjI1tIKPbNMTNRf3W2fXRHSDr1uajSDvtEKH0eOx891uJEFpTyQCF gtc3JB+HLaqNh1ZgLgAtb+8LaAepq1Wk4/W5Y0HYT+ee21ITWjuSBqanHfSo5Q1RjX8u aIf6ZyBevYXudyfV7V21Gh87NhbeZ5cGfOScvUUX46HmRZ+y8XZdhxC8tI3ctRlfE3gO 9bI6R6/Keugyda5cVpJBf/aWCkTz/4ELauYtPl+hrf2Knkgl+X+6txQSSxAXhXKs5FL6 VOfA== X-Gm-Message-State: AOAM533KXdAC2XZW3tN41H6/WyeNTf2ntBObeqaD9fQar0jge2thLyMQ POC0IsZ+GozyWyta8eSAohp1/Q== X-Received: by 2002:a50:8a8b:: with SMTP id j11mr6087629edj.19.1606736427756; Mon, 30 Nov 2020 03:40:27 -0800 (PST) Received: from ntb.petris.klfree.czf (snat2.klfree.cz. [81.201.48.25]) by smtp.gmail.com with ESMTPSA id s19sm5155013edx.7.2020.11.30.03.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 03:40:27 -0800 (PST) Date: Mon, 30 Nov 2020 12:40:20 +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: <20201130114020.GA29476@ntb.petris.klfree.czf> References: <20201124095923.3683-1-oss@malat.biz> <20201124102919.15312-1-oss@malat.biz> <20201124143645.GD2088148@krava> <20201124181519.GA29264@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: <20201124181519.GA29264@ntb.petris.klfree.czf> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiří, were you able to reproduce the issue? I may also upload perf-archive if that would help. 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