Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098AbdDKXLZ (ORCPT ); Tue, 11 Apr 2017 19:11:25 -0400 Received: from mail-cys01nam02on0057.outbound.protection.outlook.com ([104.47.37.57]:21312 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752336AbdDKXLW (ORCPT ); Tue, 11 Apr 2017 19:11:22 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=caviumnetworks.com; Subject: Re: [PATCH] tools: bpf_jit_disasm: Add option to dump JIT image to a file. To: Daniel Borkmann , David Daney , Alexei Starovoitov , netdev@vger.kernel.org, "David S. Miller" References: <20170411213052.7337-1-david.daney@cavium.com> <58ED508B.9010005@iogearbox.net> Cc: linux-kernel@vger.kernel.org From: David Daney Message-ID: <13a47f21-4459-04ef-a817-a6473c9b8f52@caviumnetworks.com> Date: Tue, 11 Apr 2017 16:11:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <58ED508B.9010005@iogearbox.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: BLUPR07CA0029.namprd07.prod.outlook.com (10.255.223.142) To CY4PR07MB3496.namprd07.prod.outlook.com (10.171.252.153) X-MS-Office365-Filtering-Correlation-Id: 10fc6f0f-16ec-461d-6fc1-08d4813010ef X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:CY4PR07MB3496; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3496;3:VqTaNrKejkk7/eELKRCoggI98Z+Fz1nczg1Bg79PTdVDMRI8UJeOlPOSlJxkR7jApqrLs8b6LYplMEzEo/uFlGC9Rxt1LMvsZukec+RRts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p5KgN2cUOnWXDA59PbL4MlkGe6OfGwImKj+eu8mcTepljqa7Ktpl2Ug3q5wSRKjmwZZwZ6U/tRFkm2/x/eDIzJxDTkcvordIwPuBQIfmo+suazrGZGEu/k7qQHVfe+Jf7heR0l2wMkBCPzWWqxNHY6RjaY+do7sNUHIQDsyUQavBop4fL3b6qulcixdKHUYMpEDlDmN5Of8WFPRYjTHLns2hM/eyA2A88/LC5pS++bW2CmxP/rJJTKBvZQy4neXKt/N7oSLsKi1cTj9sQ8hqPG4xQESkJ5OxOBm6h1ffLa30ao5CHMDA+8iBpPTxm2N5RGDogM0RxaHxND0bIDdoBKJhWYFRUjKoembUqeR4NJFNKuxQy08yJ7H8jclowr7cWCyCmzMOooQXeJPAjfJz0NwgR4LwPdtYfzwvs53KE84wHx4dT9GoB0dLxOqXZLnQB81sOmrmzEqP6LTAzGuYq8zEi03gz6xLtuanlow1WbSEyQ1VH4NQceaMRNokwS2pTI1JzEncdo7AzE9aZOBJ8UPUM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:CY4PR07MB3496;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3496; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3496;4:WYtudpQKVXAwzzkldYTdNZ474lOUlIYH1gLKtSxc9uKUPCW4pEnJC7y13v065h6q1UWG3LhVcMY6imMKxqoj2auZEdU4Cuhl8dU2L4cpRQtvvNWDje7wCDnf3zXHNF3fSEM2bJN7ymQGzqeZbRNTPk66bm+Otrkh7lcD5NDYe3n2Kv0ikW5/VUkQlzX4e6QWALNq6YCPo8HAzw9ppVil42DHcfhjjdCFqFQLIsRVRvRdDt3RWc4YkQRj4AjkCfts0zvc/o3ju0DGzFksPiMcrdqdLL1YnK+WX9bT6JgUMxsDDq7agXM86FgfRr3bpZmingojgx8WRpInEa25x8IKyBJ53Uq8G8gqD2hfLtwZ1Kpj/Tlfd5qySNpwBsIzZe3WSY/UKHY+zmiUq6B+XloLytuQ22JjJNn8GeVJjMPg/vq1bkiatVNDVKUgm47S5ZMzMydoHhPeKBeKUghRqUvXkM/xu+1YjFjtWDL4c1/lHEZI6Kx4ZPt5KCbxn4R5Vn2a5WLV0h3Dwr4CULXPi1FOxRgvKWG1iJvHKBzrQwa/e057iJgIX0TDl9Xa/Vljz+qzwKQ1rJRR/6ununQZV/isdhwHNqvBoNzfvFEegnJYDPxDN6KPTK6ZXmSj5oczJsc73OibGI/m1CiFESNIInL3D3PUks9xTJki+eybDHARqtm7wsG0FhePn6QRM936v58d X-Forefront-PRVS: 0274272F87 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39830400002)(39400400002)(39410400002)(39450400003)(377454003)(24454002)(54534003)(6512007)(76176999)(53936002)(6486002)(54356999)(64126003)(8676002)(229853002)(6116002)(3846002)(31696002)(65956001)(6246003)(81166006)(47776003)(4326008)(66066001)(6506006)(230700001)(4001350100001)(50986999)(5660300001)(189998001)(31686004)(33646002)(42186005)(53416004)(38730400002)(23746002)(2950100002)(25786009)(53546009)(7736002)(42882006)(2906002)(83506001)(305945005)(36756003)(50466002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3496;H:ddl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;CY4PR07MB3496;23:BaC6S+y+B0b/OwmmhuQEJx9zlRLsZySeUbI5h?= =?Windows-1252?Q?88T6tOgWMUDln44JVeOe/L8MkLQ80NhUbPiT/4YUyjUMv5Kwna7zkJHX?= =?Windows-1252?Q?A8egohXTkV3dM77ZNsH8MEEpgJrg9+JEO/zPkUp0nYAa37UFxVO2Ct3o?= =?Windows-1252?Q?gKSskJqaLOSGC02Y5n/l1D90EXLXBia5IrYf1AT/BK8I0O9FkWN7QJ0P?= =?Windows-1252?Q?1VDQUsN0QQd+usEMf874E2wyjiTTcWeAiK/1RdnIaPzEr8iQRJn1SvJt?= =?Windows-1252?Q?yCyIKsdOxo0Qgz45lAE6KlJDHVIbSNSk6GZ22l/68cN4nkIiK4Jlcwoq?= =?Windows-1252?Q?Aqe3ilO0QGQk7Po8Slr9EBFO5EDc4eRvU4xSsh5vjvK25lX6+3XVD7Dv?= =?Windows-1252?Q?01rqVTEZ3ssxLpxSqTOGId6LijKebU9/LLeGwj5/WANQVMI+6YHISRPj?= =?Windows-1252?Q?qYBNSb72yBfkNCuShtBF8f1Tp2u6yu1s75Q3xR6Yx1BhnOlnfxtMEvMB?= =?Windows-1252?Q?DvZuLBO+yLG7psgSAQafuXXnlYuAmDvwGgk5yhl07GTUOGywh2LYVoUg?= =?Windows-1252?Q?s+1+9uUhMD/aBVJppPLRULqos4NK82doGdt0Z5i8SOlRw0xFLMgVyJLV?= =?Windows-1252?Q?GQKq0gaY48VJpOfO+gC8RPUkO6ATgbh8fXuJw0zHCmhPuV+JLpql2U+u?= =?Windows-1252?Q?8Vw1yL/d78EGZYCTK2alNXhV+F8/g4UAS3eqhX5dNPnqwV3MovLNv+tr?= =?Windows-1252?Q?OOTIZJ/Ly1Pq5ouBMj1NauRz62D/iNYdSjAQD6dKMmnrnYTO5yJ1Iu1Z?= =?Windows-1252?Q?EifMZSlz+ds3hKZxp0Fs0yBVY/o4XQm50GTeo/bdOjJ2QVNl+CZotH00?= =?Windows-1252?Q?GaeJXTf5Rk+yOHgE4FVFCEitRhnJH2K3k34PfmXQutdU+CCn5DCLUDCJ?= =?Windows-1252?Q?CzT6VihMF2KZcH0Oc8sOp6D3cungocMuRKxswRqj2VkXZwKRSYTIhX2U?= =?Windows-1252?Q?WgqhnwxhuB5BDrQ30qRxuRGd4v1V3G5u/CCbD0RkEDTH+82z6oqt0qu6?= =?Windows-1252?Q?2G7hCA6SICMqXeCUQYAXOFl3DAz+XnmNrxLaq1gxSrT/l624xmKVAu/6?= =?Windows-1252?Q?aXtK58rKYlDf8OicDITbUZJzm1dPpx6yFgLsZgdeJohFQAz/TXyFJUZb?= =?Windows-1252?Q?T0Ec6SNUU3ySEYFaIaetIu908uRlYWFPeYXaAS2aLVvZusOl05Mg7QqW?= =?Windows-1252?Q?e7TIbAUAlIKV+scc2XnFy0lUXj9Aebqe93b6cFecDoJkjC1GfkktZSTy?= =?Windows-1252?Q?2mS?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3496;6:kmt6LZqfDUaFCUQiGAcWGqHe5BKxeqUVVJUQpumG4pMJS7KKWBfh5cloLELrpnrOPQT6ejlnHbWJjv99kz9Xeqk8xe4fCetBLL9qMeOGnYavERooIoAZfWBk1XtCfauSLJffumKv5h85CbI45O3xnMBsOIYMNvSyV63qh77vI3xMcUHnvbcDQeoVbpZwdSQ8ibSwbja+5XctvwwjCCe1UXEJ1SK4adhXE6xirz3pgPHnU+sczD4zXutRZkaHZd4jSTVHx0AGQ22okEeRFjOYwoIycQUFVOY/eYWRxgU0AkRb4h9wLCch0sIYV3A7yJLXxVbnvEwz80j+D2cIC0QszRzrUpFcMTZaNkEA7fSFnSzUj3s6BHcOWycgHFgDen2STMfto61VpnX8XnKb5hjPQy0AVJF2UV76TzIMalGfOqX2RgG7bDRR7+EW1NICtm9V27T0efou6p63lXfsbtD+qg==;5:SDGGkciDy+zZ9Y/D2nwQBbvv5k89Bc2JMOXjtBSlU1diRCIO9SHXDFZoWlvKmaigC9PW6cOQXcWEsvWoCwb7cFjRU2RWG5CryFMKK1ucxBx45bvZS8Muu/QI0+3FJl5ipVIlyXxqPY6xh88MgtSSfw==;24:UBbAp6T4CNR05wSH67+7ZQW6J9JD7MxVXnKup/TsREXrsJvVUWVKSZcKqWSr0IBVTV69aKVCMPZzVf9l9SGGivDQcES29FWN/JRXKpGM2qc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3496;7:RMgwX7RBkF3PHcJQ5ir3oSsWFN/PLHs1Q+PjsqxqEQMTGTmY/pT4cEOpGcBKfKeahKKhSueDnZnDeX/T2WrM2AFZ4E3NHU4rUQT5GSgi7Espid5OfNrTkWdqobsHoiyk7Ac8IcqQ/G82PwlT4rZ+LSs2IRSD3eIAJtzGeVhCHb8mC3qPJgPIVdBUYRABwsnAHH87wPzzxhx9bFGVV8aophyzTFqWrFNkCn8sUyZVXf7nD0YVPmWU4L54fxryersB7kqYKaIh3VQIA6dyAx+BBtING1nkyan9HhOlEj6eaTMiy5y8kTg3E1LnbZrFB4fYe/bOAyXgmoOwJl2H+LdAXQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2017 23:11:19.9376 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3496 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1015 Lines: 27 On 04/11/2017 02:54 PM, Daniel Borkmann wrote: > On 04/11/2017 11:30 PM, David Daney wrote: >> When debugging the JIT on an embedded platform or cross build >> environment, libbfd may not be available, making it impossible to run >> bpf_jit_disasm natively. >> >> Add an option to emit a binary image of the JIT code to a file. This >> file can then be disassembled off line. Typical usage in this case >> might be (pasting mips64 dmesg output to cat command): >> >> $ cat > jit.raw >> $ bpf_jit_disasm -f jit.raw -O jit.bin >> $ mips64-linux-gnu-objdump -D -b binary -m mips:isa64r2 -EB jit.bin >> >> Signed-off-by: David Daney > > Seems good, we could at some point also add an -I jit.bin option > if needed for offline analysis/comparison instead of using -f > plain text. > FWIW: The objdump incantation in the changelog does just about the same disassembly as the bpf_jit_disasm internal implementation. > Thanks! > > Acked-by: Daniel Borkmann