Received: by 10.223.164.202 with SMTP id h10csp1640694wrb; Thu, 23 Nov 2017 22:33:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMYM0ZqOSMkTDViZ/VD3PVPVclVlRQ//mLBr6TpYouajPMjhLQpS7CS2XwZxdgTAmmBvGNnU X-Received: by 10.84.135.162 with SMTP id 31mr27633206plj.23.1511505198130; Thu, 23 Nov 2017 22:33:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511505198; cv=none; d=google.com; s=arc-20160816; b=qk/2p5lGhDiXghwZjLCbldSV5HE1okNO7+OzdCSJt1yloDywC53Tn9hU4zWC4V+/Uq fmZx0v5xSppPupAuYSulx6uDBXC3neNDxKl69KrSMi83F3EcQRNT5LNVeI95ckdByPj9 ijnpJENbAr+F7IzRimLfZMW4rtEh5d16DptdL8H1pUkxfiH37a+K0b9Okom5KuMady0q nKerSeZ0p3L0yv/ibVhj+J7ZyeoKytXDJJpeHbzZzCMiIrIlfBDbEiGRTfoXQzF1q/MF P/YbtFzAWg99QoslAIE7eAaPT8K+n1hHg26YYZyx33b33TqAE7S1fqx2EenLOOL8B5/s q3jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:dkim-signature:arc-authentication-results; bh=y82XHBTtWQvkbYrN0TqVzJk8l+BtW1C5SQZqnGno2sA=; b=YttCuOSr8r6eGEN59nhtMQ6he+3eyMLRGDx7UXzLlUDtsEf6YveUEaaqGbQhoL8v0G +ln1lHwexvhLcTz50YHl0sxJUEe10uxP8aTt7X72ngba9Jf30DFiu/r+TezNqyrSiMJy 76mwa2yesMRUDQtVpSy+6YoAND40qtAIBZgmR6lVuV+K0c2bKSVkweL7Jo/iF/4PaIkZ GmBnkDsE9Ddd7rsKgRPS1IxY+8cRGBM6Kmy4v2KjGzcwFsebr1iB/MCDiz2dJ5Lbi1xI QVxXpqctH8vBfiLmDoflHiIU3GzylONDNgOwkm//fXJWqHh+kID9TmFvbjMoNxTNkGXF eV4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=aWyNj77z; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=HOZ20REN; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si17070259pgp.140.2017.11.23.22.33.05; Thu, 23 Nov 2017 22:33: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=@fb.com header.s=facebook header.b=aWyNj77z; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=HOZ20REN; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbdKXGc3 (ORCPT + 76 others); Fri, 24 Nov 2017 01:32:29 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:43452 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751241AbdKXGc1 (ORCPT ); Fri, 24 Nov 2017 01:32:27 -0500 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.21/8.16.0.21) with SMTP id vAO6RDNp020564; Thu, 23 Nov 2017 22:31:41 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=y82XHBTtWQvkbYrN0TqVzJk8l+BtW1C5SQZqnGno2sA=; b=aWyNj77zXQa/jNZO8rUm4XkXfdsVPAvoiWwoxo3uPI8evUwph+tqYMU0E+NchNRycQr9 b1fQLKw+iTkMNmx64IH0+EY7ZsmaqLjA+AWGQ5LlJvuKqx60I8jqXupb6nnlMG9/slwR umk9QbZZ/IvDl8dEVqt5HNZ8RUasLGLhtb4= Received: from mail.thefacebook.com ([199.201.64.23]) by m0001303.ppops.net with ESMTP id 2ee9av940t-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 23 Nov 2017 22:31:40 -0800 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.22) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 23 Nov 2017 22:31:38 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y82XHBTtWQvkbYrN0TqVzJk8l+BtW1C5SQZqnGno2sA=; b=HOZ20RENJQygCZr661l1a/EFD9WoajRoLACWqzx2wnqKFkO1vlHh28sLL9qRp2Ptpy8AJLFHrl+1hgVCu3NmMkX3ZPoIZJ9W4+hDG+yYS0uo8AMKBkkotF0yqlL32NLTOKbBbotsXH2dk7iYjGb6d4FRlu2ovnmFTPPJnC3Tn0g= Received: from [IPv6:2620:10d:c081:1131::1131] (2620:10d:c090:180::1:b0eb) by CO1PR15MB0965.namprd15.prod.outlook.com (2a01:111:e400:7b64::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Fri, 24 Nov 2017 06:31:34 +0000 Subject: Re: [PATCH 1/6] perf: Add new type PERF_TYPE_PROBE To: Peter Zijlstra , Song Liu References: <20171115172339.1791161-1-songliubraving@fb.com> <20171115172339.1791161-3-songliubraving@fb.com> <20171123100214.qm3s4h5b6i4r2iaa@hirez.programming.kicks-ass.net> CC: , , , , , , From: Alexei Starovoitov Message-ID: Date: Thu, 23 Nov 2017 22:31:29 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20171123100214.qm3s4h5b6i4r2iaa@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:180::1:b0eb] X-ClientProxiedBy: MWHPR06CA0017.namprd06.prod.outlook.com (2603:10b6:301:39::30) To CO1PR15MB0965.namprd15.prod.outlook.com (2a01:111:e400:7b64::23) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603258);SRVR:CO1PR15MB0965; X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB0965;3:7QD391o/l0UcLvQyvDITzZQywAJXEsuLdH46Y2jfT2oBVOm7ZTPxBnTwWwCXU1MvsQLkxF8xZ4lKD7gzD7dlJ5Pg7WAIUnqFL9aFp0jz1NuGH6pSJdIoCATKphmsem7a7d6DCMjAg2k5xPaqsr9UAP1pUhDo5I9+0bjcE53XUxACBXYu3k91yFqWGJI9BGHX1KzxWEb8HZRA/TKs5aaNcTwp//2FYlJhC9YN4F7aGo0vwUcg0xZ1kzbET5fn6iUj;25:xG65e0VwTCO7zR33GhXGo8rP557NaojI1+iHoLFGZVOC1PkvHK5oqmEOsSsLjsfNIgIqTdQtM+Yiwa4LTH7l6SnOaaAORQ1oaniCZZnsx82gq7qK1BhGqal8SE4iekToLwd4ZI0aXGhl3PU9wcPI1yWmuIHK5w939R10tMIuI+uBLdgJfi8Z4Buns9OAWVQA/O8t42fUVVKH0mXzXpQS2I75uwOXe0XQ0MEWN9qyUU25vgStoPSf3XYOJUcZqqEjRgmo2SXDXQK0bNzjRLETG0Bm5fsR6+WjYfnQ8b8BtOZT31LxUgU2bDXCOf9oTu+HOOuiCWrX0ABeImT6IgPI0g==;31:a7+h1Zdi6IEV7KfDhYWqpBExtfcJ5kQadfBBEJEgL54bdqzPORk642ca+vNpGBa1leZicJ5hqzAYIhvFgyZLa9sXEHIpyEuyHUWfz06YNyd576nRM580EVvjcfsoNatxURrB6jvHKFbL4v9x9bwZcka2rz/6WWXeljzRng8r515MIWSTUFDPjPeCWnTZnXc3hqHlbxII8zBV2CXb7e7j9V0Rh5KaUMM13JVj40Rc4ds= X-MS-TrafficTypeDiagnostic: CO1PR15MB0965: X-MS-Office365-Filtering-Correlation-Id: a8837498-b81a-4c99-538c-08d53305026b X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB0965;20:9PDbRjBIJdMZmfZqHzluK0vABV1NGw8XYB/4dvOz4qTonzpSqRYIyZGstKRnsKrWZ//CErzQ8tTYj1CWUjECV3EjvoTFEbTf/oVdMfuc6YibQASuyYirDgdaZOOw9crnfOP3gInQxoBqdgbiXhnhwi+E+PhkTuxdDV2J4DrNOVBvMhPnijIxW71mmJjpZEegI4gm6mQwDlFz9so7Kt8pvATzLwOz9RrBgSaY8g56RLcjl+BUfpYDqxoacbUCsyynsVCwpP9rnZ6ZvKwq72RdxDtZ6zJ6Y3EbQgkqYZqwrDcSVpF3SR7CQsQdxMzgAzLiEBbvXIdNsaT4zKbJloxGNGpNgvJiuteGLGAjznw+qufVLexXw6bhQ8PaX+gLLJCEMc9IlLmK0ZNXMNut+87QPjpXNx7r3bMPl6gjJ0WHo3S7hYdK3Eiyen4TSm+5J1Azqdv94xn18pBpoi7vsrHURxrTPChXP34c+1ZD/3P4skErnwWjNuCkE5EzE65zs3VN;4:ZCA+czL1FQBovb9Wbu4sURER/7B8WxyNAyvinbB6qSaTABj6aYUs/G6r6e/E4ctdjde/2pDyGflAMEPSC5tT+lWR6vH//zdASI84nfGjwjVi8L5IrUMh4JqfssnmUNsa2EkIDve0fV59Co/9Kf5EuqyzSDHRY0hS+A3/0Z0/QtT/boIz0zhuyn+Lvlqs1f3OfTzvWvrOf4uToxX4J4YeDsn1AX2Cmu0ZDp/iIajn8fhHFHaYxtO8nHwuSZk40xPPQX+mI9+4QN8Q4fAbsQnpBw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(11241501159)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231022)(3002001)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011);SRVR:CO1PR15MB0965;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CO1PR15MB0965; X-Forefront-PRVS: 05015EB482 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(376002)(366004)(346002)(189002)(199003)(24454002)(101416001)(189998001)(6486002)(97736004)(23746002)(65826007)(86362001)(8936002)(33646002)(6116002)(52116002)(6246003)(52396003)(229853002)(1706002)(53546010)(2906002)(230700001)(4326008)(54356999)(76176999)(50986999)(53936002)(36756003)(305945005)(68736007)(110136005)(81156014)(8676002)(106356001)(58126008)(316002)(81166006)(83506002)(31686004)(25786009)(31696002)(5660300001)(7736002)(64126003)(478600001)(47776003)(50466002)(67846002)(65806001)(2950100002)(105586002)(65956001)(6636002)(6666003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR15MB0965;H:[IPv6:2620:10d:c081:1131::1131];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CO1PR15MB0965;23:z/q4Wk41K7woX5u8xy+D3uyeRCbvn2LmzwKF3?= =?Windows-1252?Q?9f2mLdRzgqHtPUebkXHHDNs0hBUw4d3ENV7kYOmiFh/dLafBX4++f96L?= =?Windows-1252?Q?pxsm4I7V1JDmq9on0KRoW7hu2hCAbhh3AL/KCdK785igORtO++cTSHxw?= =?Windows-1252?Q?WMxvs7TzBHnD+E4VViqpeeM+EDAD8Kx3njrHGQ/+ttOH7qIcA5Q3Qjus?= =?Windows-1252?Q?zWAxteKOhFck+kK+l9Mx8KDr3mfRhCNwOSLWM3Rnwnk1BiZ2Zs+AQ5wZ?= =?Windows-1252?Q?bV1mMFYGUXdLym5NH/+8T3xsSMoakSqbeRwFIaYd1OK3P2gtdoxn9jLc?= =?Windows-1252?Q?Kg8bYr5epFfQeYSQWQu/5pHrTdHYQVbEzKrO9YB2QaIRWZu7cMZ2ch40?= =?Windows-1252?Q?Xhf0r1ZEBAd86m79icroAjDD3JQ+AjyKMZEb34bge6TAtsCR+o9QoJiW?= =?Windows-1252?Q?kVOX1l2Le16x2xAtiH43hZ7Sr+vI7eZacYpF9GwVMbeNwk/CkudvhCJH?= =?Windows-1252?Q?ysXRoWWjNqxxqVhntLSUNYcPqiWKLpobKgQKiFFrW8ZqNq8zmhjn5ul4?= =?Windows-1252?Q?Fa385PI8gc2bJCjn/6justSN0tXTqMsu/0EOtqZat7NBYYAXA8lY8B0t?= =?Windows-1252?Q?kWk7+GGmJrs0U74ABUp9/cUvVVtU0PuYOhakJVJrEYBU1xC9v7H2TKwd?= =?Windows-1252?Q?i+i7uEsnX7JwwIRKhKw3UTe8eJUluAPpaDnBaWND+6MUNrSc5z8azQZF?= =?Windows-1252?Q?xZrETXnKorLKbIZfPYSmNLIax4Xs6WaGstsk+0S+ApWT6rIWOqSBq6aH?= =?Windows-1252?Q?w8wLuyGd6hA2I0ws6OcdmHZnjeh2cZAHjsxSAM6Ff+mVG6WTCmNa1J/7?= =?Windows-1252?Q?OhHixOSjAO4KnbB2ccjWC19ywaigX1Kp2Ru2rVxD8g0s35M6kB9AzH20?= =?Windows-1252?Q?+TgmVnrgwJbmXh9SQDJs0xuRtnph0wlE4q4h8TreV3MeOCX83FbeQPeE?= =?Windows-1252?Q?HsbcomDtx+NFD4780zPpzWnwRmuTdswe8G1eT8AFp420qHbt1apTDsGb?= =?Windows-1252?Q?DrjrKqwP5mcY0LHwlfnp4Gp3LciRXPDAboK2TxbvVEJF5gfMFuf6QUQZ?= =?Windows-1252?Q?nCdUIy6/KRo+/3BqrYTQVXvSwx2lsgI8omE9yu8mhRZyTNZ+e2uE4qW/?= =?Windows-1252?Q?cBpS8JJX9kqfC+BOV+QwGrL2soYuj1vKohn8aKw1K88ApT9tcW3srzc+?= =?Windows-1252?Q?JrunD9FAcGe6A02ZhfT2xLe5ec9E8JIjv6cfFHXGIRLw/rgM476Pm4t0?= =?Windows-1252?Q?S/M7d3sBjQZMLfQiDskCUmjt6s9THFwI03m93UP9ZJ6FWAcTKkSB/1o/?= =?Windows-1252?Q?WR3j5WB6RwYeYPvNeFjW6ekjH6hitipvFJd6xdSJ0wr15iM1BioYKfRC?= =?Windows-1252?Q?aSP9mQdX8CJL2cuafys?= X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB0965;6:AQe9UMQi8Ik2Of1BputKKwDSUrQZK1xxMsd9IHI3BzR9mXI4EjPTndhqNV3hxD858TWfSdAol0xGLMpeiDaki5t7D5kNSXeaTOMKvduu3MtjBLLepdw1Ie9okJQRpH4cNp2kvEsTG7HaeKDRRI+UoXOV/nsjfG9QJ4dhNFfmuA0yCE2qLYBQDuVs+gsv/IIjxnktUqdL1KJVCCit1SQCdJ37whtuV2aVpl4isC+rounSpAbueuWrQkNlE3+MDnJ2cZY6xirxwR4onoJ5+3db2HYBbLbkLLXEJsuIE5zpqXun+U3J2lHao9JwwxkElC6SQdHwpPb97z29tWrX8X/6C2wEoeFnfH3OqBvFfIMEnhQ=;5:kUaTRMHCM2bswXXf2uTeHSG8NcQgTq87Dvqzu5U0bhp2rq5QCziSKC6f+kH5C6peSvrjKCkGlRuDnEX+2r+bOgrAKMbcRVCTbvc5ZZBa1M/xMYesQ+NP6rwMbVbclxkZxwJ7hgj2s05kAUVNKTXA/81AzXZtQMZ1XukG/E/DLjM=;24:G1ITg262Cr1yP6WNB18l7p+GFxQwbsF6HcMnn8mJpULCFEQ8I4eaguslL3bPD3lgEkEAwbjZnjv8gxke/9YFR7h30t9u9+igVcKv+SB1JHk=;7:y07PuzjyH/hbSIQINBKh95Zuwxj1gOhehhY2zpHryjnJL49RcLeWzWGq54vCS7glReaEiMbH5Yrea8WSzTpsXEwD3fzKjMSuQ9RtFxUdH7YIst18hmfY1nicP46E3+iywK1eRN0vk/V1k6iiUuFsROXiBQjEW5mID4HPrfV5rMtyPxvXkwSGwMOvtLPBv3P0Mle4IcA1GCYExktFDumSsDLDPTQeeh+8DpLeUV4mZEcE7Q+S3Wbuhs4d5kaLq7/p SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR15MB0965;20:Eabkf4fxD9Ii0xmMxzNmCtz7ftCfmV1t/bw4HUr1JKFl0N/ngOUqMRRoUgCue7msfGE3DGXmJry5+IZHPCKgis3qJBShNDr28WDcfN+7WrjxzTs5y+PkvqK9JtXjEoMRs5ArVO8h39yZQ44Y9w9uMin3l3QNmO/02S6fds9YiV8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2017 06:31:34.5453 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8837498-b81a-4c99-538c-08d53305026b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR15MB0965 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-24_02:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/23/17 2:02 AM, Peter Zijlstra wrote: > On Wed, Nov 15, 2017 at 09:23:33AM -0800, Song Liu wrote: > >> Note: We use type __u64 for pointer probe_desc instead of __aligned_u64. >> The reason here is to avoid changing the size of struct perf_event_attr, >> and breaking new-kernel-old-utility scenario. To avoid alignment problem >> with the pointer, we will (in the following patches) copy probe_desc to >> __aligned_u64 before using it as pointer. > > ISTR there are only relatively few architectures where __u64 and > __aligned_u64 are not the same thing. > > The comment that goes with it seems to suggest i386 has short alignment > for u64 but my compiler says differently: > > printf("%d, %d\n", sizeof(unsigned long long), __alignof__(unsigned long long)); > > $ gcc -m32 -o align align.c && ./align > 8, 8 unfortunately 32-bit is more screwed than it seems: $ cat align.c #include struct S { unsigned long long a; } s; struct U { unsigned long long a; } u; int main() { printf("%d, %d\n", sizeof(unsigned long long), __alignof__(unsigned long long)); printf("%d, %d\n", sizeof(s), __alignof__(s)); printf("%d, %d\n", sizeof(u), __alignof__(u)); } $ gcc -m32 align.c $ ./a.out 8, 8 8, 4 8, 4 so we have to use __aligned_u64 in uapi. Otherwise, yes, we could have used config1 and config2 to pass pointers to the kernel, but since they're defined as __u64 already we cannot change them and have to do this ugly dance around 'config' field. If you prefer we can do the same around 'config1', but it's not any prettier. We considered adding __aligned_u64 to the end of 'struct perf_event_attr', but it's a waste for most users, so reusing the space of 'config' field like this seems the least evil. From 1584851945917659441@xxx Thu Nov 23 10:23:16 +0000 2017 X-GM-THRID: 1584155725693670341 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread