Skip to content

Commit

Permalink
Automatically replace PRI_kr[dux] with PRI_kl[dux]
Browse files Browse the repository at this point in the history
Remove temporary macros created for transition from long
to kernel_ulong_t.

Automatically replace PRI_kr[dux] with PRI_kl[dux] using
$ git grep -l 'PRI_kr[dux]' | xargs sed -ri 's/PRI_kr([dux])/PRI_kl\1/g'

* defs.h (PRI_krd, PRI_kru, PRI_krx): Remove.  All users updated.
  • Loading branch information
ldv-alt committed Dec 26, 2016
1 parent 7fa3d78 commit 8963675
Show file tree
Hide file tree
Showing 50 changed files with 124 additions and 128 deletions.
2 changes: 1 addition & 1 deletion block.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
/* take arg as a value, not as a pointer */
case BLKRASET:
case BLKFRASET:
tprintf(", %" PRI_kru, arg);
tprintf(", %" PRI_klu, arg);
break;

/* return an unsigned short */
Expand Down
2 changes: 1 addition & 1 deletion clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ SYS_FUNC(clone)
tprints(", ");
#ifdef ARG_STACKSIZE
if (ARG_STACKSIZE != -1)
tprintf("stack_size=%#" PRI_krx ", ",
tprintf("stack_size=%#" PRI_klx ", ",
tcp->u_arg[ARG_STACKSIZE]);
#endif
tprints("flags=");
Expand Down
2 changes: 1 addition & 1 deletion copy_file_range.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SYS_FUNC(copy_file_range)
printnum_int64(tcp, tcp->u_arg[3], "%" PRId64);
tprints(", ");
/* size_t len */
tprintf("%" PRI_kru ", ", tcp->u_arg[4]);
tprintf("%" PRI_klu ", ", tcp->u_arg[4]);
/* unsigned int flags */
tprintf("%u", (unsigned int) tcp->u_arg[5]);

Expand Down
4 changes: 0 additions & 4 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,6 @@ scno_is_valid(kernel_ulong_t scno)
#define PRI_klu PRI_kl"u"
#define PRI_klx PRI_kl"x"

#define PRI_krd PRI_kld
#define PRI_kru PRI_klu
#define PRI_krx PRI_klx

/*
* 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
Expand Down
2 changes: 1 addition & 1 deletion dirent.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SYS_FUNC(readdir)
print_old_dirent(tcp, tcp->u_arg[1]);
/* Not much point in printing this out, it is always 1. */
if (tcp->u_arg[2] != 1)
tprintf(", %" PRI_kru, tcp->u_arg[2]);
tprintf(", %" PRI_klu, tcp->u_arg[2]);
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ SYS_FUNC(epoll_pwait)
tprints(", ");
/* NB: kernel requires arg[5] == NSIG / 8 */
print_sigset_addr_len(tcp, tcp->u_arg[4], tcp->u_arg[5]);
tprintf(", %" PRI_kru, tcp->u_arg[5]);
tprintf(", %" PRI_klu, tcp->u_arg[5]);
}
return 0;
}
2 changes: 1 addition & 1 deletion evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
# ifdef EVIOCREVOKE
case EVIOCREVOKE:
# endif
tprintf(", %" PRI_kru, arg);
tprintf(", %" PRI_klu, arg);
return 1;
# ifdef EVIOCSCLOCKID
case EVIOCSCLOCKID:
Expand Down
6 changes: 3 additions & 3 deletions fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ print_fcntl(struct tcb *tcp)
break;
case F_SETOWN:
case F_SETPIPE_SZ:
tprintf(", %" PRI_krd, tcp->u_arg[2]);
tprintf(", %" PRI_kld, tcp->u_arg[2]);
break;
case F_DUPFD:
case F_DUPFD_CLOEXEC:
tprintf(", %" PRI_krd, tcp->u_arg[2]);
tprintf(", %" PRI_kld, tcp->u_arg[2]);
return RVAL_DECODED | RVAL_FD;
case F_SETFL:
tprints(", ");
Expand Down Expand Up @@ -185,7 +185,7 @@ print_fcntl(struct tcb *tcp)
tcp->auxstr = signame(tcp->u_rval);
return RVAL_STR;
default:
tprintf(", %#" PRI_krx, tcp->u_arg[2]);
tprintf(", %#" PRI_klx, tcp->u_arg[2]);
break;
}
return RVAL_DECODED;
Expand Down
2 changes: 1 addition & 1 deletion fstatfs64.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SYS_FUNC(fstatfs64)
{
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
} else {
print_struct_statfs64(tcp, tcp->u_arg[2], tcp->u_arg[1]);
}
Expand Down
2 changes: 1 addition & 1 deletion getcwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SYS_FUNC(getcwd)
printaddr(tcp->u_arg[0]);
else
printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
tprintf(", %" PRI_kru, tcp->u_arg[1]);
tprintf(", %" PRI_klu, tcp->u_arg[1]);
}
return 0;
}
2 changes: 1 addition & 1 deletion getrandom.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SYS_FUNC(getrandom)
printaddr(tcp->u_arg[0]);
else
printstrn(tcp, tcp->u_arg[0], tcp->u_rval);
tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
printflags(getrandom_flags, tcp->u_arg[2], "GRND_???");
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion hostname.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SYS_FUNC(gethostname)
printaddr(tcp->u_arg[0]);
else
printstr(tcp, tcp->u_arg[0]);
tprintf(", %" PRI_kru, tcp->u_arg[1]);
tprintf(", %" PRI_klu, tcp->u_arg[1]);
}
return 0;
}
Expand Down
24 changes: 12 additions & 12 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SYS_FUNC(read)
printaddr(tcp->u_arg[1]);
else
printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
tprintf(", %" PRI_kru, tcp->u_arg[2]);
tprintf(", %" PRI_klu, tcp->u_arg[2]);
}
return 0;
}
Expand All @@ -52,7 +52,7 @@ SYS_FUNC(write)
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
tprintf(", %" PRI_kru, tcp->u_arg[2]);
tprintf(", %" PRI_klu, tcp->u_arg[2]);

return RVAL_DECODED;
}
Expand Down Expand Up @@ -101,7 +101,7 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
break;
}

tprintf(", iov_len=%" PRI_kru "}", iov[1]);
tprintf(", iov_len=%" PRI_klu "}", iov[1]);

return true;
}
Expand Down Expand Up @@ -132,7 +132,7 @@ SYS_FUNC(readv)
tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1],
syserror(tcp) ? IOV_DECODE_ADDR :
IOV_DECODE_STR, tcp->u_rval);
tprintf(", %" PRI_kru, tcp->u_arg[2]);
tprintf(", %" PRI_klu, tcp->u_arg[2]);
}
return 0;
}
Expand All @@ -142,7 +142,7 @@ SYS_FUNC(writev)
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR);
tprintf(", %" PRI_kru, tcp->u_arg[2]);
tprintf(", %" PRI_klu, tcp->u_arg[2]);

return RVAL_DECODED;
}
Expand All @@ -157,7 +157,7 @@ SYS_FUNC(pread)
printaddr(tcp->u_arg[1]);
else
printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
printllval(tcp, "%lld", 3);
}
return 0;
Expand All @@ -168,7 +168,7 @@ SYS_FUNC(pwrite)
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
printllval(tcp, "%lld", 3);

return RVAL_DECODED;
Expand All @@ -180,12 +180,12 @@ print_lld_from_low_high_val(struct tcb *tcp, int arg)
#if SIZEOF_LONG > 4 && SIZEOF_LONG == SIZEOF_LONG_LONG
# ifndef current_klongsize
if (current_klongsize < SIZEOF_LONG) {
tprintf("%" PRI_krd, (tcp->u_arg[arg + 1] << current_wordsize * 8)
tprintf("%" PRI_kld, (tcp->u_arg[arg + 1] << current_wordsize * 8)
| tcp->u_arg[arg]);
} else
# endif /* !current_klongsize */
{
tprintf("%" PRI_krd, tcp->u_arg[arg]);
tprintf("%" PRI_kld, tcp->u_arg[arg]);
}
#elif SIZEOF_LONG > 4
# error Unsupported configuration: SIZEOF_LONG > 4 && SIZEOF_LONG_LONG > SIZEOF_LONG
Expand Down Expand Up @@ -280,7 +280,7 @@ SYS_FUNC(tee)
printfd(tcp, tcp->u_arg[1]);
tprints(", ");
/* size_t len */
tprintf("%" PRI_kru ", ", tcp->u_arg[2]);
tprintf("%" PRI_klu ", ", tcp->u_arg[2]);
/* unsigned int flags */
printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");

Expand All @@ -302,7 +302,7 @@ SYS_FUNC(splice)
printnum_int64(tcp, tcp->u_arg[3], "%" PRId64);
tprints(", ");
/* size_t len */
tprintf("%" PRI_kru ", ", tcp->u_arg[4]);
tprintf("%" PRI_klu ", ", tcp->u_arg[4]);
/* unsigned int flags */
printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???");

Expand All @@ -316,7 +316,7 @@ SYS_FUNC(vmsplice)
tprints(", ");
/* const struct iovec *iov, unsigned long nr_segs */
tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR);
tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
/* unsigned int flags */
printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");

Expand Down
2 changes: 1 addition & 1 deletion ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ SYS_FUNC(ioctl)
if (ret)
--ret;
else
tprintf(", %#" PRI_krx, tcp->u_arg[2]);
tprintf(", %#" PRI_klx, tcp->u_arg[2]);
ret |= RVAL_DECODED;
} else {
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion ioperm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

SYS_FUNC(ioperm)
{
tprintf("%#" PRI_krx ", %#" PRI_krx ", %d",
tprintf("%#" PRI_klx ", %#" PRI_klx ", %d",
tcp->u_arg[0], tcp->u_arg[1], (int) tcp->u_arg[2]);

return RVAL_DECODED;
Expand Down
2 changes: 1 addition & 1 deletion ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SYS_FUNC(ipc)

unsigned int i;
for (i = 1; i < tcp->s_ent->nargs; ++i)
tprintf(", %#" PRI_krx, tcp->u_arg[i]);
tprintf(", %#" PRI_klx, tcp->u_arg[i]);

return RVAL_DECODED;
}
4 changes: 2 additions & 2 deletions ipc_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ tprint_msgrcv(struct tcb *const tcp, const kernel_ulong_t addr,
const kernel_ulong_t count, const kernel_ulong_t msgtyp)
{
tprint_msgbuf(tcp, addr, count);
tprintf("%" PRI_krd ", ", msgtyp);
tprintf("%" PRI_kld ", ", msgtyp);
}

static int
Expand Down Expand Up @@ -121,7 +121,7 @@ SYS_FUNC(msgrcv)
kernel_ulong_t pair[2];

if (fetch_msgrcv_args(tcp, tcp->u_arg[3], pair))
tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
else
tprint_msgrcv(tcp, pair[0],
tcp->u_arg[1], pair[1]);
Expand Down
2 changes: 1 addition & 1 deletion ipc_sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ SYS_FUNC(semctl)
) {
printnum_ptr(tcp, tcp->u_arg[3]);
} else {
tprintf("%#" PRI_krx, tcp->u_arg[3]);
tprintf("%#" PRI_klx, tcp->u_arg[3]);
}
return RVAL_DECODED;
}
2 changes: 1 addition & 1 deletion ipc_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SYS_FUNC(shmget)
tprintf("%#x", key);
else
tprints("IPC_PRIVATE");
tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
tprints("|");
print_numeric_umode_t(tcp->u_arg[2] & 0777);
Expand Down
6 changes: 3 additions & 3 deletions kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)

tprints("{buf=");
printaddr(seg[0]);
tprintf(", bufsz=%" PRI_kru ", mem=", seg[1]);
tprintf(", bufsz=%" PRI_klu ", mem=", seg[1]);
printaddr(seg[2]);
tprintf(", memsz=%" PRI_kru "}", seg[3]);
tprintf(", memsz=%" PRI_klu "}", seg[3]);

return true;
}
Expand All @@ -82,7 +82,7 @@ SYS_FUNC(kexec_load)
{
/* entry, nr_segments */
printaddr(tcp->u_arg[0]);
tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);

/* segments */
print_kexec_segments(tcp, tcp->u_arg[2], tcp->u_arg[1]);
Expand Down
2 changes: 1 addition & 1 deletion keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ SYS_FUNC(add_key)
tprints(", ");
printstrn(tcp, tcp->u_arg[2], tcp->u_arg[3]);
/* payload length */
tprintf(", %" PRI_kru ", ", tcp->u_arg[3]);
tprintf(", %" PRI_klu ", ", tcp->u_arg[3]);
/* keyring serial number */
print_keyring_serial_number(tcp->u_arg[4]);

Expand Down
4 changes: 2 additions & 2 deletions ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr)

SYS_FUNC(modify_ldt)
{
tprintf("%" PRI_krd ", ", tcp->u_arg[0]);
tprintf("%" PRI_kld ", ", tcp->u_arg[0]);
if (tcp->u_arg[2] != sizeof(struct user_desc))
printaddr(tcp->u_arg[1]);
else
print_user_desc(tcp, tcp->u_arg[1]);
tprintf(", %" PRI_kru, tcp->u_arg[2]);
tprintf(", %" PRI_klu, tcp->u_arg[2]);

return RVAL_DECODED;
}
Expand Down
2 changes: 1 addition & 1 deletion linux/x86_64/get_scno.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ arch_get_scno(struct tcb *tcp)
* Stracing of i386 apps is still supported.
*/
if (currpers == 0) {
error_msg("syscall_%" PRI_kru "(...) in unsupported "
error_msg("syscall_%" PRI_klu "(...) in unsupported "
"64-bit mode of process PID=%d", scno, tcp->pid);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ loop_ioctl(struct tcb *const tcp, const unsigned int code,

#ifdef LOOP_SET_DIRECT_IO
case LOOP_SET_DIRECT_IO:
tprintf(", %" PRI_kru, arg);
tprintf(", %" PRI_klu, arg);
break;
#endif

Expand Down
Loading

0 comments on commit 8963675

Please sign in to comment.