[PATCH 0/1] i2c: add I2C ioctl decoding
Dmitry V. Levin
ldv at altlinux.org
Tue Apr 27 22:56:59 UTC 2021
On Tue, Apr 06, 2021 at 06:47:00PM +0200, Tobias Peter wrote:
> Hi strace-dev,
> I was missing decoding for the I2C ioctls, so I went ahead and
> implemented them for myself. If you consider this patch acceptable, I'd
> like contribute them upstream.
> I based this mostly on the existing gpio_ioctl. I've tested this a bit
> using i2c-tools, but not exhaustively. Here's some example output:
Would you mind adding some tests as well? If your code is made after
gpio ioctl decoder, you could use its tests as examples, too,
see tests/ioctl_gpio*.c files.
> I'm not yet sure about the output format as far as changed values are
> concerned. The current implementation allows me to get by without a
> `saved` construct like e.g. bpf uses it, but has some drawbacks:
> - It currently prints values that are unimportant, like the original
> content of the `buf` or `data` fields on pure read operations.
> - For I2C_RDWR, "request" and "response" i2c_msg objects are not next
> to each other, which makes them hard to read.
You don't have to use "saved" constructs, but if they would make the
output look nicer, why not?
More information about the Strace-devel