Browse Source

Print kernel_ureg_t and kernel_scno_t using dedicated format strings

Prepare for the change of kernel_ureg_t and kernel_scno_t from
unsigned long to kernel_ulong_t.

* defs.h (PRI_krd, PRI_kru, PRI_krx): New temporary macros.
All users updated.
Dmitry V. Levin 3 years ago
parent
commit
1d5bb61c49
51 changed files with 135 additions and 127 deletions
  1. 1
    1
      block.c
  2. 1
    1
      clone.c
  3. 1
    1
      copy_file_range.c
  4. 4
    0
      defs.h
  5. 1
    1
      dirent.c
  6. 1
    1
      epoll.c
  7. 1
    1
      evdev.c
  8. 3
    3
      fcntl.c
  9. 1
    1
      fstatfs64.c
  10. 2
    1
      futex.c
  11. 1
    1
      getcwd.c
  12. 1
    1
      getrandom.c
  13. 1
    1
      hostname.c
  14. 12
    12
      io.c
  15. 1
    1
      ioctl.c
  16. 1
    1
      ioperm.c
  17. 1
    1
      ipc.c
  18. 2
    2
      ipc_msg.c
  19. 1
    1
      ipc_sem.c
  20. 1
    1
      ipc_shm.c
  21. 3
    3
      kexec.c
  22. 1
    1
      keyctl.c
  23. 2
    2
      ldt.c
  24. 1
    1
      linux/x86_64/get_scno.c
  25. 1
    1
      loop.c
  26. 10
    10
      mem.c
  27. 1
    1
      mmsghdr.c
  28. 3
    3
      msghdr.c
  29. 7
    7
      net.c
  30. 7
    7
      numa.c
  31. 2
    2
      poll.c
  32. 1
    1
      print_msgbuf.c
  33. 1
    1
      print_timespec.c
  34. 2
    2
      print_timeval.c
  35. 2
    2
      process.c
  36. 4
    4
      process_vm.c
  37. 1
    1
      ptp.c
  38. 1
    1
      readahead.c
  39. 1
    1
      readlink.c
  40. 1
    1
      rtc.c
  41. 4
    4
      sendfile.c
  42. 1
    1
      sigaltstack.c
  43. 8
    8
      signal.c
  44. 1
    1
      signalfd.c
  45. 1
    1
      statfs64.c
  46. 12
    10
      syscall.c
  47. 1
    1
      syslog.c
  48. 4
    3
      sysmips.c
  49. 2
    2
      truncate.c
  50. 9
    9
      util.c
  51. 2
    2
      xattr.c

+ 1
- 1
block.c View File

@@ -150,7 +150,7 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
150 150
 	/* take arg as a value, not as a pointer */
151 151
 	case BLKRASET:
152 152
 	case BLKFRASET:
153
-		tprintf(", %lu", arg);
153
+		tprintf(", %" PRI_kru, arg);
154 154
 		break;
155 155
 
156 156
 	/* return an unsigned short */

+ 1
- 1
clone.c View File

@@ -104,7 +104,7 @@ SYS_FUNC(clone)
104 104
 		tprints(", ");
105 105
 #ifdef ARG_STACKSIZE
106 106
 		if (ARG_STACKSIZE != -1)
107
-			tprintf("stack_size=%#lx, ",
107
+			tprintf("stack_size=%#" PRI_krx ", ",
108 108
 				tcp->u_arg[ARG_STACKSIZE]);
109 109
 #endif
110 110
 		tprints("flags=");

+ 1
- 1
copy_file_range.c View File

@@ -42,7 +42,7 @@ SYS_FUNC(copy_file_range)
42 42
 	printnum_int64(tcp, tcp->u_arg[3], "%" PRId64);
43 43
 	tprints(", ");
44 44
 	/* size_t len */
45
-	tprintf("%lu, ", tcp->u_arg[4]);
45
+	tprintf("%" PRI_kru ", ", tcp->u_arg[4]);
46 46
 	/* unsigned int flags */
47 47
 	tprintf("%u", (unsigned int) tcp->u_arg[5]);
48 48
 

+ 4
- 0
defs.h View File

@@ -985,6 +985,10 @@ scno_is_valid(kernel_scno_t scno)
985 985
 #define PRI_klu PRI_kl"u"
986 986
 #define PRI_klx PRI_kl"x"
987 987
 
988
+#define PRI_krd "ld"
989
+#define PRI_kru "lu"
990
+#define PRI_krx "lx"
991
+
988 992
 /*
989 993
  * The kernel used to define 64-bit types on 64-bit systems on a per-arch
990 994
  * basis.  Some architectures would use unsigned long and others would use

+ 1
- 1
dirent.c View File

@@ -66,7 +66,7 @@ SYS_FUNC(readdir)
66 66
 			print_old_dirent(tcp, tcp->u_arg[1]);
67 67
 		/* Not much point in printing this out, it is always 1. */
68 68
 		if (tcp->u_arg[2] != 1)
69
-			tprintf(", %lu", tcp->u_arg[2]);
69
+			tprintf(", %" PRI_kru, tcp->u_arg[2]);
70 70
 	}
71 71
 	return 0;
72 72
 }

+ 1
- 1
epoll.c View File

@@ -111,7 +111,7 @@ SYS_FUNC(epoll_pwait)
111 111
 		tprints(", ");
112 112
 		/* NB: kernel requires arg[5] == NSIG / 8 */
113 113
 		print_sigset_addr_len(tcp, tcp->u_arg[4], tcp->u_arg[5]);
114
-		tprintf(", %lu", tcp->u_arg[5]);
114
+		tprintf(", %" PRI_kru, tcp->u_arg[5]);
115 115
 	}
116 116
 	return 0;
117 117
 }

+ 1
- 1
evdev.c View File

@@ -497,7 +497,7 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
497 497
 # ifdef EVIOCREVOKE
498 498
 		case EVIOCREVOKE:
499 499
 # endif
500
-			tprintf(", %lu", arg);
500
+			tprintf(", %" PRI_kru, arg);
501 501
 			return 1;
502 502
 # ifdef EVIOCSCLOCKID
503 503
 		case EVIOCSCLOCKID:

+ 3
- 3
fcntl.c View File

@@ -96,11 +96,11 @@ print_fcntl(struct tcb *tcp)
96 96
 		break;
97 97
 	case F_SETOWN:
98 98
 	case F_SETPIPE_SZ:
99
-		tprintf(", %ld", tcp->u_arg[2]);
99
+		tprintf(", %" PRI_krd, tcp->u_arg[2]);
100 100
 		break;
101 101
 	case F_DUPFD:
102 102
 	case F_DUPFD_CLOEXEC:
103
-		tprintf(", %ld", tcp->u_arg[2]);
103
+		tprintf(", %" PRI_krd, tcp->u_arg[2]);
104 104
 		return RVAL_DECODED | RVAL_FD;
105 105
 	case F_SETFL:
106 106
 		tprints(", ");
@@ -185,7 +185,7 @@ print_fcntl(struct tcb *tcp)
185 185
 		tcp->auxstr = signame(tcp->u_rval);
186 186
 		return RVAL_STR;
187 187
 	default:
188
-		tprintf(", %#lx", tcp->u_arg[2]);
188
+		tprintf(", %#" PRI_krx, tcp->u_arg[2]);
189 189
 		break;
190 190
 	}
191 191
 	return RVAL_DECODED;

+ 1
- 1
fstatfs64.c View File

@@ -4,7 +4,7 @@ SYS_FUNC(fstatfs64)
4 4
 {
5 5
 	if (entering(tcp)) {
6 6
 		printfd(tcp, tcp->u_arg[0]);
7
-		tprintf(", %lu, ", tcp->u_arg[1]);
7
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
8 8
 	} else {
9 9
 		print_struct_statfs64(tcp, tcp->u_arg[2], tcp->u_arg[1]);
10 10
 	}

+ 2
- 1
futex.c View File

@@ -121,7 +121,8 @@ SYS_FUNC(futex)
121 121
 		break;
122 122
 	default:
123 123
 		tprintf(", %u", val);
124
-		tprintf(", %#lx", timeout);
124
+		tprints(", ");
125
+		printaddr(timeout);
125 126
 		tprints(", ");
126 127
 		printaddr(uaddr2);
127 128
 		tprintf(", %#x", val3);

+ 1
- 1
getcwd.c View File

@@ -7,7 +7,7 @@ SYS_FUNC(getcwd)
7 7
 			printaddr(tcp->u_arg[0]);
8 8
 		else
9 9
 			printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
10
-		tprintf(", %lu", tcp->u_arg[1]);
10
+		tprintf(", %" PRI_kru, tcp->u_arg[1]);
11 11
 	}
12 12
 	return 0;
13 13
 }

+ 1
- 1
getrandom.c View File

@@ -8,7 +8,7 @@ SYS_FUNC(getrandom)
8 8
 			printaddr(tcp->u_arg[0]);
9 9
 		else
10 10
 			printstrn(tcp, tcp->u_arg[0], tcp->u_rval);
11
-		tprintf(", %lu, ", tcp->u_arg[1]);
11
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
12 12
 		printflags(getrandom_flags, tcp->u_arg[2], "GRND_???");
13 13
 	}
14 14
 	return 0;

+ 1
- 1
hostname.c View File

@@ -31,7 +31,7 @@ SYS_FUNC(gethostname)
31 31
 			printaddr(tcp->u_arg[0]);
32 32
 		else
33 33
 			printstr(tcp, tcp->u_arg[0]);
34
-		tprintf(", %lu", tcp->u_arg[1]);
34
+		tprintf(", %" PRI_kru, tcp->u_arg[1]);
35 35
 	}
36 36
 	return 0;
37 37
 }

+ 12
- 12
io.c View File

@@ -42,7 +42,7 @@ SYS_FUNC(read)
42 42
 			printaddr(tcp->u_arg[1]);
43 43
 		else
44 44
 			printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
45
-		tprintf(", %lu", tcp->u_arg[2]);
45
+		tprintf(", %" PRI_kru, tcp->u_arg[2]);
46 46
 	}
47 47
 	return 0;
48 48
 }
@@ -52,7 +52,7 @@ SYS_FUNC(write)
52 52
 	printfd(tcp, tcp->u_arg[0]);
53 53
 	tprints(", ");
54 54
 	printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
55
-	tprintf(", %lu", tcp->u_arg[2]);
55
+	tprintf(", %" PRI_kru, tcp->u_arg[2]);
56 56
 
57 57
 	return RVAL_DECODED;
58 58
 }
@@ -101,7 +101,7 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
101 101
 			break;
102 102
 	}
103 103
 
104
-	tprintf(", iov_len=%lu}", iov[1]);
104
+	tprintf(", iov_len=%" PRI_kru "}", iov[1]);
105 105
 
106 106
 	return true;
107 107
 }
@@ -132,7 +132,7 @@ SYS_FUNC(readv)
132 132
 		tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1],
133 133
 				syserror(tcp) ? IOV_DECODE_ADDR :
134 134
 				IOV_DECODE_STR, tcp->u_rval);
135
-		tprintf(", %lu", tcp->u_arg[2]);
135
+		tprintf(", %" PRI_kru, tcp->u_arg[2]);
136 136
 	}
137 137
 	return 0;
138 138
 }
@@ -142,7 +142,7 @@ SYS_FUNC(writev)
142 142
 	printfd(tcp, tcp->u_arg[0]);
143 143
 	tprints(", ");
144 144
 	tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR);
145
-	tprintf(", %lu", tcp->u_arg[2]);
145
+	tprintf(", %" PRI_kru, tcp->u_arg[2]);
146 146
 
147 147
 	return RVAL_DECODED;
148 148
 }
@@ -157,7 +157,7 @@ SYS_FUNC(pread)
157 157
 			printaddr(tcp->u_arg[1]);
158 158
 		else
159 159
 			printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
160
-		tprintf(", %lu, ", tcp->u_arg[2]);
160
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
161 161
 		printllval(tcp, "%lld", 3);
162 162
 	}
163 163
 	return 0;
@@ -168,7 +168,7 @@ SYS_FUNC(pwrite)
168 168
 	printfd(tcp, tcp->u_arg[0]);
169 169
 	tprints(", ");
170 170
 	printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
171
-	tprintf(", %lu, ", tcp->u_arg[2]);
171
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
172 172
 	printllval(tcp, "%lld", 3);
173 173
 
174 174
 	return RVAL_DECODED;
@@ -180,12 +180,12 @@ print_lld_from_low_high_val(struct tcb *tcp, int arg)
180 180
 #if SIZEOF_LONG > 4 && SIZEOF_LONG == SIZEOF_LONG_LONG
181 181
 # ifndef current_klongsize
182 182
 	if (current_klongsize < SIZEOF_LONG) {
183
-		tprintf("%ld", (tcp->u_arg[arg + 1] << current_wordsize * 8)
183
+		tprintf("%" PRI_krd, (tcp->u_arg[arg + 1] << current_wordsize * 8)
184 184
 			       | tcp->u_arg[arg]);
185 185
 	} else
186 186
 # endif /* !current_klongsize */
187 187
 	{
188
-		tprintf("%ld", tcp->u_arg[arg]);
188
+		tprintf("%" PRI_krd, tcp->u_arg[arg]);
189 189
 	}
190 190
 #elif SIZEOF_LONG > 4
191 191
 # error Unsupported configuration: SIZEOF_LONG > 4 && SIZEOF_LONG_LONG > SIZEOF_LONG
@@ -280,7 +280,7 @@ SYS_FUNC(tee)
280 280
 	printfd(tcp, tcp->u_arg[1]);
281 281
 	tprints(", ");
282 282
 	/* size_t len */
283
-	tprintf("%lu, ", tcp->u_arg[2]);
283
+	tprintf("%" PRI_kru ", ", tcp->u_arg[2]);
284 284
 	/* unsigned int flags */
285 285
 	printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
286 286
 
@@ -302,7 +302,7 @@ SYS_FUNC(splice)
302 302
 	printnum_int64(tcp, tcp->u_arg[3], "%" PRId64);
303 303
 	tprints(", ");
304 304
 	/* size_t len */
305
-	tprintf("%lu, ", tcp->u_arg[4]);
305
+	tprintf("%" PRI_kru ", ", tcp->u_arg[4]);
306 306
 	/* unsigned int flags */
307 307
 	printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???");
308 308
 
@@ -316,7 +316,7 @@ SYS_FUNC(vmsplice)
316 316
 	tprints(", ");
317 317
 	/* const struct iovec *iov, unsigned long nr_segs */
318 318
 	tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR);
319
-	tprintf(", %lu, ", tcp->u_arg[2]);
319
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
320 320
 	/* unsigned int flags */
321 321
 	printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
322 322
 

+ 1
- 1
ioctl.c View File

@@ -323,7 +323,7 @@ SYS_FUNC(ioctl)
323 323
 		if (ret)
324 324
 			--ret;
325 325
 		else
326
-			tprintf(", %#lx", tcp->u_arg[2]);
326
+			tprintf(", %#" PRI_krx, tcp->u_arg[2]);
327 327
 		ret |= RVAL_DECODED;
328 328
 	} else {
329 329
 		if (ret)

+ 1
- 1
ioperm.c View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 SYS_FUNC(ioperm)
4 4
 {
5
-	tprintf("%#lx, %#lx, %d",
5
+	tprintf("%#" PRI_krx ", %#" PRI_krx ", %d",
6 6
 		tcp->u_arg[0], tcp->u_arg[1], (int) tcp->u_arg[2]);
7 7
 
8 8
 	return RVAL_DECODED;

+ 1
- 1
ipc.c View File

@@ -45,7 +45,7 @@ SYS_FUNC(ipc)
45 45
 
46 46
 	unsigned int i;
47 47
 	for (i = 1; i < tcp->s_ent->nargs; ++i)
48
-		tprintf(", %#lx", tcp->u_arg[i]);
48
+		tprintf(", %#" PRI_krx, tcp->u_arg[i]);
49 49
 
50 50
 	return RVAL_DECODED;
51 51
 }

+ 2
- 2
ipc_msg.c View File

@@ -82,7 +82,7 @@ tprint_msgrcv(struct tcb *const tcp, const kernel_ureg_t addr,
82 82
 	      const kernel_ureg_t count, const kernel_ureg_t msgtyp)
83 83
 {
84 84
 	tprint_msgbuf(tcp, addr, count);
85
-	tprintf("%ld, ", msgtyp);
85
+	tprintf("%" PRI_krd ", ", msgtyp);
86 86
 }
87 87
 
88 88
 static int
@@ -121,7 +121,7 @@ SYS_FUNC(msgrcv)
121 121
 				kernel_ureg_t pair[2];
122 122
 
123 123
 				if (fetch_msgrcv_args(tcp, tcp->u_arg[3], pair))
124
-					tprintf(", %lu, ", tcp->u_arg[1]);
124
+					tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
125 125
 				else
126 126
 					tprint_msgrcv(tcp, pair[0],
127 127
 						      tcp->u_arg[1], pair[1]);

+ 1
- 1
ipc_sem.c View File

@@ -126,7 +126,7 @@ SYS_FUNC(semctl)
126 126
 	   ) {
127 127
 		printnum_ptr(tcp, tcp->u_arg[3]);
128 128
 	} else {
129
-		tprintf("%#lx", tcp->u_arg[3]);
129
+		tprintf("%#" PRI_krx, tcp->u_arg[3]);
130 130
 	}
131 131
 	return RVAL_DECODED;
132 132
 }

+ 1
- 1
ipc_shm.c View File

@@ -48,7 +48,7 @@ SYS_FUNC(shmget)
48 48
 		tprintf("%#x", key);
49 49
 	else
50 50
 		tprints("IPC_PRIVATE");
51
-	tprintf(", %lu, ", tcp->u_arg[1]);
51
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
52 52
 	if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
53 53
 		tprints("|");
54 54
 	print_numeric_umode_t(tcp->u_arg[2] & 0777);

+ 3
- 3
kexec.c View File

@@ -55,9 +55,9 @@ print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
55 55
 
56 56
 	tprints("{buf=");
57 57
 	printaddr(seg[0]);
58
-	tprintf(", bufsz=%lu, mem=", seg[1]);
58
+	tprintf(", bufsz=%" PRI_kru ", mem=", seg[1]);
59 59
 	printaddr(seg[2]);
60
-	tprintf(", memsz=%lu}", seg[3]);
60
+	tprintf(", memsz=%" PRI_kru "}", seg[3]);
61 61
 
62 62
 	return true;
63 63
 }
@@ -82,7 +82,7 @@ SYS_FUNC(kexec_load)
82 82
 {
83 83
 	/* entry, nr_segments */
84 84
 	printaddr(tcp->u_arg[0]);
85
-	tprintf(", %lu, ", tcp->u_arg[1]);
85
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
86 86
 
87 87
 	/* segments */
88 88
 	print_kexec_segments(tcp, tcp->u_arg[2], tcp->u_arg[1]);

+ 1
- 1
keyctl.c View File

@@ -59,7 +59,7 @@ SYS_FUNC(add_key)
59 59
 	tprints(", ");
60 60
 	printstrn(tcp, tcp->u_arg[2], tcp->u_arg[3]);
61 61
 	/* payload length */
62
-	tprintf(", %lu, ", tcp->u_arg[3]);
62
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[3]);
63 63
 	/* keyring serial number */
64 64
 	print_keyring_serial_number(tcp->u_arg[4]);
65 65
 

+ 2
- 2
ldt.c View File

@@ -67,12 +67,12 @@ print_user_desc(struct tcb *const tcp, const kernel_ureg_t addr)
67 67
 
68 68
 SYS_FUNC(modify_ldt)
69 69
 {
70
-	tprintf("%ld, ", tcp->u_arg[0]);
70
+	tprintf("%" PRI_krd ", ", tcp->u_arg[0]);
71 71
 	if (tcp->u_arg[2] != sizeof(struct user_desc))
72 72
 		printaddr(tcp->u_arg[1]);
73 73
 	else
74 74
 		print_user_desc(tcp, tcp->u_arg[1]);
75
-	tprintf(", %lu", tcp->u_arg[2]);
75
+	tprintf(", %" PRI_kru, tcp->u_arg[2]);
76 76
 
77 77
 	return RVAL_DECODED;
78 78
 }

+ 1
- 1
linux/x86_64/get_scno.c View File

@@ -141,7 +141,7 @@ arch_get_scno(struct tcb *tcp)
141 141
 	 * Stracing of i386 apps is still supported.
142 142
 	 */
143 143
 	if (currpers == 0) {
144
-		error_msg("syscall_%lu(...) in unsupported "
144
+		error_msg("syscall_%" PRI_kru "(...) in unsupported "
145 145
 			  "64-bit mode of process PID=%d", scno, tcp->pid);
146 146
 		return 0;
147 147
 	}

+ 1
- 1
loop.c View File

@@ -190,7 +190,7 @@ loop_ioctl(struct tcb *const tcp, const unsigned int code,
190 190
 
191 191
 #ifdef LOOP_SET_DIRECT_IO
192 192
 	case LOOP_SET_DIRECT_IO:
193
-		tprintf(", %lu", arg);
193
+		tprintf(", %" PRI_kru, arg);
194 194
 		break;
195 195
 #endif
196 196
 

+ 10
- 10
mem.c View File

@@ -64,7 +64,7 @@ print_mmap(struct tcb *tcp, kernel_ureg_t *u_arg, unsigned long long offset)
64 64
 	const int fd = u_arg[4];
65 65
 
66 66
 	printaddr(addr);
67
-	tprintf(", %lu, ", len);
67
+	tprintf(", %" PRI_kru ", ", len);
68 68
 	printflags64(mmap_prot, prot, "PROT_???");
69 69
 	tprints(", ");
70 70
 #ifdef MAP_TYPE
@@ -177,7 +177,7 @@ SYS_FUNC(mmap_4koff)
177 177
 SYS_FUNC(munmap)
178 178
 {
179 179
 	printaddr(tcp->u_arg[0]);
180
-	tprintf(", %lu", tcp->u_arg[1]);
180
+	tprintf(", %" PRI_kru, tcp->u_arg[1]);
181 181
 
182 182
 	return RVAL_DECODED;
183 183
 }
@@ -210,7 +210,7 @@ SYS_FUNC(pkey_mprotect)
210 210
 SYS_FUNC(mremap)
211 211
 {
212 212
 	printaddr(tcp->u_arg[0]);
213
-	tprintf(", %lu, %lu, ", tcp->u_arg[1], tcp->u_arg[2]);
213
+	tprintf(", %" PRI_kru ", %" PRI_kru ", ", tcp->u_arg[1], tcp->u_arg[2]);
214 214
 	printflags64(mremap_flags, tcp->u_arg[3], "MREMAP_???");
215 215
 #ifdef MREMAP_FIXED
216 216
 	if ((tcp->u_arg[3] & (MREMAP_MAYMOVE | MREMAP_FIXED)) ==
@@ -227,7 +227,7 @@ SYS_FUNC(mremap)
227 227
 SYS_FUNC(madvise)
228 228
 {
229 229
 	printaddr(tcp->u_arg[0]);
230
-	tprintf(", %lu, ", tcp->u_arg[1]);
230
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
231 231
 	printxval(madvise_cmds, tcp->u_arg[2], "MADV_???");
232 232
 
233 233
 	return RVAL_DECODED;
@@ -249,7 +249,7 @@ SYS_FUNC(msync)
249 249
 	/* addr */
250 250
 	printaddr(tcp->u_arg[0]);
251 251
 	/* len */
252
-	tprintf(", %lu, ", tcp->u_arg[1]);
252
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
253 253
 	/* flags */
254 254
 	printflags(mctl_sync, tcp->u_arg[2], "MS_???");
255 255
 
@@ -261,7 +261,7 @@ SYS_FUNC(msync)
261 261
 SYS_FUNC(mlock2)
262 262
 {
263 263
 	printaddr(tcp->u_arg[0]);
264
-	tprintf(", %lu, ", tcp->u_arg[1]);
264
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
265 265
 	printflags(mlock_flags, tcp->u_arg[2], "MLOCK_???");
266 266
 
267 267
 	return RVAL_DECODED;
@@ -271,7 +271,7 @@ SYS_FUNC(mincore)
271 271
 {
272 272
 	if (entering(tcp)) {
273 273
 		printaddr(tcp->u_arg[0]);
274
-		tprintf(", %lu, ", tcp->u_arg[1]);
274
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
275 275
 	} else {
276 276
 		const unsigned long page_size = get_pagesize();
277 277
 		const unsigned long page_mask = page_size - 1;
@@ -319,9 +319,9 @@ SYS_FUNC(remap_file_pages)
319 319
 	const kernel_ureg_t flags = tcp->u_arg[4];
320 320
 
321 321
 	printaddr(addr);
322
-	tprintf(", %lu, ", size);
322
+	tprintf(", %" PRI_kru ", ", size);
323 323
 	printflags64(mmap_prot, prot, "PROT_???");
324
-	tprintf(", %lu, ", pgoff);
324
+	tprintf(", %" PRI_kru ", ", pgoff);
325 325
 #ifdef MAP_TYPE
326 326
 	printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???");
327 327
 	addflags(mmap_flags, flags & ~MAP_TYPE);
@@ -349,7 +349,7 @@ SYS_FUNC(subpage_prot)
349 349
 	kernel_ureg_t map = tcp->u_arg[2];
350 350
 
351 351
 	printaddr(addr);
352
-	tprintf(", %lu, ", len);
352
+	tprintf(", %" PRI_kru ", ", len);
353 353
 
354 354
 	unsigned int entry;
355 355
 	print_array(tcp, map, nmemb, &entry, sizeof(entry),

+ 1
- 1
mmsghdr.c View File

@@ -159,7 +159,7 @@ dumpiov_in_mmsghdr(struct tcb *const tcp, kernel_ureg_t addr)
159 159
 		fetched = fetch_struct_mmsghdr(tcp, addr, &mmsg);
160 160
 		if (!fetched)
161 161
 			break;
162
-		tprintf(" = %lu buffers in vector %u\n",
162
+		tprintf(" = %" PRI_kru " buffers in vector %u\n",
163 163
 			(kernel_ureg_t) mmsg.msg_hdr.msg_iovlen, i);
164 164
 		dumpiov_upto(tcp, mmsg.msg_hdr.msg_iovlen,
165 165
 			     ptr_to_kulong(mmsg.msg_hdr.msg_iov),

+ 3
- 3
msghdr.c View File

@@ -297,7 +297,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ureg_t addr,
297 297
 
298 298
 		if (u.ptr != buf)
299 299
 			tprints(", ");
300
-		tprintf("{cmsg_len=%lu, cmsg_level=", (unsigned long) cmsg_len);
300
+		tprintf("{cmsg_len=%" PRI_kru ", cmsg_level=", cmsg_len);
301 301
 		printxval(socketlayers, cmsg_level, "SOL_???");
302 302
 		tprints(", cmsg_type=");
303 303
 
@@ -355,11 +355,11 @@ print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg,
355 355
 
356 356
 	tprint_iov_upto(tcp, msg->msg_iovlen,
357 357
 			ptr_to_kulong(msg->msg_iov), decode, data_size);
358
-	tprintf(", msg_iovlen=%lu", (kernel_ureg_t) msg->msg_iovlen);
358
+	tprintf(", msg_iovlen=%" PRI_kru, (kernel_ureg_t) msg->msg_iovlen);
359 359
 
360 360
 	decode_msg_control(tcp, ptr_to_kulong(msg->msg_control),
361 361
 			   msg->msg_controllen);
362
-	tprintf(", msg_controllen=%lu", (kernel_ureg_t) msg->msg_controllen);
362
+	tprintf(", msg_controllen=%" PRI_kru, (kernel_ureg_t) msg->msg_controllen);
363 363
 
364 364
 	tprints(", msg_flags=");
365 365
 	printflags(msg_flags, msg->msg_flags, "MSG_???");

+ 7
- 7
net.c View File

@@ -159,7 +159,7 @@ SYS_FUNC(socket)
159 159
 #endif
160 160
 
161 161
 	default:
162
-		tprintf("%lu", tcp->u_arg[2]);
162
+		tprintf("%" PRI_kru, tcp->u_arg[2]);
163 163
 		break;
164 164
 	}
165 165
 
@@ -181,7 +181,7 @@ SYS_FUNC(listen)
181 181
 {
182 182
 	printfd(tcp, tcp->u_arg[0]);
183 183
 	tprints(", ");
184
-	tprintf("%lu", tcp->u_arg[1]);
184
+	tprintf("%" PRI_kru, tcp->u_arg[1]);
185 185
 
186 186
 	return RVAL_DECODED;
187 187
 }
@@ -251,7 +251,7 @@ SYS_FUNC(send)
251 251
 	printfd(tcp, tcp->u_arg[0]);
252 252
 	tprints(", ");
253 253
 	decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
254
-	tprintf(", %lu, ", tcp->u_arg[2]);
254
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
255 255
 	/* flags */
256 256
 	printflags(msg_flags, tcp->u_arg[3], "MSG_???");
257 257
 
@@ -263,7 +263,7 @@ SYS_FUNC(sendto)
263 263
 	printfd(tcp, tcp->u_arg[0]);
264 264
 	tprints(", ");
265 265
 	decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
266
-	tprintf(", %lu, ", tcp->u_arg[2]);
266
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
267 267
 	/* flags */
268 268
 	printflags(msg_flags, tcp->u_arg[3], "MSG_???");
269 269
 	/* to address */
@@ -289,7 +289,7 @@ SYS_FUNC(recv)
289 289
 				     tcp->u_rval);
290 290
 		}
291 291
 
292
-		tprintf(", %lu, ", tcp->u_arg[2]);
292
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
293 293
 		printflags(msg_flags, tcp->u_arg[3], "MSG_???");
294 294
 	}
295 295
 	return 0;
@@ -314,7 +314,7 @@ SYS_FUNC(recvfrom)
314 314
 				     tcp->u_rval);
315 315
 		}
316 316
 		/* size */
317
-		tprintf(", %lu, ", tcp->u_arg[2]);
317
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
318 318
 		/* flags */
319 319
 		printflags(msg_flags, tcp->u_arg[3], "MSG_???");
320 320
 		tprints(", ");
@@ -419,7 +419,7 @@ SYS_FUNC(socketpair)
419 419
 		printxval(addrfams, tcp->u_arg[0], "AF_???");
420 420
 		tprints(", ");
421 421
 		tprint_sock_type(tcp->u_arg[1]);
422
-		tprintf(", %lu", tcp->u_arg[2]);
422
+		tprintf(", %" PRI_kru, tcp->u_arg[2]);
423 423
 	} else {
424 424
 		tprints(", ");
425 425
 		decode_pair_fd(tcp, tcp->u_arg[3]);

+ 7
- 7
numa.c View File

@@ -35,7 +35,7 @@ print_node(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
35 35
 		tprintf("%#0*x", (int) elem_size * 2 + 2,
36 36
 			* (unsigned int *) elem_buf);
37 37
 	} else {
38
-		tprintf("%#0*lx", (int) elem_size * 2 + 2,
38
+		tprintf("%#0*" PRI_krx, (int) elem_size * 2 + 2,
39 39
 			* (kernel_ureg_t *) elem_buf);
40 40
 	}
41 41
 
@@ -63,7 +63,7 @@ print_nodemask(struct tcb *const tcp, const kernel_ureg_t addr,
63 63
 
64 64
 SYS_FUNC(migrate_pages)
65 65
 {
66
-	tprintf("%d, %lu, ", (int) tcp->u_arg[0], tcp->u_arg[1]);
66
+	tprintf("%d, %" PRI_kru ", ", (int) tcp->u_arg[0], tcp->u_arg[1]);
67 67
 	print_nodemask(tcp, tcp->u_arg[2], tcp->u_arg[1]);
68 68
 	tprints(", ");
69 69
 	print_nodemask(tcp, tcp->u_arg[3], tcp->u_arg[1]);
@@ -77,11 +77,11 @@ SYS_FUNC(migrate_pages)
77 77
 SYS_FUNC(mbind)
78 78
 {
79 79
 	printaddr(tcp->u_arg[0]);
80
-	tprintf(", %lu, ", tcp->u_arg[1]);
80
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
81 81
 	printxval64(policies, tcp->u_arg[2], "MPOL_???");
82 82
 	tprints(", ");
83 83
 	print_nodemask(tcp, tcp->u_arg[3], tcp->u_arg[4]);
84
-	tprintf(", %lu, ", tcp->u_arg[4]);
84
+	tprintf(", %" PRI_kru ", ", tcp->u_arg[4]);
85 85
 	printflags(mbindflags, tcp->u_arg[5], "MPOL_???");
86 86
 
87 87
 	return RVAL_DECODED;
@@ -92,7 +92,7 @@ SYS_FUNC(set_mempolicy)
92 92
 	printxval(policies, tcp->u_arg[0], "MPOL_???");
93 93
 	tprints(", ");
94 94
 	print_nodemask(tcp, tcp->u_arg[1], tcp->u_arg[2]);
95
-	tprintf(", %lu", tcp->u_arg[2]);
95
+	tprintf(", %" PRI_kru, tcp->u_arg[2]);
96 96
 
97 97
 	return RVAL_DECODED;
98 98
 }
@@ -110,7 +110,7 @@ SYS_FUNC(get_mempolicy)
110 110
 		}
111 111
 		tprints(", ");
112 112
 		print_nodemask(tcp, tcp->u_arg[1], tcp->u_arg[2]);
113
-		tprintf(", %lu, ", tcp->u_arg[2]);
113
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[2]);
114 114
 		printaddr(tcp->u_arg[3]);
115 115
 		tprints(", ");
116 116
 		printflags64(mempolicyflags, tcp->u_arg[4], "MPOL_???");
@@ -163,7 +163,7 @@ SYS_FUNC(move_pages)
163 163
 	kernel_ureg_t buf;
164 164
 
165 165
 	if (entering(tcp)) {
166
-		tprintf("%d, %lu, ", (int) tcp->u_arg[0], npages);
166
+		tprintf("%d, %" PRI_kru ", ", (int) tcp->u_arg[0], npages);
167 167
 		print_array(tcp, tcp->u_arg[2], npages, &buf, current_wordsize,
168 168
 			    umoven_or_printaddr, print_addr, 0);
169 169
 		tprints(", ");

+ 2
- 2
poll.c View File

@@ -95,7 +95,7 @@ decode_poll_exiting(struct tcb *const tcp, const kernel_ureg_t pts)
95 95
 				*outptr++ = '[';
96 96
 			else
97 97
 				outptr = stpcpy(outptr, ", ");
98
-			outptr += sprintf(outptr, "%#lx", cur);
98
+			outptr += sprintf(outptr, "%#" PRI_krx, cur);
99 99
 			break;
100 100
 		}
101 101
 		if (!fds.revents)
@@ -178,7 +178,7 @@ SYS_FUNC(ppoll)
178 178
 		tprints(", ");
179 179
 		/* NB: kernel requires arg[4] == NSIG / 8 */
180 180
 		print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]);
181
-		tprintf(", %lu", tcp->u_arg[4]);
181
+		tprintf(", %" PRI_kru, tcp->u_arg[4]);
182 182
 
183 183
 		return 0;
184 184
 	} else {

+ 1
- 1
print_msgbuf.c View File

@@ -48,5 +48,5 @@ MPERS_PRINTER_DECL(void, tprint_msgbuf, struct tcb *const tcp,
48 48
 		printstrn(tcp, addr + sizeof(msg.mtype), count);
49 49
 		tprints("}");
50 50
 	}
51
-	tprintf(", %lu, ", count);
51
+	tprintf(", %" PRI_kru ", ", count);
52 52
 }

+ 1
- 1
print_timespec.c View File

@@ -85,7 +85,7 @@ MPERS_PRINTER_DECL(const char *, sprint_timespec,
85 85
 		strcpy(buf, "NULL");
86 86
 	} else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
87 87
 		   umove(tcp, addr, &t)) {
88
-		snprintf(buf, sizeof(buf), "%#lx", addr);
88
+		snprintf(buf, sizeof(buf), "%#" PRI_krx, addr);
89 89
 	} else {
90 90
 		snprintf(buf, sizeof(buf), timespec_fmt,
91 91
 			 (intmax_t) t.tv_sec, (intmax_t) t.tv_nsec);

+ 2
- 2
print_timeval.c View File

@@ -86,7 +86,7 @@ MPERS_PRINTER_DECL(const char *, sprint_timeval,
86 86
 		strcpy(buf, "NULL");
87 87
 	} else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
88 88
 		   umove(tcp, addr, &t)) {
89
-		snprintf(buf, sizeof(buf), "%#lx", addr);
89
+		snprintf(buf, sizeof(buf), "%#" PRI_krx, addr);
90 90
 	} else {
91 91
 		snprintf(buf, sizeof(buf), timeval_fmt,
92 92
 			 (intmax_t) t.tv_sec, (intmax_t) t.tv_usec);
@@ -169,7 +169,7 @@ sprint_timeval32(struct tcb *const tcp, const kernel_ureg_t addr)
169 169
 		strcpy(buf, "NULL");
170 170
 	} else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
171 171
 		   umove(tcp, addr, &t)) {
172
-		snprintf(buf, sizeof(buf), "%#lx", addr);
172
+		snprintf(buf, sizeof(buf), "%#" PRI_krx, addr);
173 173
 	} else {
174 174
 		snprintf(buf, sizeof(buf), timeval_fmt,
175 175
 			 (intmax_t) t.tv_sec, (intmax_t) t.tv_usec);

+ 2
- 2
process.c View File

@@ -73,7 +73,7 @@ print_user_offset_addr(const kernel_ureg_t addr)
73 73
 			printaddr(addr);
74 74
 		} else {
75 75
 			--x;
76
-			tprintf("%s + %lu",
76
+			tprintf("%s + %" PRI_kru,
77 77
 				x->str, addr - (kernel_ureg_t) x->val);
78 78
 		}
79 79
 	} else {
@@ -121,7 +121,7 @@ SYS_FUNC(ptrace)
121 121
 		case PTRACE_GETSIGMASK:
122 122
 		case PTRACE_SETSIGMASK:
123 123
 		case PTRACE_SECCOMP_GET_FILTER:
124
-			tprintf(", %lu", addr);
124
+			tprintf(", %" PRI_kru, addr);
125 125
 			break;
126 126
 		case PTRACE_PEEKSIGINFO: {
127 127
 			tprints(", ");

+ 4
- 4
process_vm.c View File

@@ -43,13 +43,13 @@ SYS_FUNC(process_vm_readv)
43 43
 			   syserror(tcp) ? IOV_DECODE_ADDR : IOV_DECODE_STR,
44 44
 			   tcp->u_rval);
45 45
 		/* arg 3: local iovcnt */
46
-		tprintf(", %lu, ", local_iovcnt);
46
+		tprintf(", %" PRI_kru ", ", local_iovcnt);
47 47
 		/* arg 4: remote iov */
48 48
 		tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3],
49 49
 			   IOV_DECODE_ADDR);
50 50
 		/* arg 5: remote iovcnt */
51 51
 		/* arg 6: flags */
52
-		tprintf(", %lu, %lu", remote_iovcnt, flags);
52
+		tprintf(", %" PRI_kru ", %" PRI_kru, remote_iovcnt, flags);
53 53
 	}
54 54
 	return 0;
55 55
 }
@@ -65,12 +65,12 @@ SYS_FUNC(process_vm_writev)
65 65
 	/* arg 2: local iov */
66 66
 	tprint_iov(tcp, local_iovcnt, tcp->u_arg[1], IOV_DECODE_STR);
67 67
 	/* arg 3: local iovcnt */
68
-	tprintf(", %lu, ", local_iovcnt);
68
+	tprintf(", %" PRI_kru ", ", local_iovcnt);
69 69
 	/* arg 4: remote iov */
70 70
 	tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3], IOV_DECODE_ADDR);
71 71
 	/* arg 5: remote iovcnt */
72 72
 	/* arg 6: flags */
73
-	tprintf(", %lu, %lu", remote_iovcnt, flags);
73
+	tprintf(", %" PRI_kru ", %" PRI_kru, remote_iovcnt, flags);
74 74
 
75 75
 	return RVAL_DECODED;
76 76
 }

+ 1
- 1
ptp.c View File

@@ -72,7 +72,7 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code,
72 72
 	}
73 73
 
74 74
 	case PTP_ENABLE_PPS:
75
-		tprintf(", %ld", arg);
75
+		tprintf(", %" PRI_krd, arg);
76 76
 		break;
77 77
 
78 78
 	case PTP_SYS_OFFSET: {

+ 1
- 1
readahead.c View File

@@ -6,7 +6,7 @@ SYS_FUNC(readahead)
6 6
 
7 7
 	printfd(tcp, tcp->u_arg[0]);
8 8
 	argn = printllval(tcp, ", %lld", 1);
9
-	tprintf(", %lu", tcp->u_arg[argn]);
9
+	tprintf(", %" PRI_kru, tcp->u_arg[argn]);
10 10
 
11 11
 	return RVAL_DECODED;
12 12
 }

+ 1
- 1
readlink.c View File

@@ -51,7 +51,7 @@ decode_readlink(struct tcb *tcp, int offset)
51 51
 			 * past return buffer's end.
52 52
 			 */
53 53
 			printstrn(tcp, tcp->u_arg[offset + 1], tcp->u_rval);
54
-		tprintf(", %lu", tcp->u_arg[offset + 2]);
54
+		tprintf(", %" PRI_kru, tcp->u_arg[offset + 2]);
55 55
 	}
56 56
 	return 0;
57 57
 }

+ 1
- 1
rtc.c View File

@@ -100,7 +100,7 @@ MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp,
100 100
 		break;
101 101
 	case RTC_IRQP_SET:
102 102
 	case RTC_EPOCH_SET:
103
-		tprintf(", %lu", arg);
103
+		tprintf(", %" PRI_kru, arg);
104 104
 		break;
105 105
 	case RTC_IRQP_READ:
106 106
 	case RTC_EPOCH_READ:

+ 4
- 4
sendfile.c View File

@@ -35,7 +35,7 @@ SYS_FUNC(sendfile64)
35 35
 		printfd(tcp, tcp->u_arg[1]);
36 36
 		tprints(", ");
37 37
 		if (!printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64)) {
38
-			tprintf(", %lu", tcp->u_arg[3]);
38
+			tprintf(", %" PRI_kru, tcp->u_arg[3]);
39 39
 			return RVAL_DECODED;
40 40
 		}
41 41
 	} else {
@@ -43,7 +43,7 @@ SYS_FUNC(sendfile64)
43 43
 			tprints(" => ");
44 44
 			printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64);
45 45
 		}
46
-		tprintf(", %lu", tcp->u_arg[3]);
46
+		tprintf(", %" PRI_kru, tcp->u_arg[3]);
47 47
 	}
48 48
 
49 49
 	return 0;
@@ -58,7 +58,7 @@ SYS_FUNC(sendfile)
58 58
 		tprints(", ");
59 59
 		if (!printnum_ulong(tcp, tcp->u_arg[2])
60 60
 		    || !tcp->u_arg[3]) {
61
-			tprintf(", %lu", tcp->u_arg[3]);
61
+			tprintf(", %" PRI_kru, tcp->u_arg[3]);
62 62
 			return RVAL_DECODED;
63 63
 		}
64 64
 	} else {
@@ -66,7 +66,7 @@ SYS_FUNC(sendfile)
66 66
 			tprints(" => ");
67 67
 			printnum_ulong(tcp, tcp->u_arg[2]);
68 68
 		}
69
-		tprintf(", %lu", tcp->u_arg[3]);
69
+		tprintf(", %" PRI_kru, tcp->u_arg[3]);
70 70
 	}
71 71
 
72 72
 	return 0;

+ 1
- 1
sigaltstack.c View File

@@ -52,7 +52,7 @@ print_stack_t(struct tcb *const tcp, const kernel_ureg_t addr)
52 52
 	printaddr(ptr_to_kulong(ss.ss_sp));
53 53
 	tprints(", ss_flags=");
54 54
 	printflags(sigaltstack_flags, ss.ss_flags, "SS_???");
55
-	tprintf(", ss_size=%lu}", (kernel_ureg_t) ss.ss_size);
55
+	tprintf(", ss_size=%" PRI_kru "}", (kernel_ureg_t) ss.ss_size);
56 56
 }
57 57
 
58 58
 SYS_FUNC(sigaltstack)

+ 8
- 8
signal.c View File

@@ -463,7 +463,7 @@ SYS_FUNC(rt_sigprocmask)
463 463
 	}
464 464
 	else {
465 465
 		print_sigset_addr_len(tcp, tcp->u_arg[2], tcp->u_arg[3]);
466
-		tprintf(", %lu", tcp->u_arg[3]);
466
+		tprintf(", %" PRI_kru, tcp->u_arg[3]);
467 467
 	}
468 468
 	return 0;
469 469
 }
@@ -561,11 +561,11 @@ SYS_FUNC(rt_sigaction)
561 561
 	} else {
562 562
 		decode_new_sigaction(tcp, tcp->u_arg[2]);
563 563
 #if defined(SPARC) || defined(SPARC64)
564
-		tprintf(", %#lx, %lu", tcp->u_arg[3], tcp->u_arg[4]);
564
+		tprintf(", %#" PRI_krx ", %" PRI_kru, tcp->u_arg[3], tcp->u_arg[4]);
565 565
 #elif defined(ALPHA)
566
-		tprintf(", %lu, %#lx", tcp->u_arg[3], tcp->u_arg[4]);
566
+		tprintf(", %" PRI_kru ", %#" PRI_krx, tcp->u_arg[3], tcp->u_arg[4]);
567 567
 #else
568
-		tprintf(", %lu", tcp->u_arg[3]);
568
+		tprintf(", %" PRI_kru, tcp->u_arg[3]);
569 569
 #endif
570 570
 	}
571 571
 	return 0;
@@ -582,7 +582,7 @@ SYS_FUNC(rt_sigpending)
582 582
 		 */
583 583
 		print_sigset_addr_len_limit(tcp, tcp->u_arg[0],
584 584
 					    tcp->u_arg[1], 1);
585
-		tprintf(", %lu", tcp->u_arg[1]);
585
+		tprintf(", %" PRI_kru, tcp->u_arg[1]);
586 586
 	}
587 587
 	return 0;
588 588
 }
@@ -591,7 +591,7 @@ SYS_FUNC(rt_sigsuspend)
591 591
 {
592 592
 	/* NB: kernel requires arg[1] == NSIG / 8 */
593 593
 	print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[1]);
594
-	tprintf(", %lu", tcp->u_arg[1]);
594
+	tprintf(", %" PRI_kru, tcp->u_arg[1]);
595 595
 
596 596
 	return RVAL_DECODED;
597 597
 }
@@ -636,7 +636,7 @@ SYS_FUNC(rt_sigtimedwait)
636 636
 			printaddr(tcp->u_arg[1]);
637 637
 			tprints(", ");
638 638
 			print_timespec(tcp, tcp->u_arg[2]);
639
-			tprintf(", %lu", tcp->u_arg[3]);
639
+			tprintf(", %" PRI_kru, tcp->u_arg[3]);
640 640
 		} else {
641 641
 			char *sts = xstrdup(sprint_timespec(tcp, tcp->u_arg[2]));
642 642
 			set_tcb_priv_data(tcp, sts, free);
@@ -646,7 +646,7 @@ SYS_FUNC(rt_sigtimedwait)
646 646
 			printsiginfo_at(tcp, tcp->u_arg[1]);
647 647
 			tprints(", ");
648 648
 			tprints(get_tcb_priv_data(tcp));
649
-			tprintf(", %lu", tcp->u_arg[3]);
649
+			tprintf(", %" PRI_kru, tcp->u_arg[3]);
650 650
 		}
651 651
 
652 652
 		if (!syserror(tcp) && tcp->u_rval) {

+ 1
- 1
signalfd.c View File

@@ -40,7 +40,7 @@ do_signalfd(struct tcb *tcp, int flags_arg)
40 40
 	printfd(tcp, tcp->u_arg[0]);
41 41
 	tprints(", ");
42 42
 	print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[2]);
43
-	tprintf(", %lu", tcp->u_arg[2]);
43
+	tprintf(", %" PRI_kru, tcp->u_arg[2]);
44 44
 	if (flags_arg >= 0) {
45 45
 		tprints(", ");
46 46
 		printflags(sfd_flags, tcp->u_arg[flags_arg], "SFD_???");

+ 1
- 1
statfs64.c View File

@@ -4,7 +4,7 @@ SYS_FUNC(statfs64)
4 4
 {
5 5
 	if (entering(tcp)) {
6 6
 		printpath(tcp, tcp->u_arg[0]);
7
-		tprintf(", %lu, ", tcp->u_arg[1]);
7
+		tprintf(", %" PRI_kru ", ", tcp->u_arg[1]);
8 8
 	} else {
9 9
 		print_struct_statfs64(tcp, tcp->u_arg[2], tcp->u_arg[1]);
10 10
 	}

+ 12
- 10
syscall.c View File

@@ -822,7 +822,7 @@ trace_syscall_exiting(struct tcb *tcp)
822 822
 			if (syscall_fault_injected(tcp))
823 823
 				tprints(" (INJECTED)");
824 824
 		} else {
825
-			tprintf("= %#lx", tcp->u_rval);
825
+			tprintf("= %#" PRI_krx, tcp->u_rval);
826 826
 		}
827 827
 	}
828 828
 	else if (!(sys_res & RVAL_NONE) && u_error) {
@@ -907,7 +907,7 @@ trace_syscall_exiting(struct tcb *tcp)
907 907
 						(unsigned int) tcp->u_rval);
908 908
 				else
909 909
 #endif
910
-					tprintf("= %#lx", tcp->u_rval);
910
+					tprintf("= %#" PRI_krx, tcp->u_rval);
911 911
 				break;
912 912
 			case RVAL_OCTAL:
913 913
 				tprints("= ");
@@ -920,10 +920,10 @@ trace_syscall_exiting(struct tcb *tcp)
920 920
 						(unsigned int) tcp->u_rval);
921 921
 				else
922 922
 #endif
923
-					tprintf("= %lu", tcp->u_rval);
923
+					tprintf("= %" PRI_kru, tcp->u_rval);
924 924
 				break;
925 925
 			case RVAL_DECIMAL:
926
-				tprintf("= %ld", tcp->u_rval);
926
+				tprintf("= %" PRI_krd, tcp->u_rval);
927 927
 				break;
928 928
 			case RVAL_FD:
929 929
 				if (show_fd_path) {
@@ -931,7 +931,7 @@ trace_syscall_exiting(struct tcb *tcp)
931 931
 					printfd(tcp, tcp->u_rval);
932 932
 				}
933 933
 				else
934
-					tprintf("= %ld", tcp->u_rval);
934
+					tprintf("= %" PRI_krd, tcp->u_rval);
935 935
 				break;
936 936
 #if HAVE_STRUCT_TCB_EXT_ARG
937 937
 			/*
@@ -1058,8 +1058,9 @@ print_pc(struct tcb *tcp)
1058 1058
 		tprints(current_wordsize == 4 ? "[????????] "
1059 1059
 					      : "[????????????????] ");
1060 1060
 	else
1061
-		tprintf(current_wordsize == 4 ? "[%08lx] " : "[%016lx] ",
1062
-			(unsigned long) ARCH_PC_REG);
1061
+		tprintf(current_wordsize == 4
1062
+			? "[%08" PRI_krx "] " : "[%016" PRI_krx "] ",
1063
+			(kernel_ureg_t) ARCH_PC_REG);
1063 1064
 }
1064 1065
 
1065 1066
 #include "getregs_old.h"
@@ -1189,7 +1190,7 @@ set_regs(pid_t pid)
1189 1190
 struct sysent_buf {
1190 1191
 	struct tcb *tcp;
1191 1192
 	struct_sysent ent;
1192
-	char buf[sizeof("syscall_%lu") + sizeof(long) * 3];
1193
+	char buf[sizeof("syscall_%lu") + sizeof(kernel_scno_t) * 3];
1193 1194
 };
1194 1195
 
1195 1196
 static void
@@ -1228,7 +1229,7 @@ get_scno(struct tcb *tcp)
1228 1229
 		s->ent.sen = SEN_printargs;
1229 1230
 		s->ent.sys_func = printargs;
1230 1231
 		s->ent.sys_name = s->buf;
1231
-		sprintf(s->buf, "syscall_%lu", shuffle_scno(tcp->scno));
1232
+		sprintf(s->buf, "syscall_%" PRI_kru, shuffle_scno(tcp->scno));
1232 1233
 
1233 1234
 		tcp->s_ent = &s->ent;
1234 1235
 		tcp->qual_flg = QUAL_RAW | DEFAULT_QUAL_FLAGS;
@@ -1236,7 +1237,8 @@ get_scno(struct tcb *tcp)
1236 1237
 		set_tcb_priv_data(tcp, s, free_sysent_buf);
1237 1238
 
1238 1239
 		if (debug_flag)
1239
-			error_msg("pid %d invalid syscall %ld", tcp->pid, tcp->scno);
1240
+			error_msg("pid %d invalid syscall %" PRI_krd,
1241
+				  tcp->pid, tcp->scno);
1240 1242
 	}
1241 1243
 	return 1;
1242 1244
 }

+ 1
- 1
syslog.c View File

@@ -62,7 +62,7 @@ SYS_FUNC(syslog)
62 62
 			break;
63 63
 		default:
64 64
 			printaddr(tcp->u_arg[1]);
65
-			tprintf(", %lu", tcp->u_arg[2]);
65
+			tprintf(", %" PRI_kru, tcp->u_arg[2]);
66 66
 			return RVAL_DECODED;
67 67
 	}
68 68
 

+ 4
- 3
sysmips.c View File

@@ -65,14 +65,15 @@ SYS_FUNC(sysmips)
65 65
 	}
66 66
 	case MIPS_ATOMIC_SET:
67 67
 		printaddr(tcp->u_arg[1]);
68
-		tprintf(", %#lx", tcp->u_arg[2]);
68
+		tprintf(", %#" PRI_krx, tcp->u_arg[2]);
69 69
 		return RVAL_DECODED;
70 70
 	case MIPS_FIXADE:
71
-		tprintf("%#lx", tcp->u_arg[1]);
71
+		tprintf("%#" PRI_krx, tcp->u_arg[1]);
72 72
 		return RVAL_DECODED;
73 73
 	}
74 74
 
75
-	tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
75
+	tprintf("%" PRI_krd ", %" PRI_krd ", %" PRI_krd,
76
+		tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
76 77
 	return RVAL_DECODED;
77 78
 }
78 79
 

+ 2
- 2
truncate.c View File

@@ -3,7 +3,7 @@
3 3
 SYS_FUNC(truncate)
4 4
 {
5 5
 	printpath(tcp, tcp->u_arg[0]);
6
-	tprintf(", %lu", tcp->u_arg[1]);
6
+	tprintf(", %" PRI_kru, tcp->u_arg[1]);
7 7
 
8 8
 	return RVAL_DECODED;
9 9
 }
@@ -19,7 +19,7 @@ SYS_FUNC(truncate64)
19 19
 SYS_FUNC(ftruncate)
20 20
 {
21 21
 	printfd(tcp, tcp->u_arg[0]);
22
-	tprintf(", %lu", tcp->u_arg[1]);
22
+	tprintf(", %" PRI_kru, tcp->u_arg[1]);
23 23
 
24 24
 	return RVAL_DECODED;
25 25
 }

+ 9
- 9
util.c View File

@@ -956,7 +956,7 @@ dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ureg_t addr,
956 956
 			data_size -= iov_len;
957 957
 			/* include the buffer number to make it easy to
958 958
 			 * match up the trace with the source */
959
-			tprintf(" * %lu bytes in buffer %d\n", iov_len, i);
959
+			tprintf(" * %" PRI_kru " bytes in buffer %d\n", iov_len, i);
960 960
 			dumpstr(tcp, iov_iov_base(i), iov_len);
961 961
 		}
962 962
 	}
@@ -1127,7 +1127,7 @@ umoven(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len,
1127 1127
 		if ((unsigned int) r == len)
1128 1128
 			return 0;
1129 1129
 		if (r >= 0) {
1130
-			error_msg("umoven: short read (%u < %u) @0x%lx",
1130
+			error_msg("umoven: short read (%u < %u) @0x%" PRI_krx,
1131 1131
 				  (unsigned int) r, len, addr);
1132 1132
 			return -1;
1133 1133
 		}
@@ -1169,7 +1169,7 @@ umoven(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len,
1169 1169
 				return -1;
1170 1170
 			default:
1171 1171
 				/* all the rest is strange and should be reported */
1172
-				perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%lx",
1172
+				perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_krx,
1173 1173
 					    pid, addr);
1174 1174
 				return -1;
1175 1175
 		}
@@ -1192,13 +1192,13 @@ umoven(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len,
1192 1192
 			case EFAULT: case EIO: case EPERM:
1193 1193
 				/* address space is inaccessible */
1194 1194
 				if (nread) {
1195
-					perror_msg("umoven: short read (%u < %u) @0x%lx",
1195
+					perror_msg("umoven: short read (%u < %u) @0x%" PRI_krx,
1196 1196
 						   nread, nread + len, addr - nread);
1197 1197
 				}
1198 1198
 				return -1;
1199 1199
 			default:
1200 1200
 				/* all the rest is strange and should be reported */
1201
-				perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%lx",
1201
+				perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_krx,
1202 1202
 					    pid, addr);
1203 1203
 				return -1;
1204 1204
 		}
@@ -1312,7 +1312,7 @@ umovestr(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, char *ladd
1312 1312
 				case EFAULT: case EIO:
1313 1313
 					/* address space is inaccessible */
1314 1314
 					if (nread) {
1315
-						perror_msg("umovestr: short read (%d < %d) @0x%lx",
1315
+						perror_msg("umovestr: short read (%d < %d) @0x%" PRI_krx,
1316 1316
 							   nread, nread + len, addr - nread);
1317 1317
 					}
1318 1318
 					return -1;
@@ -1343,7 +1343,7 @@ umovestr(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, char *ladd
1343 1343
 				return -1;
1344 1344
 			default:
1345 1345
 				/* all the rest is strange and should be reported */
1346
-				perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%lx",
1346
+				perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_krx,
1347 1347
 					    pid, addr);
1348 1348
 				return -1;
1349 1349
 		}
@@ -1370,13 +1370,13 @@ umovestr(struct tcb *const tcp, kernel_ureg_t addr, unsigned int len, char *ladd
1370 1370
 			case EFAULT: case EIO: case EPERM:
1371 1371
 				/* address space is inaccessible */
1372 1372
 				if (nread) {
1373
-					perror_msg("umovestr: short read (%d < %d) @0x%lx",
1373
+					perror_msg("umovestr: short read (%d < %d) @0x%" PRI_krx,
1374 1374
 						   nread, nread + len, addr - nread);
1375 1375
 				}
1376 1376
 				return -1;
1377 1377
 			default:
1378 1378
 				/* all the rest is strange and should be reported */
1379
-				perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%lx",
1379
+				perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_krx,
1380 1380
 					   pid, addr);
1381 1381
 				return -1;
1382 1382
 		}

+ 2
- 2
xattr.c View File

@@ -51,7 +51,7 @@ print_xattr_val(struct tcb *const tcp,
51 51
 		printaddr(addr);
52 52
 	else
53 53
 		printstr_ex(tcp, addr, size, QUOTE_OMIT_TRAILING_0);
54
-	tprintf(", %lu", insize);
54
+	tprintf(", %" PRI_kru, insize);
55 55
 }
56 56
 
57 57
 SYS_FUNC(setxattr)
@@ -109,7 +109,7 @@ print_xattr_list(struct tcb *const tcp, const kernel_ureg_t addr,
109 109
 	} else {
110 110
 		printstrn(tcp, addr, tcp->u_rval);
111 111
 	}
112
-	tprintf(", %lu", size);
112
+	tprintf(", %" PRI_kru, size);
113 113
 }
114 114
 
115 115
 SYS_FUNC(listxattr)

Loading…
Cancel
Save