[PATCH 2/3] defs: define PRI__[uxs]64 to print __[su]64 values

2016-03-30 Thread Jeff Mahoney
Rather than cast every __u64 or __s64 before printing, we can define printing helpers for those types directly. * defs.h: define PRI__[uxs]64. --- defs.h | 20 1 file changed, 20 insertions(+) diff --git a/defs.h b/defs.h index ead12dd..cc2a0d4 100644 --- a/defs.h +++ b/defs

[PATCH 0/3 v2] Add btrfs ioctl support

2016-03-30 Thread Jeff Mahoney
Hi all - This short series adds support for the btrfs ioctls. Its structures make heavy use of __u64 so rather than cast every single member, I added new PRI* macros to print them properly. It also uses 64-bit flags and defines values that are larger than can be described by a 32-bit variable, s

[PATCH 1/3] util: change type of struct xlat.val to uint64_t

2016-03-30 Thread Jeff Mahoney
Some ioctls have flags fields that are 64-bit. A 32-bit val means these flags will never be matched or printed. * util.c: (xlookup) Use uint64_t for val. (xlat_search) Likewise. (printxvals) Likewise. (addflags64) New function. (printflags64) New function. (sprintflags64) New function

[PATCH 3/3] Add btrfs ioctl support.

2016-03-30 Thread Jeff Mahoney
* btrfs.c: New file. * Makefile.am (strace_SOURCES): Add it. * defs.h [LINUX] (btrfs_ioctl): New function. * ioctls.c (ioctl_decode) [LINUX]: Use it to decode BTRFS_* ioctls. * configure.ac: Add check for struct btrfs_ioctl_feature_flags. Add check for struct btrfs_ioctl_fs_info_args.nodesize.

Re: [PATCH 3/3] Add btrfs ioctl support.

2016-03-30 Thread Jeff Mahoney
On 3/30/16 10:50 PM, Dmitry V. Levin wrote: > On Wed, Mar 30, 2016 at 09:19:27PM -0400, Jeff Mahoney wrote: > [...] >> +#include "defs.h" >> +#include >> +#include Again, thanks for the review. > linux/btrfs.h was introduced by linux kernel commit v3.9-rc1~4^2~30^2~53, > while strace supports b

Re: [PATCH 2/3] defs: define PRI__[uxs]64 to print __[su]64 values

2016-03-30 Thread Dmitry V. Levin
On Wed, Mar 30, 2016 at 10:28:35PM -0400, Jeff Mahoney wrote: > On 3/30/16 9:55 PM, Dmitry V. Levin wrote: > > On Wed, Mar 30, 2016 at 09:19:26PM -0400, Jeff Mahoney wrote: > > [...] > >> +/* > >> + * The kernel used to define 64-bit types on 64-bit systems on a per-arch > >> + * basis. Some archi

Re: [PATCH 1/3] util: change type of struct xlat.val to uint64_t

2016-03-30 Thread Dmitry V. Levin
On Wed, Mar 30, 2016 at 10:47:49PM -0400, Jeff Mahoney wrote: > On 3/30/16 9:48 PM, Dmitry V. Levin wrote: > > On Wed, Mar 30, 2016 at 09:19:25PM -0400, Jeff Mahoney wrote: > >> Some ioctls have flags fields that are 64-bit. A 32-bit val means > >> these flags will never be matched or printed. [..

Re: [PATCH 3/3] Add btrfs ioctl support.

2016-03-30 Thread Dmitry V. Levin
On Wed, Mar 30, 2016 at 09:19:27PM -0400, Jeff Mahoney wrote: [...] > +#include "defs.h" > +#include > +#include linux/btrfs.h was introduced by linux kernel commit v3.9-rc1~4^2~30^2~53, while strace supports build with much older kernel headers than v3.9-rc1, so please add a check. I suppose m

Re: [PATCH 1/3] util: change type of struct xlat.val to uint64_t

2016-03-30 Thread Jeff Mahoney
On 3/30/16 9:48 PM, Dmitry V. Levin wrote: > On Wed, Mar 30, 2016 at 09:19:25PM -0400, Jeff Mahoney wrote: >> Some ioctls have flags fields that are 64-bit. A 32-bit val means >> these flags will never be matched or printed. Thanks for the review. TBH, I expected there to be some discussion on t

Re: [PATCH 2/3] defs: define PRI__[uxs]64 to print __[su]64 values

2016-03-30 Thread Jeff Mahoney
On 3/30/16 9:55 PM, Dmitry V. Levin wrote: > On Wed, Mar 30, 2016 at 09:19:26PM -0400, Jeff Mahoney wrote: > [...] >> +/* >> + * The kernel used to define 64-bit types on 64-bit systems on a per-arch >> + * basis. Some architectures would use unsigned long and others would u= > se >> + * unsigned

Re: [PATCH 2/3] defs: define PRI__[uxs]64 to print __[su]64 values

2016-03-30 Thread Dmitry V. Levin
On Wed, Mar 30, 2016 at 09:19:26PM -0400, Jeff Mahoney wrote: [...] > +/* > + * The kernel used to define 64-bit types on 64-bit systems on a per-arch > + * basis. Some architectures would use unsigned long and others would use > + * unsigned long long. These types were exported as part of the >

Re: [PATCH 1/3] util: change type of struct xlat.val to uint64_t

2016-03-30 Thread Dmitry V. Levin
On Wed, Mar 30, 2016 at 09:19:25PM -0400, Jeff Mahoney wrote: > Some ioctls have flags fields that are 64-bit. A 32-bit val means > these flags will never be matched or printed. struct xlat is used for various kinds of thing all over the code, and this tiny change of type might have unforeseen co

[PATCH 1/3] util: change type of struct xlat.val to uint64_t

2016-03-30 Thread Jeff Mahoney
Some ioctls have flags fields that are 64-bit. A 32-bit val means these flags will never be matched or printed. * util.c: (xlookup) Use uint64_t for val. (xlat_search) Likewise. (printxvals) Likewise. (addflags) Use uint64_t for val and print with PRIx64 . (printflags) Likewise. (spri

[PATCH 0/3] Add btrfs ioctl support

2016-03-30 Thread Jeff Mahoney
Hi all - This short series adds support for the btrfs ioctls. Its structures make heavy use of __u64 so rather than cast every single member, I added new PRI* macros to print them properly. It also uses 64-bit flags and defines values that are larger than can be described by a 32-bit variable, s

[PATCH 3/3] Add btrfs ioctl support.

2016-03-30 Thread Jeff Mahoney
* btrfs.c: New file. * Makefile.am (strace_SOURCES): Add it. * defs.h [LINUX] (btrfs_ioctl): New function. * ioctls.c (ioctl_decode) [LINUX]: Use it to decode BTRFS_* ioctls. * configure.ac: Add check for struct btrfs_ioctl_feature_flags. Add check for struct btrfs_ioctl_fs_info_args.nodesize.

[PATCH 2/3] defs: define PRI__[uxs]64 to print __[su]64 values

2016-03-30 Thread Jeff Mahoney
Rather than cast every __u64 or __s64 before printing, we can define printing helpers for those types directly. * defs.h: define PRI__[uxs]64. --- defs.h | 20 1 file changed, 20 insertions(+) diff --git a/defs.h b/defs.h index 0c60f1b..fe56de4 100644 --- a/defs.h +++ b/defs