0

Is there a mechanism to log the peripheral interactions. E.x. If there is an application running on Linux Kernel and it interacts with the physical world over UART, CAN or any other interface. In this context is there some command or tool that can log these interactions (the data transferred is not required) so that it comes handy to understand to which peripheral does the application interacts....

Thanks in advance

Ginu Jacob
  • 1,588
  • 2
  • 19
  • 35

1 Answers1

0

Assuming a user mode (not in kernel) program, you can run it through strace, which will trace the use of system calls by the program.

To interact with peripheral hardware a program must cooperate with the kernel, and the device drivers of the respective peripherals. This communication often happens through device files (like /dev/sda). To open these "files" the program issues a system call, which will be shown by strace.

Daniel Jour
  • 15,896
  • 2
  • 36
  • 63
  • Thanks for your reply.. I had already tried using strace command and it doesn't help me... There were no system calls between the two points of my interest in the code but my application interacts with an FPGA fabric on the same board through a bus and I am trying to figure out how this interaction is happening. I doubt whether the strace can trace all system calls or only a major subset of it... – Ginu Jacob Oct 02 '15 at 07:01
  • Hm, strace should be able to trace all syscalls, though you might need to specify to follow `-f` children of the traced process. Without further information, it's really hard to help further. – Daniel Jour Oct 04 '15 at 19:11