performance of pci_device_get_{vendor, device}_name() in X server startup

Younes Manton younes.m at gmail.com
Tue Jun 8 17:56:16 PDT 2010


On Tue, Jun 8, 2010 at 8:38 PM, Richard Barnette
<jrbarnette at chromium.org> wrote:
> On Jun 8, 2010, at 5:22 PM, Mikhail Gusarov wrote:
>
>>
>> Twas brillig at 17:04:59 08.06.2010 UTC-07 when greg at kroah.com did gyre
>> and gimble:
>>
>> GK> Ok, I'm coming in late, but why in the world would the x server
>> GK> ever care about the pci.ids file?  Why would the mapping from id to
>> GK> string be needed anywhere here?
>>
>> Oh, that's _the_ right question. Looks like only for writing names to
>> log (unless I missed some access to the data structure while
>> grepping). Well, not really useful to trade for 400ms of startup :)
>>
> I did a longer search while investigating this earlier:  I'm well
> nigh certain that the only way the data can get used is to get written
> to the log.  That said, I believe some of the log messages involve
> errors, and I'd hate to be the one who made it hard from some poor Joe
> to debug why his extra-special X server config wouldn't come up.
>
> One other option I've considered is to only extract the data if the
> -verbose option is used.  The problem I see is that while the calls
> in xf86pciBus.c lend themselves readily to that solution, the calls
> in xf86Configure.c aren't as obviously easy to deal with that way.
> I'd be thrilled to be better educated on how all that code works.
>
> Thanks!

For error messages the names could always be looked up as needed. At
that point half a second probably doesn't matter as much as at
startup. I don't have the src handy at the moment to find all the
other uses, but non-error log messages needing the names, including
xf86PciProbe, don't seem as critical.


More information about the xorg-devel mailing list