Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5254837imb; Thu, 7 Mar 2019 11:11:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxnXtUE6UqZd4PGYi5ofEigylen+2XH2MLMxD/bisD29L4xTRAPYcSCRC1xA5H+0JWk9ZII X-Received: by 2002:a63:ec48:: with SMTP id r8mr12867396pgj.50.1551985867249; Thu, 07 Mar 2019 11:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551985867; cv=none; d=google.com; s=arc-20160816; b=BVRZHVcrBllpmgOvg3YLupqL2U0xSfJR2Otp6YG8LgTdmJvjlvRnACo+/KBSnCBRTr 6aYGHxQ8tgut9K8NdGfv9ap/HH5xEnobuBobr1ATwPwLFIKHNJvHeiGa83TndYH8J+LX 12BQOpL6cLdi1/vgdCvz7xDbgxz/u07iwoHutQ0QRJpFE4mC4G4WvbLz/dIBWUdJ1tgE uFJZAVOEItORTpL356TTw++iyZYA38l1pKKZ9sASg4gYhpn+gAyZtPq5ypQaGVYTs0k6 jByRs9jfLNLbbYKwQfp7ewZeVbE0HaTKk/m2/NzVMdQHNLD/xlnYFgkn/lQgY5xEj+0I sGMg== 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:from:date:dkim-signature; bh=mxFlzTNt3wJiRaEad4nwKcFwdG2EvyPx7miWRqpY+lY=; b=AiYENMX2kpjo/1lgAbW9ds+U/X5OJgzduMk4y3Ha2MWqp1N/PFXpJaaj2h8Q/Rjlj7 28ytOYIIu2uZCZ7ydChatauWaLLlQS591LNqvj30WbfvLUghbYOoXUyEPXEYsTVLwUv0 E/mH2T+ux7SbplR8ni8xbUa/2mAeBYH0hTbyKzylLeX1N8jEAEvuvkINWHc98c4lcNWx lpsMcHDhY0SwwJjZ0uWFA2YXjLLBA+sOZtw8xCPzjqm4XeRvte+tH0KTLNmE134Rb/jd doF4aPYcTy2U4i+UW3C715mB8mNpqWrpBmG+aXmzZWL9BiwwRT93r2CaE5+6UVtiR0oR DPGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dcODIuvO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p10si4497054pgl.186.2019.03.07.11.10.51; Thu, 07 Mar 2019 11:11:07 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=dcODIuvO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726727AbfCGTJ5 (ORCPT + 99 others); Thu, 7 Mar 2019 14:09:57 -0500 Received: from merlin.infradead.org ([205.233.59.134]:55734 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbfCGTJx (ORCPT ); Thu, 7 Mar 2019 14:09:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mxFlzTNt3wJiRaEad4nwKcFwdG2EvyPx7miWRqpY+lY=; b=dcODIuvO1gM+8iDwQPBYpKQqX ihXzhuX2dgRjoE16OnDOi1kobh796TZx6SyX2RVY5FN8lLrunxMZIqMU91ZdsP7mHrGIXmVH6hEnW ItSQEyTeAtTjyZ8lHmk0WpXL3Z13z51EGLB/8CAG8/VstMvxRZKQZD++n1kyT+nbJcBDtsbnPM4DE d+XXE7yxhT512scbREIZBwwWE7Pw1qvaAF75NVJJt63Hirl8oqTIaioA9ERz/IZj3waIOZIcE7Kv9 svRn30bqR6Cx1+gmW/XXLdTEV/U/iZTIYG0WJ/M2QLjErp0ipNtkJY/ygeASheAfEBTzHvC3SfHr2 NUZG+iBow==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1yOj-0000l6-PR; Thu, 07 Mar 2019 19:09:42 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D59049837F2; Thu, 7 Mar 2019 20:09:39 +0100 (CET) Date: Thu, 7 Mar 2019 20:09:39 +0100 From: Peter Zijlstra To: Arnaldo Carvalho de Melo Cc: Stephane Eranian , linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, mingo@elte.hu, jolsa@redhat.com, acme@kernel.org Subject: Re: [PATCH] perf/core: restore mmap record type correctly Message-ID: <20190307190939.GB2482@worktop.programming.kicks-ass.net> References: <20190307185233.225521-1-eranian@google.com> <20190307190330.GA2443@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190307190330.GA2443@redhat.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 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)