Compiling Linux Device Driver - USB Mouse - using CLang

Hi All !

I’m new to clang and I would like to perform static analyses on linux device driver (starting from /linux-X.XX…/drivers/hid/usbhid/usbmouse.c).

More specifically, I would like to generate call graphs on the usbmouse.c source code.

Prior Background:

I have performed a simple sudo apt-get install for installing both llvm and clang. I ran clang on simple C source codes and was able to generate call graphs.

I have modified usbmouse.c and usbkbd.c so as to exploit few concurrency issues. Have compiled linux kernel v4.1.3 (latest stable release). I’ve been able to successfully insmod the usbmouse and usbkbd drivers.

What should I add to the Makefile in the /linux-X.XX…/drivers/hid/usbhid/ location so as to be able to compile usbmouse.c to generate call graphs?

Thanks

Regards