2

I am trying to find a tool that will extract the module version information (a part of the module record) fron an Xserver module. For example, in the Xorg logs I can see the following information for the librecord module in my Xorg.0.log file...

[    39.892] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
[    39.905] (II) Module record: vendor="X.Org Foundation"
[    39.905]    compiled for 1.9.0, module version = 1.13.0
[    39.905]    Module class: X.Org Server Extension
[    39.905]    ABI class: X.Org Server Extension, version 4.0

Is there a tools that would allow me to easily extract the aforementioned information. Sometimes you can use modinfo on the module and that will have version information, but that does not always work. The only consistent way I know of now is to parse the xorg log file. Thanks.

1 Answer 1

1

Yes, there is and you can also try to write a small one.

http://gitorious.org/xdriverprobe

The problem is that xdriverprobe won't compile on newer servers since I didn't update it to the newest ABIs. Also, xdriverprobe is only used for video drivers, but it can be adapted to be used on other modules. The main source code file (xdriverprobe.c) has less than 500 lines, so you can easily learn by reading it.

It works in Ubuntu 11.10... ./xdriverprobe -o moduledata gives the information you want.

Look at its source code. It does:

  • dlopen() the module
  • find a symbol called modulenameModuleData (if your module is called modulename)
  • that symbol is a XF86ModuleData* See /usr/include/xorg/xf86Module.h
  • check its member named vers

Spend a few hours and you'll be able to write a very tiny code that does what you want.

More information: http://www.xfree86.org/current/DESIGN17.html#65 (very old document, but most of what's written there is still true today). If you're not happy with that document, you have to read the Xorg source code.

Happy hacking!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.