Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp358298pxb; Wed, 14 Apr 2021 17:45:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlv4o8cpxJXVoSmfDgfN8H5jTMlBINPCGIL+FPB9at8z3BOBG6tsjxtWauPtsBS3Vrrcdi X-Received: by 2002:a17:903:2490:b029:e6:faf5:86df with SMTP id p16-20020a1709032490b02900e6faf586dfmr971755plw.69.1618447520499; Wed, 14 Apr 2021 17:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447520; cv=none; d=google.com; s=arc-20160816; b=cmYQJzRCWHyn+2KF1P52x4Ui8xJy+i5hpN59HyPtXcDomNwAwzgbyvCzmQTPJKF9Eb XIOGST5REWPKPt1nfSEQBzctseVr+7oZa7JZNzibOetaOMdX3araNK1F+nwsS+Xs6AO6 buz6lsFqRSXaK4Kzbp3gBHOLGRCKklDeLSgsmfFE/ougZPeNoYlJn29FuQ23RQ/aCEXI QpI0uo7QTHJ7oruKhCV4hhme0JyOw/ZXaKknn4y5KmayEEDi4NHf4iYbkdfjE0gc/Nex aLr4CoOVswtEtT1ZWBcB1FTfMHifHgh/N6exxrKovsC/HYVYr/0pqwUE2S9AW8hr3Y6q HIhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kk+4eaGKBse7wylWIAyXzwrFNlUikGMw6Cuy5HxWNJ4=; b=e/aDT8Ajq/5Ke6iy02b/u9EMo1siyprtoOAWA7kI4C9uIkEZjAMZEBzGMKqGJI4aIY Qo062RKWomwPc0YQlnwOLTMWW+88g1nzAHxETjIjHd3MrAAf5wB/m3hHDLyvCQ7PRAU1 wrG/D7WKi7tNousPBIkYLLl0f2YRcE/6hxeB52vjo0fydY9Je62WaZ2UwwKI1vCNY4Gf +O18stomx04qCDtkJyrG2MfoaIJ2Fz7a69B/B7nMQS+KkG6By1euGEEjBBJXAAqojb3F lcee6eUbdrIlfa85cSeCohIcMDJbiGyEVSxwghPRcqQwUQbjzIkktMIeAE41PNeuqZW2 1KJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nP5JvCXU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si1088945pgd.185.2021.04.14.17.45.08; Wed, 14 Apr 2021 17:45: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=@gmail.com header.s=20161025 header.b=nP5JvCXU; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349377AbhDNT77 (ORCPT + 99 others); Wed, 14 Apr 2021 15:59:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245471AbhDNT76 (ORCPT ); Wed, 14 Apr 2021 15:59:58 -0400 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8555C061574; Wed, 14 Apr 2021 12:59:35 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id o10so23487477ybb.10; Wed, 14 Apr 2021 12:59: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=kk+4eaGKBse7wylWIAyXzwrFNlUikGMw6Cuy5HxWNJ4=; b=nP5JvCXU1J2ZZl0o7Qp4jkJYQeiqEcXIedAawZSmc5SBQrAGieHpyzpJFJouqdXDJD Nvdhmc9lnN06RL9pSJoxX+my+ginHSZaB5FXtdBerQ3/xhfLvJBVb+xZXWNOFKz/SCyR dFfsDblIQUFV71fIbzvj0dVGf11ZKZm8ff0m2VETq/mQQODAGMF6wncCMF60vjdaNWfO BVnNUlExAKpG9ukgorqKtubYuXLr8g/Ln4lFKC1KgPkRo+KZiJwblGulcTrqHuDhYBQ/ Od88hKCcQTGznXZ/w0t7WvtStfJw/O61GEpO/UkJGv3HIUFxPYwzVSFio6zUwdtqXqQD /4yg== 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=kk+4eaGKBse7wylWIAyXzwrFNlUikGMw6Cuy5HxWNJ4=; b=SheQC8Jf1b2NnbUn5y7PEqmMmfR+fMWZYrtawmS9+z0I5nXc7I/nlCjad2ta+bVcWZ WoYfLXrt36eagR67Or2w6qZjN+BWLw/asdBzHE0O4Ad6CrcvEH3LQ9dfHlz+wjCfknKB 3OvJKuufPGEh7ifBmwTteVFuiqtS8CWJE07koBe4KI9Rjy1c+T9USOCM4LlrtTCNxQPo f21TwcBXBils7gDtJJzTHeHRJMKapivZo4rw2nKT6KeB9kgExA+Tuz6z7gTGBwtBjS0x Ra2NgYoDQO8ijut+7UcwVkz1fRCHhACmysHC8kDVibi+DNru+Y1pxjivnHWrXkaVivTq EiLA== X-Gm-Message-State: AOAM531NYgoDX2e6HnCcytNYMB3sJ9pFttFPSJHREKVHlKj442kMhFqQ QH6uBpa6RAMAnUd9vh6mJy+FIL962ZvZgNa1gPM= X-Received: by 2002:a25:81ce:: with SMTP id n14mr52455964ybm.33.1618430375276; Wed, 14 Apr 2021 12:59:35 -0700 (PDT) MIME-Version: 1.0 References: <20210414184604.23473-1-ojeda@kernel.org> <20210414184604.23473-2-ojeda@kernel.org> <20210414194454.GV2531743@casper.infradead.org> In-Reply-To: <20210414194454.GV2531743@casper.infradead.org> From: Miguel Ojeda Date: Wed, 14 Apr 2021 21:59:24 +0200 Message-ID: Subject: Re: [PATCH 01/13] kallsyms: Support "big" kernel symbols (2-byte lengths) To: Matthew Wilcox Cc: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 14, 2021 at 9:45 PM Matthew Wilcox wrote: > > How about doing something a bit more utf-8-like? > > len = data[0]; > if (len == 0) > error > else if (len < 128) > return len; > else if (len < 192) > return 128 + (len - 128) * 256 + data[1]; > ... that takes you all the way out to 16511 bytes. You probably don't That would save some space and allow us to keep the 0 as an error, yeah. > Alternatively, if the symbols are really this long, perhaps we should not > do string matches. A sha-1 (... or whatever ...) hash of the function > name is 160 bits. Expressed as hex digits, that's 40 characters. > Expressed in base-64, it's 27 characters. We'd also want a "pretty" > name to go along with the hash, but that seems preferable to printing > out a mangled-with-types-and-who-knows-what name. I have seen symbols up to ~300, but I don't think we will ever go up to more than, say, 1024, unless we start to go crazy with generics, namespaces and what not. Hashing could be a nice solution if they really grow, yeah. > If you have C-d-b, you don't also need S-o-b. Hmm... `submitting-patches.rst` keeps the S-o-b in the example they give, is it outdated? Cheers, Miguel