Ответ: Ответ: Ответ: MODPROBE: next generation

Vladimir Dronnikov dronnikov at gmail.com
Sun Jul 6 11:58:18 UTC 2008


Yes. You see some kind of grepping of all modules is needed at
startup, so why not to perform it explicitly? On my system it is about
20 modprobe calls with pci: aliases. The time to resolve them
currently is an order of magnitude longer than just to cache the
definitions once and then use the cache.

--
Vladimir


2008/7/6, Denys Vlasenko <vda.linux at googlemail.com>:
> On Sunday 06 July 2008 13:31, Vladimir Dronnikov wrote:
>> Exactly. And the use of fnmatch() is definitely required, or we loose
>> many modules, particularly PCI.
>
> Like this?
>
>                 /* "modname alias1 symbol:sym1 alias2 symbol:sym2 " */
>                 desc = xstrdup(modinfo[i].desc);
>                 /* Does matching substring exist? */
>                 replace(desc, ' ', '\0');
>                 for (s = desc; *s; s += strlen(s) + 1) {
>                         /* aliases in module bodies can be defined with
>                          * shell patterns. Example:
>                          * "pci:v000010DEd000000D9sv*sd*bc*sc*i*".
>                          * Plain strcmp() won't catch that */
>                         if (fnmatch(s, alias, 0) == 0) {
>                                 free(desc);
>                                 dbg1_error_msg("found alias '%s' in module
> '%s'",
>                                                 alias, modinfo[i].pathname);
>                                 return &modinfo[i];
>                         }
>                 }
> --
> vda
>



More information about the busybox mailing list