Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5265972imb; Thu, 7 Mar 2019 11:28:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwTPAiiCOnvEhwj9GUL9ZW3KVa/s6WpzIYk5IzG9Pn/QGljOvaCgeYJhcg3Tase8zUfnGp6 X-Received: by 2002:a63:6a88:: with SMTP id f130mr12719732pgc.114.1551986898365; Thu, 07 Mar 2019 11:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551986898; cv=none; d=google.com; s=arc-20160816; b=fIoU7I/ftrrENIpIN0RbfEONIQFMzjdeI4JXtE7D8ya/C7uiCPgsvkItFydhP4Vve6 FSQ6pwhvvBMcV4Y8YMQPY9FOS3hWiQyZLWdmneV2H9jifOJ6OhW7axZcEOrzSeAvAess MTrnwqLLqysHbxN1p9jgv0mOYDvAwY3diJ8Ie5J9BSIePEW2LGZMlTV9E+D00Mena8Rg Q1datipPTOqUgtCNtc7i5s4C5KnmpUZccZYWYcDfqaTL9m8aZcI1N98e0HEAJ0+Y4hg5 WzQrlJs9MyTXybJVeDSWSi73eDGtVEmW6Vcgt6SP/3oRlQgjtDj2CmJ/Dp6KXnF/212e JyWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=1ECZL/6jNpXi4CYh4Zb34bs84OJAMpygWEY4WobMUoU=; b=rtc8AVYXhOHjHJG7wCQNks1HLwhX1/xTpJe+cTn3sbyNMcaIDce8X+18eAgHrO+WX+ rAxWFjYXENXzTMuTn0MZk7vAwM7qYJX7zANU0iahH441y0dW5idqqTyyGFUYdfNHKMxL GwvhoSg4qJlOspBDyKAbU0ZWqvdMCHEXH1juH6oS7wGvOEFcgrg7Jke4vgKM1HltWzr3 B+I10coT6dYSHyyy3kttGu6j853bBqtTKI+SRZHtBnj7sbfOhDpyFhYx5bppShbMvrUA 3PlCbEl6rU0EYyQjhQ+bkmo0htnBhCATfYWSSXPvUMGviQcQ3r1q04HW516s6mWW2HpS h2fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kSrli250; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z31si2188600pga.227.2019.03.07.11.28.02; Thu, 07 Mar 2019 11:28:18 -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=@gmail.com header.s=20161025 header.b=kSrli250; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726520AbfCGT0q (ORCPT + 99 others); Thu, 7 Mar 2019 14:26:46 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:33035 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbfCGT0p (ORCPT ); Thu, 7 Mar 2019 14:26:45 -0500 Received: by mail-qt1-f194.google.com with SMTP id z39so18508802qtz.0 for ; Thu, 07 Mar 2019 11:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1ECZL/6jNpXi4CYh4Zb34bs84OJAMpygWEY4WobMUoU=; b=kSrli250pDd2qRsUiiFqvjcGP5odUalygKEeW16TNAypPQBEyd0+auB6zFB7zOw6l3 dO7TsUL8jkeqQd11Q0+bm3bCfQr/L7pFx6iC+cBl+fvwyazLQ3kdpfigtIem1IFjYEAH jEbY1UEHgSFRpsNQ50CeoAyeWSQNQColujClyaThn4QyQmb3cJxhW7K6x54+pwjH3IIt c2PP6XjUmUTh85DuUkM9mcyycYB7yhjVSOJw2XKP5DVQ0LttoZIsRFWvhBYgzcqqzQxJ yBUEkk3dx3fLsz8RvjdVeFnA0TtrDjixxyca4hi8qhR7pwPYyHf7PaSdX+ju/Rcudqgx C7TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1ECZL/6jNpXi4CYh4Zb34bs84OJAMpygWEY4WobMUoU=; b=YNfKg7Y333K82ZZX82ho8UTscU4drbtWkuXYP8c8wix68Cckp3HfsqowDuunbgx3+y s5hVJbTVOiZQG9DCNP/uRSnE5m2RoFYGwVrgXUZ0JrOMDx8+eg1fgMROaCRiOk6QQIg7 kcXLkmRGAKTa1OFkl6gJGUUcJPyKTSNGhlpUpC54gY90vc/qrwHpgto8138gjoubgcxQ 8UidUHc0YbyAtD5mc5wrRMXFvXnVKe/MgGkZm0Gd71JhxpT4IqKt+1ebbyPwS0MmBLKx mVcKGS46mX4mOWxs0gksYTDgo248BTfYfqd6xEnXb97nJxURESxByvK/F8ol3E0DQxYz ofww== X-Gm-Message-State: APjAAAVlbkTxtxCRVjIw92c5cY6hN/BIS5L+f+CuI3joBrqF1kZTzlWG M0w7bCKtC7Q/fJPy6QwWbN0f3A/46cQ= X-Received: by 2002:ac8:3718:: with SMTP id o24mr11609105qtb.2.1551986803879; Thu, 07 Mar 2019 11:26:43 -0800 (PST) Received: from quaco.ghostprotocols.net ([190.15.121.82]) by smtp.gmail.com with ESMTPSA id w1sm3232806qtc.75.2019.03.07.11.26.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 11:26:43 -0800 (PST) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BC3434039C; Thu, 7 Mar 2019 16:26:39 -0300 (-03) Date: Thu, 7 Mar 2019 16:26:39 -0300 To: Stephane Eranian Cc: Peter Zijlstra , Arnaldo Carvalho de Melo , Andi Kleen , Kan Liang , Ingo Molnar , Jiri Olsa , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf/core: restore mmap record type correctly Message-ID: <20190307192639.GC32240@kernel.org> References: <20190307185233.225521-1-eranian@google.com> <20190307190330.GA2443@redhat.com> <20190307190939.GB2482@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190307190939.GB2482@worktop.programming.kicks-ass.net> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, - Arnaldo