I have an an embedded Linux ARM board, where an application opens the /dev/spidev1.0 device and constantly talks through with another MCU.Now, if I I try to look at what exchanges (that's what I'd need), doinga hexdump /dev/spidev1.0 shows something in the beginning but causes the application to crash. The app is very sensitive and I think it crashes because the app uses and it can't be used for viewing simultaneously.Would there be a way to create an alias, or something like a mirror of this device if I write some extra code/driver? Or is there no chance for me to sniff the traffic like that (in software) ?Rewrote: int ioctl(int fd, unsigned long request, struct spi_ioc_transfer *xfer)But, gcc output the following error:myioctl.c:6:5: error: conflicting types for ioctl In file included from myioctl.c:1:0: /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/include/sys/ioctl.h:41:12: note: previous declaration of ioctl was hereAny help how the original definition:/* Perform the I/O control operation specified by REQUEST on FD.   One argument may follow; its presence and type depend on REQUEST.   Return value depends on REQUEST.  Usually -1 indicates error.  */extern int ioctl (int __fd, unsigned long int __request, ...) __THROW;could be overridden.
SPI device sniffing/mirror feature
spi
If this Linux distribution does support LD_PRELOAD you can easily use this feature to override opening/closing/reading/writing/ioctl-ing  functions to this specific device.See here for very basic tutorial: http://www.catonmat.net/blog/simple-ld-preload-tutorial/This will not require writing driver and pretty usable approach.IN addition you can try to use strace utility to trace all IO system calls which will obviously include the accesses to your device. 