Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161554AbbKSXpt (ORCPT ); Thu, 19 Nov 2015 18:45:49 -0500 Received: from mail-bl2on0105.outbound.protection.outlook.com ([65.55.169.105]:14356 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1161416AbbKSXps convert rfc822-to-8bit (ORCPT ); Thu, 19 Nov 2015 18:45:48 -0500 From: Brian Robbins To: Peter Zijlstra CC: Ingo Molnar , Arnaldo Carvalho de Melo , "linux-kernel@vger.kernel.org" , Stephane Eranian Subject: Re: [PATCH] perf: Fallback to JIT support for mmap'd non-ELF binaries. Thread-Topic: [PATCH] perf: Fallback to JIT support for mmap'd non-ELF binaries. Thread-Index: AQHRIv3LzTTJ1539QU6YLVJpGvWmnZ6ju6mAgABAzW4= Date: Thu, 19 Nov 2015 23:45:45 +0000 Message-ID: References: <1447960147-2681-1-git-send-email-brianrob@microsoft.com>,<20151119193101.GQ3816@twins.programming.kicks-ass.net> In-Reply-To: <20151119193101.GQ3816@twins.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=brianrob@microsoft.com; x-originating-ip: [2001:4898:80e8:f::2a4] x-microsoft-exchange-diagnostics: 1;SN1PR0301MB1597;5:A54V7qLENcsK1V8aQq3Zx05VnkNM3ej4BI+QdzjS3hwtfU2OTmnzQbuiGlCqZuCCVaGHDn4mpor7x8kJlaJriVsm3R4SPNBmZ36aAMa6R1WqjJsVoiKTuRjFTpHLOPrddFs2w9/6W85pa1P2exPFNA==;24:i6QC7EQiJypbpDByvjFVNwMFyKEM+e5uRfOrwTynJnjc3/obYIGYtA2s6N016Yh65JIiwn37P20qczBG+9UDQPjJvhLSFIgC0k1cjoguqdo= x-exchange-antispam-report-test: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1597;UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425024)(601004)(2401047)(8121501046)(520078)(5005006)(10201501046)(3002001)(61426024)(61427024);SRVR:SN1PR0301MB1597;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB1597; x-forefront-prvs: 07658B8EA3 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(199003)(377454003)(24454002)(10290500002)(5004730100002)(86362001)(81156007)(74316001)(99286002)(106116001)(8990500004)(5005710100001)(76576001)(5008740100001)(105586002)(102836003)(19580395003)(189998001)(586003)(10400500002)(110136002)(101416001)(6116002)(86612001)(97736004)(19580405001)(5001960100002)(77096005)(92566002)(10090500001)(54356999)(106356001)(122556002)(2950100001)(50986999)(11100500001)(5002640100001)(40100003)(5007970100001)(33656002)(87936001)(2900100001)(5003600100002)(76176999)(3826002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0301MB1597;H:SN1PR0301MB1598.namprd03.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2015 23:45:45.7578 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1597 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1990 Lines: 36 From: Peter Zijlstra Sent: Thursday, November 19, 2015 11:31 AM To: Brian Robbins Cc: Ingo Molnar; Arnaldo Carvalho de Melo; linux-kernel@vger.kernel.org; Stephane Eranian Subject: Re: [PATCH] perf: Fallback to JIT support for mmap'd non-ELF binaries. > On Thu, Nov 19, 2015 at 11:09:07AM -0800, Brian Robbins wrote: > > Programs can execute code contained in files that don't conform > > to the ELF standard. This is common for cross-platform runtimes > > that support ahead-of-time compilation. In this case, perf is > > unable to resolve addresses to symbolic names, as the format of > > the mmap'd file is unknown to perf. > I'm assuming you're using PECOFF? Why not teach perf to read those? > Surely there's a library that can parse that stuff, it seems to me Wine > for one needs fairly decent support for this, also GDB (and other > toolchain bits) on Windows targets. > Its just that I was hoping we could move towards getting rid of those > /tmp files now that we have much better JIT support. Hi Peter, Thank you for the feedback. The file format is similar to PE, but is not identical. So, we would be implementing something very scoped, which doesn't feel right to me. I am interested in the new JIT support, however my understanding from the information that I've read is that it requires kernel support in 4.x, though I can't seem to find where I read that. I want to make sure that this works on older kernels (3.x) as well. The reason I went with this approach is because it is simple for runtimes to implement and has no requirement that perf understand the file format. I am open to feedback if there is a preferred solution that would still work for older kernels as well. Thanks. -Brian-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/