Summary: | sys-apps/module-init-tools - would be nice if lsmod could handle very long module names | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | André Terpstra <andre> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED UPSTREAM | ||
Severity: | enhancement | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
André Terpstra
2011-04-24 07:01:44 UTC
the one or two spaces could be tweaked for this specific instance, but i dont think lsmod should pre-scan the whole list and calculate the required alignment across all of them. Hm if I remember programming well (it is a long time ago) either a valid assumption about the maximum length of module names can be made or long entries should be truncated... the code already makes an assumption about the length. but anyone can make a module with a longer name. a slightly padded display is a lot better than arbitrary truncation. ok, looking at the code, it basically does: "%-19s %8s ....." so if we add brackets to make things clearer, we see: {1234567890123456789} {12345678} {snd_hda_codec } { 52287} {snd_hda_codec_hdmi } { 20329} {snd_hda_codec_realtek} { 273500} the realtek module has already violated the 19 char limit that lsmod uses. a quick sample of all the modules i have available on my system shows that there are quite a few that are larger than 20 chars, so increasing the 19 only makes it look OK for some modules ... it will still be exceeded by some other module. since the current code is pretty simple (less than 3KiB of .text on 64bit!), i dont see much value in making this work. you'd have to scan the file twice, the first would be just to calculate the longest line. feel free to make your case with the upstream project ... who knows, maybe they'll implement the overly complicated solution. (In reply to comment #4) > > since the current code is pretty simple (less than 3KiB of .text on 64bit!), i > dont see much value in making this work. you'd have to scan the file twice, > the first would be just to calculate the longest line. > I see your point. Didn't know that module name length is unrestricted. My simple suggestion would be to increase the 19 char limit to, say, 30. Of course that's not set in stone. If I knew how to do it I would propose such a patch upstream. |