Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5267621imb; Thu, 7 Mar 2019 11:30:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwpLGMM7IQUzO+/DqgAIAjucNLkPR9gtCa0twVm6aofYmSMCZofDPMrzK8C1xY/O66tV2Cn X-Received: by 2002:a65:568b:: with SMTP id v11mr13188503pgs.23.1551987047930; Thu, 07 Mar 2019 11:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551987047; cv=none; d=google.com; s=arc-20160816; b=PY0lXLkvzWAjfkTl6ZcRiTd50BZY+YQqi+28hI0kPnLd1HJRjO3w4PFiHkZ6Hd+jmB AKEjLiqf9On94LXkYiLTiGB1STIzosVk3vZkp71xuALJ2vJwtOAuA2P//CvlG3eYfgZp LXNhqaR8l73cCUlAAU0vV4KrgS5H5upNwawLpio8ib2eLKjN1nqqmrWfC9n7eVtAlheY MZ55q4Gzdat1KkiKx+SVvxiBzVq7BuZfdevKf3wK3p/9zESW6X4BLTluJLzqXzmZHKzu 2AZGBG36nDgfkr2vyeH0BVB6GGkk+MN2zQWWy9wgeAxK8YEiCrpE5H7UkkyIfx2YCeLp oKhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Po4Y3LvF/PyatrV7fJdN+mqG0B1DU+Pvrq+pWZeUIu4=; b=hZ5pg/imkLD3rHlTF8DydFSL4rp3yYBFsecOn1amhzXYr+wABd8iRDtnpeD+P8jl6v Umd2T65d2awspri8NRpK0bTg8vInDpD7FSKaBOGGBS3S3/ZqfH80uuy1Pl4cSSun56IB x/sbAOrngxfZHpNJEuhXyjb7Qii8JVxBG39ZzTY/2lWbB6Z1+VelyUHqpP8hb/o/cIsM vJU3N5gYBgfYIxLuhuHcoFN54LD5vCJAXOEig5kmICqy9XifFVmtwxvGmlN3jLsFwTvA IrOM1EyL6z9JybiHZEnTcdv+fYmEEsOsYNfeEmZKGGPP0MAMnJIFwomOHWJsXVspfchK PbDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="RgKW/5A6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a72si4886542pfj.216.2019.03.07.11.30.32; Thu, 07 Mar 2019 11:30:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="RgKW/5A6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726771AbfCGT2k (ORCPT + 99 others); Thu, 7 Mar 2019 14:28:40 -0500 Received: from mail-vs1-f66.google.com ([209.85.217.66]:43489 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbfCGT2k (ORCPT ); Thu, 7 Mar 2019 14:28:40 -0500 Received: by mail-vs1-f66.google.com with SMTP id i15so5213417vsd.10 for ; Thu, 07 Mar 2019 11:28:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Po4Y3LvF/PyatrV7fJdN+mqG0B1DU+Pvrq+pWZeUIu4=; b=RgKW/5A6CtqC0jLByDN2rcr142CY0ZO78VWewTWA0nT0OUix/0nDysC/cNzJFtM7aP bYgfPO1KWczQI+MpvA3ByYzZVig8Az6xZ/OJ5Opkws0yW2nUUjh5MfIWdwE6RKpUmh6V KYqZfB3i334RI27kJ82Cg6xqL+MG3ZzaJRKSSfq8I0wUdWUslCa18piYeQGVm01WNuuj Jm8GfaQXVRqwkwdtaeadOI6Je/15Gw5RnlsZ8ilslzxo6k6zqfzc1uTDD2ao9K4YTVwK bzinl64yI66RJhXpiY6oTbJKSKU8vAs4aF8xSdUc0rKcsdjAXveBvnZcnOiXgCw4UdkW G+Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Po4Y3LvF/PyatrV7fJdN+mqG0B1DU+Pvrq+pWZeUIu4=; b=eUCEXwqj4p4W0iyOR6LcL0nUDTfARrHcRAvTbcVL6kuZeK2FNCsLJdfzqq6l7HqmpI ePsg53FwcWtNHVBNQ6btV4G3Src//vo5YIbWyzhtEwNzS2tqNGIM34vDaY9JnXomiTgJ tc19o7c1xiInz5WPA4LRbvEAbmZzCum3kbIU1t0Kp0EJytwiuCFG4Hs/H0Hrn7AuD4u2 pBVr2Hjx4eHliWEPodW3L0pMUl1624PtmgorDzJ40dMsX1Pzd97sPP8pKYdwVTxX+fxu /fsT8C2Eoqv9YRp3NrF0QdJYTlfvJ3AVh/XDO/qHvpf3+7yEtilalwuhAR0r6b76EQaM rEoA== X-Gm-Message-State: APjAAAWiXmRX6csbAQmv63+BJ494lCvWlDD8tYdCvoGAWzaiNIwjrWd0 GJg0JAcqfytpy9Yw5rWSnK3ZAYgvT0B5q6bAcK593Q== X-Received: by 2002:a67:ff07:: with SMTP id v7mr7890235vsp.231.1551986918283; Thu, 07 Mar 2019 11:28:38 -0800 (PST) MIME-Version: 1.0 References: <20190307185233.225521-1-eranian@google.com> <20190307190330.GA2443@redhat.com> <20190307190939.GB2482@worktop.programming.kicks-ass.net> <20190307192639.GC32240@kernel.org> In-Reply-To: <20190307192639.GC32240@kernel.org> From: Stephane Eranian Date: Thu, 7 Mar 2019 11:28:26 -0800 Message-ID: Subject: Re: [PATCH] perf/core: restore mmap record type correctly To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Arnaldo Carvalho de Melo , Andi Kleen , Kan Liang , Ingo Molnar , Jiri Olsa , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 7, 2019 at 11:26 AM Arnaldo Carvalho de Melo wrote: > > Em Thu, Mar 07, 2019 at 08:09:39PM +0100, Peter Zijlstra escreveu: > > On Thu, Mar 07, 2019 at 04:03:30PM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Thu, Mar 07, 2019 at 10:52:33AM -0800, Stephane Eranian escreveu: > > > > On mmap(), perf_events generates a RECORD_MMAP record and then checks > > > > which events are interested in this record. There are currently 2 versions > > > > of mmap records: RECORD_MMAP and RECORD_MMAP2. MMAP2 is larger. The event > > > > configuration controls which version the user level tool accepts. If the > > > > event->attr.mmap2=1 field then MMAP2 record is returned. The > > > > perf_event_mmap_output() takes care of this. It checks attr->mmap2 and corrects > > > > the record fields before putting it in the sampling buffer of the event. > > > > At the end the function restores the modified MMAP record fields. > > > > > The problem is that the function restores the size but not the > > > > type. Thus, if a subsequent event only accepts MMAP type, then it would > > > > instead receive an MMAP2 record with a size of MMAP record. > > > > > This patch fixes the problem by restoring the record type on exit. > > > > Right, simple enough, bug fixed, Peter, I'm taking this one, ok? > > > Acked-by: Peter Zijlstra (Intel) > > BTW, added: > > Fixes: 13d7a2410fa6 ("perf: Add attr->mmap2 attribute to an event") > > For the stable guys to pick this up. Please try to add the fixes tag in > the future. Ok, thanks. > > > Thanks, > > - Arnaldo