I’m writing a set of programs to run performance tests on a hardware device. I would like to be able to save version information for each of those subprograms inside of my main ‘controller’ program, so that it can be saved inside the test report. One of these subprograms is a simple kernel driver.
I know Linux kernel modules can expose version information using the MODULE_VERSION
macro. This property can subsequently be read using modinfo
on the command line.
Would it possible to access this information inside a C userspace program, and if so, how ?
I thought about exposing the version inside a character device from which I could read, but given the module file contains that information, it would be much more convenient to read that directly.
rickastley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.