Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2828198pxb; Mon, 19 Apr 2021 15:19:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqJxmeyeLt4BnkEIpiInDgyNUZWE1zm9pN+wmGoO/ezKvbir+6oKd7Azw29ixBVgygX4gc X-Received: by 2002:a17:902:fe8c:b029:ec:a2ef:4e3f with SMTP id x12-20020a170902fe8cb02900eca2ef4e3fmr8122243plm.36.1618870760049; Mon, 19 Apr 2021 15:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618870760; cv=none; d=google.com; s=arc-20160816; b=yE7i45JFsDXrLF4rNt58DmYsVXys3ph6ps1Vgpno7dZRNnDu6AZajLJGDlRL7YrKPX CJn9NFPHjY9Qb/R/hGLV6Gs5Y0sN/dWNKliI9L9I1ZUFta9HkWSRgSyRcXQSBGHf0e5i gPmmU/1YqYuY8G8b0HdqzI+P7z4A/D5peYfDuqAeSli74TTK+7WwSEgzMOwTdvVdEGA/ 6vUeCpgZXi+pHzG6mibc7ffboKqcOQXRaaDMrXbi0TVEQhE7sZkXMcNvNs5EfGIqPsXD ffdMRUtIHYwqulEU+S171aQQ/Q8nyHVvcIbFQT6QYIpI/EFYf0oMHd7qUYtweKSpKzHE 9h1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=L/P0K+YIm3SJ8u0M3dCxev/vLY68xfu2tyMwx4tY10c=; b=BiwkG4T09+BTyGduXQ2QMH1iJeGQUoMClihYWbMxe7U1yKLZJ0LMaIHZERwTpG0u6V 9FlS3KvFJDVxAyxTrYFyIX62cjLDxq/e/uvAubb3d63T0iRUD2Z9d2qobe+cBpfNxOL0 lvrYnsWboKu/yPXyHGSQzcj9Ms2ez6eAqAi9U8IU0VWyLD3VLPK422uvyhWzR7OmVVwO XtU5ae//477eE9ahAb4hEggDC3kOeuj2rYsKr8UJMs6cPgRhGyDsybrBWOzF2rHgLcan poeZbBfcLZYlHzO0c2dfmDGDT/DeL3adF7+n/8z8xf8akB5J5HTNQI800THCHG1nkPss +JJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KetrrqMH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si19497364plg.84.2021.04.19.15.19.08; Mon, 19 Apr 2021 15:19:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KetrrqMH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239385AbhDSUTF (ORCPT + 99 others); Mon, 19 Apr 2021 16:19:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbhDSUTE (ORCPT ); Mon, 19 Apr 2021 16:19:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD8E6C06174A; Mon, 19 Apr 2021 13:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L/P0K+YIm3SJ8u0M3dCxev/vLY68xfu2tyMwx4tY10c=; b=KetrrqMHF9BqlpW1rvRwZmk1sd CftfB6poj7z6VpGELq1gPo6fhnjxIUBekze6/sFG081hRiMfazhWeKoy9qkWyoMH/pxqD1R9GI5et 7KdqSC4fl4fTcYC7Io+zsY2VI1VuKYvqXKiefkkyVh6KHUl2tsssZrQ0itmryBgIOlBtkCiTmsWXW T+8nmtsLwoB9KW9PGRC+shl0b3jH/T6OXwol5SBQ7Pl411mRDQAca/1Gyy8LDJ85kjkjO1UPISF3U +xWDBiGb3ldIhGOY01vuzVqwwyNxUMD7A/8eL6+tcIFqJo1jz2f2YxHdjO4Ohw2OcKQOJpdiF1EAX Idvk8rcw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lYaKf-00EEWS-Bz; Mon, 19 Apr 2021 20:17:35 +0000 Date: Mon, 19 Apr 2021 21:17:21 +0100 From: Matthew Wilcox To: dsterba@suse.cz, Miguel Ojeda , Peter Zijlstra , Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Michael Ellerman Subject: Re: [PATCH 04/13] Kbuild: Rust support Message-ID: <20210419201721.GF2531743@casper.infradead.org> References: <20210414184604.23473-1-ojeda@kernel.org> <20210414184604.23473-5-ojeda@kernel.org> <20210419195850.GV7604@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210419195850.GV7604@twin.jikos.cz> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 19, 2021 at 09:58:51PM +0200, David Sterba wrote: > On Fri, Apr 16, 2021 at 07:34:51PM +0200, Miguel Ojeda wrote: > > something like: > > > > [ 0.903456] rust_begin_unwind+0x9/0x10 > > [ 0.903456] ? _RNvNtCsbDqzXfLQacH_4core9panicking9panic_fmt+0x29/0x30 > > [ 0.903456] ? _RNvNtCsbDqzXfLQacH_4core9panicking5panic+0x44/0x50 > > [ 0.903456] ? _RNvCsbDqzXfLQacH_12rust_minimal1h+0x1c/0x20 > > [ 0.903456] ? _RNvCsbDqzXfLQacH_12rust_minimal1g+0x9/0x10 > > [ 0.903456] ? _RNvCsbDqzXfLQacH_12rust_minimal1f+0x9/0x10 > > [ 0.903456] ? > > _RNvXCsbDqzXfLQacH_12rust_minimalNtB2_11RustMinimalNtCsbDqzXfLQacH_6kernel12KernelModule4init+0x73/0x80 > > [ 0.903456] ? _RNvXsa_NtCsbDqzXfLQacH_4core3fmtbNtB5_5Debug3fmt+0x30/0x30 > > [ 0.903456] ? __rust_minimal_init+0x11/0x20 > > Are there plans to unmangle the symbols when printing stacks? c++filt > says: > > rust_begin_unwind+0x9/0x10 > ? core[8787f43e282added]::panicking::panic_fmt+0x29/0x30 > ? core[8787f43e282added]::panicking::panic+0x44/0x50 > ? rust_minimal[8787f43e282added]::h+0x1c/0x20 > ? rust_minimal[8787f43e282added]::g+0x9/0x10 > ? rust_minimal[8787f43e282added]::f+0x9/0x10 > ? ::init+0x73/0x80 > ? ::fmt+0x30/0x30 > ? __rust_minimal_init+0x11/0x20 > > for simple functions it's barely parseable but the following is hardly > readable > > > _RNvXs5_NtCsbDqzXfLQacH_11rust_binder11range_allocNtB5_15DescriptorStateNtNtCsbDqzXfLQacH_4core3fmt5Debug3fmt+0x60/0x60 > > translates to > > ::fmt Yes, I agree, we need a better story for name mangling. My proposal is that we store a pretty name which matches the source (eg rust_binder::range_alloc) and a sha1 of the mangled symbol (40 bytes of uninteresting hex). Symbol resolution is performed against the sha1. Printing is of the pretty name. It should be obvious from the stack trace which variant of a function is being called, no?