Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935147AbbKTVe6 (ORCPT ); Fri, 20 Nov 2015 16:34:58 -0500 Received: from mail-by2on0133.outbound.protection.outlook.com ([207.46.100.133]:37504 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755238AbbKTVe4 (ORCPT ); Fri, 20 Nov 2015 16:34:56 -0500 X-Greylist: delayed 942 seconds by postgrey-1.27 at vger.kernel.org; Fri, 20 Nov 2015 16:34:56 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brianrob@microsoft.com; Date: Fri, 20 Nov 2015 13:18:55 -0800 (PST) From: Brian Robbins X-X-Sender: brianrob@BRIANROB-ZB-1 To: Peter Zijlstra cc: Brian Robbins , 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. In-Reply-To: <20151120193217.GW3816@twins.programming.kicks-ass.net> Message-ID: References: <1447960147-2681-1-git-send-email-brianrob@microsoft.com> <20151119193101.GQ3816@twins.programming.kicks-ass.net> <20151120193217.GW3816@twins.programming.kicks-ass.net> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Originating-IP: [131.107.147.181] X-ClientProxiedBy: BY2PR08CA061.namprd08.prod.outlook.com (10.141.248.179) To BLUPR0301MB1588.namprd03.prod.outlook.com (25.162.214.22) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1588;2:5QcoZnBbzYbpVwehNXLy2U8OBV0GZeQ61FgrbGWld7Lec6tYSW5ZqwxcY48w4ddzWzcJBb6JF2rd3LwVajByURs2ZhQl5i7th7m1++q/3y8X69He1i6hKwHBaOMUc1JMGx/7kKTvrG0JVj8AG7io9w==;3:LVB9Ct1HQG+zManPirZcwy0SyjYwKwJ8QQAk1Gd8J6hnF4OLZphuFcomwGj84O2bQ6HtZYmqv1RZLmMuOOn4G1BQ+8iK6zAFswv+eUfnsAoiaYvBzI+yBL5kGaK/WqEd;25:d0AxaKpF5STY6NaiyC91kAMW4jpdyNNEd6NKdUjKC3F5rat+wWPH3PIh9rqbQO6gap98BxjpAZ+TfzUoy1nLfeAZWmSfzpU/+0fd1RzUaWcnqi3nRxCtc6T8/Cdf3wLQhw5U11Nsf71S58+R7xzdaD2ms0/qYvIB5BNmDef8pXQzvozM3WquhdM4/Jv3qAXNpuSw25qEf2RDmAZxZciG+CHezz9Sx1nEcz4B28b875zhRlzqg3Z8MVkgAkQPey/o3JxhV/+nYtkOl/DOMc+UHg== X-Exchange-Antispam-Report-Test: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB1588;UriScan:; X-O365EOP-Header: O365_EOP: Allow for Unauthenticated Relay X-O365ENT-EOP-Header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1588;20:FGGSsSDeAzOCtiB8tqJfG2AxX1os+ThKFo16Ie2uNS6vU3UX0JelVLSpD5DaUvJ7Jm4+wzVRPBo22a9fFiyWm3bL0xJoxBEKh1slVbr7d2PcaLleOuZ/2IGlU1OMyN0Vuu2ypQ3ZeDSGJtksl/jk1T922Ci0T8hhtUsOsRUjkqfsPiJdbSlOZjgn7TiCLbpjfPFcb+njtfu3C4Abt7yqJMQXiyeIAZJSSlZF2dN3NPEI74b/6/jQxfDuFVvuSo2iJb+HZWhKQDnqpMi0QGb/zlwV9sMcmHBPmxtl3YF61L9v6hNzFfT1UF0dcrxftSZTvI56RyJ46CLeAnaDKJd+HCAuLYLJVktKm6LCOiwm/WD072/vSKncSMLki4TL+PaUh6ycZSAzk6zy6NhwFBzcEwneILvuElkOdEPPYtHARX+5mwMta1VwoBahwfY4IVuasjTPjEUAJyQb7qvoIhwmR+Ew6WERe+kubhXxrqZkFP/kPj7EiFJ9b4w8fTZm6oct2zLTSrXlIEcz1Bzj2/Rzk+AeZW0sMYoGHsw9PFzmj6ocquyVCSIYTF1or10REWOGl50S7KjTzL3jWtd1RHdoEYh+tFD1wBmsJnOiA+2DoTQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(10201501046)(3002001);SRVR:BLUPR0301MB1588;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB1588; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1588;4:kPys/oSelIyEutj1eBGHJphjn1l4qhY5UHGlsr4bdBuIXuyA6rQK9XaGckWcGBfaZfDsK+tj0CFTS+qrXrysfzfGY6DyB4xkTyjHlxuQYIx6zeSKZaH1BIaHlEiZ0Fp6U80QyAGLctsqi0fydd/dVnz3pNuUtwExUt4+YSTmF1V8t4g40c4DB141CO6G0RP5Wpey6Eud7ajUc3AQ+97PHSlo9fFu0pyxtUUVEPwsiUSTcIwx0ZbHQDmWKQurqlIwi49bBzaKeh53UQB1apveimLYaBvEHJnBos6HKfY2BHTZWRza5AkqFxuZcQi1kt1GEAM7BtKUGA3bT2vaE/DYFZG0T+gqKPbouIfbgtavCZvZ3BTFjdn+THZjWQvFYuOgDqAWgrTJrjvN6iqlsYlaDw== X-Forefront-PRVS: 07665BE9D1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6049001)(199003)(189002)(24454002)(86362001)(122386002)(33716001)(5007970100001)(101416001)(2950100001)(86612001)(66066001)(54356999)(10290500002)(105586002)(5005710100001)(6116002)(3846002)(76176999)(10090500001)(586003)(5004730100002)(77096005)(106356001)(97736004)(40100003)(5008740100001)(50986999)(4001350100001)(92566002)(110136002)(83506001)(87976001)(189998001)(81156007)(5001960100002)(93886004)(47776003)(23726003)(42186005);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR0301MB1588;H:[10.83.44.118];FPR:;SPF:None;PTR:InfoNoRecords;A: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ascii?Q?j6/hWPERPHdF3bqTLVLsjdbdsh5rdkMUXHCklIfWHZ2MDQnVPJTt8Za0pI28?= =?us-ascii?Q?LROSylxry4cVech4QyT+VrrBeuUp8AefQ3DXKdrCq380EywI9gp2HiGktgXF?= =?us-ascii?Q?crwiyWWlTyXDWxKR2J80QsdoLsc5Q3bgB4ftnDrGS87zrVe+ws7xlAd8SqXj?= =?us-ascii?Q?Tnjr8GXpWtifJ3+tp3u/w6fBQCbZHV2tLfQSk9mdASarXXQHiURcgitnRP5S?= =?us-ascii?Q?48Z/oSbHZD1yCDaeV8XyAVsU0FnD3cNFkD+I26icXiGv5m5My65d/HG0fURz?= =?us-ascii?Q?+e1OIQjZc8h0=3D?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0301MB1588;5:1JQU8dd+1TaoUDCusK25kOw4Jd/IUPW3YslTD/tJmE/4RJ1A3QhtXI34hxEjHzDhxfqyy3mzfRI4t+vQLqqpx9Q1KSq6acv4u9E0OCIjcRzbYpdHvXtNywJqG7tk0JJ1GlZr0PVeOxX93TPGkuD1rQ==;24:nDOxkN+lZiVD7KflTiNmXqu6QzZsb9zN+NONI+ZRhL322WEUYUr//FzQGH6fp45/Mu8moVjjR1qbNYgTC/JBjEgniAC/1LmtEXmSbsdSPkQ= X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 21:19:11.3435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0301MB1588 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2342 Lines: 59 On Fri, 20 Nov 2015, Peter Zijlstra wrote: > On Thu, Nov 19, 2015 at 11:45:45PM +0000, Brian Robbins wrote: > > > 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. > > *groan* you just had to go and invent yet another executable format, > right? :-) Nah, it just has some extra stuff in it that makes this less desirable - it's technically PE, but anyway. > > > 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. > > As I think Stephane explained, this is only required if you need to > match up kernel and userspace timestamps, which is important for dynamic > code generation, less so for static code in a weird format. Yes, agreed. > > So what the new JIT stuff does is online write 'fake' ELF files with > symbol sections and (optionally?) dwarf debug info for line numbers. > > Since you don't dynamically generate code, you can offline generate > these ELF files and redirect the symbol parser bits to that (we already > look for debug ELF files in various locations), or... > > > 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. > > Since, someone somewhere needs to go parse this funny new file format > anyhow to either generate /tmp files or fake ELF files or whatever, you > might as well put that decoder in perf? > > Or just ship these fake ELF files in /usr/lib/debug/ or whatever the > 'right' location for the distro at hand is. > This seems like a reasonable approach. Stephane, are your changes available for public consumption? Last I recall, the patches were still in review. 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/