Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2232078ybg; Sat, 19 Oct 2019 10:50:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpYPq358ox70e0U3/DNwpDzELp/ceIff+paONI1TIqWdePourjEKe6xbgHudrA3i0w7uGx X-Received: by 2002:a17:906:5051:: with SMTP id e17mr14053343ejk.139.1571507404089; Sat, 19 Oct 2019 10:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571507404; cv=none; d=google.com; s=arc-20160816; b=bbDnqcrS8ZfFGtpGCyFr1ZkyrJD+/dJ9oek+5Ok63FCMXrb4R3ujFu61b9buVSrrab 9YLb502AztMnT41O1oEUlhFM+5n4sNriimYI0uDg47dhdCTF1Ysus+/Hx5kX3/znBt5N pbaiOo2mAHP0S7rEeI8Cs74sxkc7AxhxGjzuGg6mTlnh/eAtGWHQyhw+xtH3WK4qCcuM KULjvrwdKSa3cNUP6gHEgJzJJ2/dNWkHiInaFDZEw6SzKs3EssBsWrn/5LlrcR5Tmeo6 OYvYrzCDvfnE9RkxU+fa+RTNCfon0L1xgcxLzxGTeWKB6/BDjTDJ9FVaNzY6KwiIez3T /sAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vZdwEj7cPSAel4SZdlpSMvftLlMkdlo96xYd1wqGr2Y=; b=01UBo7FcBWMSNt/aUUTgJRi2O1kVGmYPAvAhRkbACKAENz/VuY4Mt9073xWFS/HhF0 0HGM/aJ52feU3XoXE+iK7QH3W91QpYeAATX/TeasLtltDF3WZRSvvSyXFg1xFRtMaC7b IUsAgPfUqf5pQqJ7IojhNjZSVPQ8kxCed3b9zlD+4GnmprbNHUVAlAGz/ymjyiruifGg OG8pK2zGR+JcKdZnXJLzTH3zke+RbRsaH3IQxdY58FJoiWsOeOTyVVuNktmHx1VS1B1V df/dYUkNvTHk1nJF3Fzrbr3kIzy6DoeMAtYe5xT957gsqhnFWXfglGKzwQQiZVrEw+Ko yuAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Axjl9NCq; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si1026915ejx.352.2019.10.19.10.49.40; Sat, 19 Oct 2019 10:50:04 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=Axjl9NCq; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726167AbfJSRtL (ORCPT + 99 others); Sat, 19 Oct 2019 13:49:11 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:44923 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726049AbfJSRtL (ORCPT ); Sat, 19 Oct 2019 13:49:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571507349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vZdwEj7cPSAel4SZdlpSMvftLlMkdlo96xYd1wqGr2Y=; b=Axjl9NCqdGrkxf9hu2cZ7nwq0BRXzMBy+2OBAoGjNQUCRoCD8hs2d/EGuWrLknTja6QOx2 +ugkKrXZv0J+LIfKrKlsKbwHU0j7v19aUxTf+9BqBUywOlCMHi/BnzoOU0u6+H+Eklu6wP 0MP2D9pQUGk+h36lqu97X8kbvtrxd1k= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-224-AjFTUP5VNkKdsxK9GMRXKQ-1; Sat, 19 Oct 2019 13:49:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F20F480183D; Sat, 19 Oct 2019 17:49:03 +0000 (UTC) Received: from krava (ovpn-204-36.brq.redhat.com [10.40.204.36]) by smtp.corp.redhat.com (Postfix) with SMTP id 507E01001B00; Sat, 19 Oct 2019 17:49:01 +0000 (UTC) Date: Sat, 19 Oct 2019 19:49:00 +0200 From: Jiri Olsa To: Steve MacLean Cc: Steve MacLean , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Stephane Eranian , linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND] perf inject --jit: Remove //anon mmap events Message-ID: <20191019174900.GC12782@krava> References: <1571336600-21843-1-git-send-email-steve.maclean@linux.microsoft.com> MIME-Version: 1.0 In-Reply-To: <1571336600-21843-1-git-send-email-steve.maclean@linux.microsoft.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: AjFTUP5VNkKdsxK9GMRXKQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 17, 2019 at 11:23:20AM -0700, Steve MacLean wrote: > From: Steve MacLean >=20 > While a JIT is jitting code it will eventually need to commit more pages = and > change these pages to executable permissions. >=20 > Typically the JIT will want these colocated to minimize branch displaceme= nts. >=20 > The kernel will coalesce these anonymous mapping with identical permissio= ns > before sending an MMAP event for the new pages. This means the mmap event= for > the new pages will include the older pages. >=20 > These anonymous mmap events will obscure the jitdump injected pseudo even= ts. > This means that the jitdump generated symbols, machine code, debugging in= fo, > and unwind info will no longer be used. >=20 > Observations: >=20 > When a process emits a jit dump marker and a jitdump file, the perf-xxx.m= ap > file represents inferior information which has been superceded by the > jitdump jit-xxx.dump file. >=20 > Further the '//anon*' mmap events are only required for the legacy > perf-xxx.map mapping. >=20 > Summary: >=20 > Add rbtree to track which pids have sucessfully injected a jitdump file. >=20 > During "perf inject --jit", discard "//anon*" mmap events for any pid whi= ch > has sucessfully processed a jitdump file. >=20 > Committer testing: >=20 > // jitdump case > perf record > perf inject --jit --input perf.data --output perfjit.data >=20 > // verify mmap "//anon" events present initially > perf script --input perf.data --show-mmap-events | grep '//anon' > // verify mmap "//anon" events removed > perf script --input perfjit.data --show-mmap-events | grep '//anon' >=20 > // no jitdump case > perf record > perf inject --jit --input perf.data --output perfjit.data >=20 > // verify mmap "//anon" events present initially > perf script --input perf.data --show-mmap-events | grep '//anon' > // verify mmap "//anon" events not removed > perf script --input perfjit.data --show-mmap-events | grep '//anon' >=20 > Repro: >=20 > This issue was discovered while testing the initial CoreCLR jitdump > implementation. https://github.com/dotnet/coreclr/pull/26897. I posted some questions for previous version in here, but can't find answers: https://lore.kernel.org/lkml/20191003105716.GB23291@krava/ thanks, jirka