[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72k1w8__rCAZs1NbVvB=gXp_AX9=H-KYbdoLCcmYFEWc_w@mail.gmail.com>
Date: Wed, 14 Apr 2021 21:59:24 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Miguel Ojeda <ojeda@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
rust-for-linux@...r.kernel.org,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Geoffrey Thomas <geofft@...reload.com>,
Finn Behrens <me@...enk.de>,
Adam Bratschi-Kaye <ark.email@...il.com>,
Wedson Almeida Filho <wedsonaf@...gle.com>
Subject: Re: [PATCH 01/13] kallsyms: Support "big" kernel symbols (2-byte lengths)
On Wed, Apr 14, 2021 at 9:45 PM Matthew Wilcox <willy@...radead.org> 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
Powered by blists - more mailing lists