From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E47DC433ED for ; Mon, 19 Apr 2021 21:03:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D57C2611F0 for ; Mon, 19 Apr 2021 21:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240239AbhDSVEJ (ORCPT ); Mon, 19 Apr 2021 17:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238515AbhDSVEF (ORCPT ); Mon, 19 Apr 2021 17:04:05 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AB1BC06174A; Mon, 19 Apr 2021 14:03:35 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id n12so40416362ybf.8; Mon, 19 Apr 2021 14:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DZAiVp0HPCvt+Q56acSFAC0/xsTpWCSEtHLPhq6sng4=; b=o3qng/pgSCa3Dc0G3aIezrIFgv7cqh67a4iPOYbRdaupA4JvOOk3fYkh0SBurKEOEf wXMiChhj3YBk5t5xIaEJYyb+NLTCVMSVklY8FDIESon1UoDL6cOmEdfVXwC5ooQA+M2i g/0o2wQxsOeIzX+AYGCyjX3pP78UodlqfzYkKPOvsqKRKg5lUF+aK0XdQn+6y0ANnYKA +Xt7LcxFHKxwEtJuTtej6qSWhPRAntsvto2U1crY22pCcbiPzu5OFPH8tKzJTvXipQTY C2aOxVrGtVQ6N2ZNLmMdIjOt1cpNcYsgR6X52kpvX0Napke6++67gL01OQrWJ22QlfrO 5OdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DZAiVp0HPCvt+Q56acSFAC0/xsTpWCSEtHLPhq6sng4=; b=c5PTm7tYez22eWnO/qML8C/u2DfqJ85S1Hf6loak+6BbIRJxxI0fu85XF+VdwiWFJ0 a3RGPKauWepAy4msqNWbUYC3oGN9y5tprF7rP0nQ0OlRWzE5Y9tw5iZlYe43x4QxKAmn EOekmzdDmW3G9xD60dCyyUjpsTWt0a9oJWC2NwXj3vm39pivLisC2Yh86V03TcdCNQq/ jT+Gi35cMIZ/wSrhG38YBgq+JdKcjg56eaYA1hILpNszQZVJptHhkvXIX8ZuB5EGUns8 43EptjwWh3cdgILubp8wR3OsKCk7JP3EJrP8GNXyWN9y01Bdg9onl0zBpMbk+ATVW/9I 1Xdg== X-Gm-Message-State: AOAM530HFyZAyW1vNGfwAnXEpe9oLI3ps1JvFfFqdT+HKlaaD5MREUUA MXzcKQNeRDqBzVsCac3SlYjQOWac5CtHHYl0Bfw= X-Google-Smtp-Source: ABdhPJzF9sMh9cOnjNPTMM1z36oacvvQp41KT6/gWqFIoMoPpF3w9DNvmYGArCtMKt+Zzc2qVEbQR2ds1LQ7DPk8pRU= X-Received: by 2002:a25:6803:: with SMTP id d3mr20848597ybc.422.1618866213945; Mon, 19 Apr 2021 14:03:33 -0700 (PDT) MIME-Version: 1.0 References: <20210414184604.23473-1-ojeda@kernel.org> <20210414184604.23473-5-ojeda@kernel.org> <20210419195850.GV7604@twin.jikos.cz> <20210419201721.GF2531743@casper.infradead.org> In-Reply-To: <20210419201721.GF2531743@casper.infradead.org> From: Miguel Ojeda Date: Mon, 19 Apr 2021 23:03:23 +0200 Message-ID: Subject: Re: [PATCH 04/13] Kbuild: Rust support To: Matthew Wilcox Cc: dsterba@suse.cz, Peter Zijlstra , Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux , Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Michael Ellerman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Mon, Apr 19, 2021 at 10:18 PM Matthew Wilcox wrote: > > 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? If the pretty name is only `rust_binder::range_alloc`, that would not be enough, since (in this case) that is a module name (i.e. the namespace of the `DescriptorState` type). The function being called here is `fmt` (the one outside the `<>`), which is a method of the `Debug` trait. We could perhaps reduce this down to: rust_binder::range_alloc::DescriptorState::fmt without much ambiguity (in most cases). Cheers, Miguel