View | Details | Raw Unified | Return to bug 18597 | Differences between
and this patch

Collapse All | Expand All

(-)a/tapset/linux/nd_syscalls.stp (-8 / +2 lines)
Lines 3154-3177 probe __nd_syscall.io_setup.return = kprobe.function("sys_io_setup").return ? Link Here
3154
# long compat_sys_io_submit(aio_context_t ctx_id, int nr, u32 __user *iocb)
3154
# long compat_sys_io_submit(aio_context_t ctx_id, int nr, u32 __user *iocb)
3155
#
3155
#
3156
probe nd_syscall.io_submit = __nd_syscall.io_submit,
3156
probe nd_syscall.io_submit = __nd_syscall.io_submit,
3157
	__nd_syscall.compat_io_submit ?
3157
	kprobe.function("compat_sys_io_submit") ?
3158
{
3158
{
3159
	name = "io_submit"
3159
	name = "io_submit"
3160
	asmlinkage()
3160
	asmlinkage()
3161
	ctx_id = ulong_arg(1)
3161
	ctx_id = ulong_arg(1)
3162
	nr = long_arg(2)
3162
	iocbpp_uaddr = pointer_arg(3)
3163
	iocbpp_uaddr = pointer_arg(3)
3163
	argstr = sprintf("%u, %d, %p", ctx_id, nr, iocbpp_uaddr)
3164
	argstr = sprintf("%u, %d, %p", ctx_id, nr, iocbpp_uaddr)
3164
}
3165
}
3165
probe __nd_syscall.io_submit = kprobe.function("sys_io_submit") ?
3166
probe __nd_syscall.io_submit = kprobe.function("sys_io_submit") ?
3166
{
3167
{
3167
	@__syscall_gate(%{ __NR_io_submit %})
3168
	@__syscall_gate(%{ __NR_io_submit %})
3168
	asmlinkage()
3169
	nr = long_arg(2)
3170
}
3171
probe __nd_syscall.compat_io_submit = kprobe.function("compat_sys_io_submit") ?
3172
{
3173
	asmlinkage()
3174
	nr = int_arg(2)
3175
}
3169
}
3176
probe nd_syscall.io_submit.return = __nd_syscall.io_submit.return,
3170
probe nd_syscall.io_submit.return = __nd_syscall.io_submit.return,
3177
	kprobe.function("compat_sys_io_submit").return ?
3171
	kprobe.function("compat_sys_io_submit").return ?
(-)a/tapset/linux/nd_syscalls2.stp (-52 / +5 lines)
Lines 585-635 probe nd_syscall.prctl.return = kprobe.function("sys_prctl").return ? Link Here
585
#		 size_t count,
585
#		 size_t count,
586
#		 loff_t pos)
586
#		 loff_t pos)
587
#
587
#
588
probe nd_syscall.pread =
588
probe nd_syscall.pread = kprobe.function("sys_pread64")
589
%( arch == "s390" %?
590
	__nd_syscall.pread, __nd_syscall.compat_pread ?
591
%:
592
	__nd_syscall.pread
593
%)
594
{
589
{
595
	name = "pread"
590
	name = "pread"
596
	asmlinkage()
591
	asmlinkage()
597
	fd = int_arg(1)
592
	fd = int_arg(1)
598
	buf_uaddr = pointer_arg(2)
593
	buf_uaddr = pointer_arg(2)
599
	count = ulong_arg(3)
594
	count = ulong_arg(3)
600
	argstr = sprintf("%d, %p, %u, %d", fd, buf_uaddr, count, offset)
601
}
602
probe __nd_syscall.pread = kprobe.function("sys_pread64")
603
{
604
	asmlinkage()
605
%( arch == "s390" %?
606
	@__syscall_gate(%{ __NR_pread64 %})
607
%)
608
	offset = longlong_arg(4)
595
	offset = longlong_arg(4)
596
	argstr = sprintf("%d, %p, %u, %d", fd, buf_uaddr, count, offset)
609
}
597
}
610
%( arch == "s390" %?
598
probe nd_syscall.pread.return = kprobe.function("sys_pread64").return
611
probe __nd_syscall.compat_pread = kprobe.function("sys32_pread64").call ?
612
{
613
	asmlinkage()
614
	offset = (u32_arg(4) << 32) + u32_arg(5)
615
}
616
%)
617
probe nd_syscall.pread.return =
618
%( arch == "s390" %?
619
	__nd_syscall.pread.return, kprobe.function("sys32_pread64").return ?
620
%:
621
	__nd_syscall.pread.return
622
%)
623
{
599
{
624
	name = "pread"
600
	name = "pread"
625
	retstr = returnstr(1)
601
	retstr = returnstr(1)
626
}
602
}
627
probe __nd_syscall.pread.return = kprobe.function("sys_pread64").return
628
{
629
%( arch == "s390" %?
630
	@__syscall_gate(%{ __NR_pread64 %})
631
%)
632
}
633
603
634
# preadv ____________________________________________________
604
# preadv ____________________________________________________
635
#
605
#
Lines 4551-4575 probe nd_syscall.sync_file_range = kprobe.function("sys_sync_file_range") ? Link Here
4551
	name = "sync_file_range"
4521
	name = "sync_file_range"
4552
	fd = int_arg(1)
4522
	fd = int_arg(1)
4553
%( CONFIG_64BIT == "y" %?
4523
%( CONFIG_64BIT == "y" %?
4554
%( arch == "s390" %?
4524
	offset = longlong_arg(2)
4555
	# On s390x RHEL7 (3.10.0-229.el7.s390x), when longlong_arg()
4525
	nbytes = longlong_arg(3)
4556
	# gets called On a 32-bit executable it tries to grab the
4557
	# 64-bit value out of 2 different registers. However, at this
4558
	# point the value has been put into a single
4559
	# register. Normally we'd fix this by probing the the compat
4560
	# function. But, on this kernel the compat function is in
4561
	# assembly language, which we can't probe. So, we'll grab the
4562
	# registers directly.
4563
	if (%{ /* pure */ _stp_is_compat_task() %}) {
4564
		offset = u_register("r3")
4565
		nbytes = u_register("r4")
4566
	}
4567
	else
4568
%)
4569
	{
4570
		offset = longlong_arg(2)
4571
		nbytes = longlong_arg(3)
4572
	}
4573
	flags = uint_arg(4)
4526
	flags = uint_arg(4)
4574
%:
4527
%:
4575
%( arch == "arm" %?
4528
%( arch == "arm" %?
(-)a/tapset/linux/powerpc/nd_syscalls.stp (+71 lines)
Lines 977-979 probe nd_syscall.compat_lookup_dcookie.return = Link Here
977
        name = "lookup_dcookie"
977
        name = "lookup_dcookie"
978
        retstr = returnstr(1)
978
        retstr = returnstr(1)
979
}
979
}
980
981
%( systemtap_v <= "2.8" %?
982
# compat_pread _______________________________________________
983
# compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf,
984
#                                   compat_size_t count, u32 reg6,
985
#                                   u32 poshi, u32 poslo)
986
probe nd_syscall.compat_pread = kprobe.function("compat_sys_pread64")
987
{
988
	name = "pread"
989
	asmlinkage()
990
	fd = int_arg(1)
991
	buf_uaddr = pointer_arg(2)
992
	count = ulong_arg(3)
993
	offset = (u32_arg(5) << 32) + u32_arg(6)
994
	argstr = sprintf("%d, %p, %u, %d", fd, buf_uaddr, count, offset)
995
}
996
probe nd_syscall.compat_pread.return = kprobe.function("compat_sys_pread64").return
997
{
998
	name = "pread"
999
	retstr = returnstr(1)
1000
}
1001
%)
1002
1003
# compat_pwrite ______________________________________________
1004
# compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf,
1005
#                                    compat_size_t count, u32 reg6,
1006
#                                    u32 poshi, u32 poslo)
1007
#
1008
probe nd_syscall.compat_pwrite = kprobe.function("compat_sys_pwrite64") ?
1009
{
1010
	name = "pwrite"
1011
	asmlinkage()
1012
	fd = int_arg(1)
1013
	buf_uaddr = pointer_arg(2)
1014
	count = ulong_arg(3)
1015
	offset = (u32_arg(5) << 32) + u32_arg(6)
1016
	argstr = sprintf("%d, %s, %u, %d", fd,
1017
			 user_string_n2_quoted(buf_uaddr, count, syscall_string_trunc),
1018
	                 count, offset)
1019
}
1020
probe nd_syscall.compat_pwrite.return = kprobe.function("compat_sys_pwrite64").return ?
1021
{
1022
	name = "pwrite"
1023
	retstr = returnstr(1)
1024
}
1025
1026
# compat_sync_file_range _____________________________________
1027
# asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
1028
#                                             unsigned offset_hi, unsigned offset_lo,
1029
#                                             unsigned nbytes_hi, unsigned nbytes_lo)
1030
#
1031
probe nd_syscall.compat_sync_file_range =
1032
	kprobe.function("compat_sys_sync_file_range2") ?
1033
{
1034
	asmlinkage()
1035
	name = "sync_file_range"
1036
	fd = int_arg(1)
1037
	flags = uint_arg(2)
1038
	offset = (u32_arg(3) << 32) + u32_arg(4)
1039
	nbytes = (u32_arg(5) << 32) + u32_arg(6)
1040
	flags_str = _sync_file_range_flags_str(flags)
1041
	argstr = sprintf("%d, %d, %d, %s", fd, offset, nbytes,
1042
	                 _sync_file_range_flags_str(flags))
1043
}
1044
probe nd_syscall.compat_sync_file_range.return =
1045
	kprobe.function("compat_sys_sync_file_range2").return ?
1046
{
1047
	name = "sync_file_range"
1048
	retstr = returnstr(1)
1049
}
1050
(-)a/tapset/linux/s390/nd_syscalls.stp (+77 lines)
Lines 477-480 probe nd_syscall.compat_lookup_dcookie.return = Link Here
477
        retstr = returnstr(1)
477
        retstr = returnstr(1)
478
}
478
}
479
479
480
# compat_pread _______________________________________________
481
# asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf,
482
#                               size_t count, u32 poshi, u32 poslo)
483
#
484
probe nd_syscall.compat_pread = kprobe.function("sys32_pread64")
485
{
486
	name = "pread"
487
	asmlinkage()
488
	fd = int_arg(1)
489
	buf_uaddr = pointer_arg(2)
490
	count = ulong_arg(3)
491
	offset = (u32_arg(4) << 32) + u32_arg(5)
492
	argstr = sprintf("%d, %p, %u, %d", fd, buf_uaddr, count, offset)
493
}
494
probe nd_syscall.compat_pread.return = kprobe.function("sys32_pread64").return
495
{
496
	name = "pread"
497
	retstr = returnstr(1)
498
}
499
500
# compat_pwrite ______________________________________________
501
# asmlinkage long sys32_pwrite64(unsigned int fd, const char __user *ubuf,
502
#                                size_t count, u32 poshi, u32 poslo)
503
#
504
probe nd_syscall.compat_pwrite = kprobe.function("sys32_pwrite64") ?
505
{
506
	name = "pwrite"
507
	asmlinkage()
508
	fd = int_arg(1)
509
	buf_uaddr = pointer_arg(2)
510
	count = ulong_arg(3)
511
	offset = (u32_arg(4) << 32) + u32_arg(5)
512
	argstr = sprintf("%d, %s, %u, %d", fd,
513
			 user_string_n2_quoted(buf_uaddr, count, syscall_string_trunc),
514
	                 count, offset)
515
}
516
probe nd_syscall.compat_pwrite.return = kprobe.function("sys32_pwrite64").return ?
517
{
518
	name = "pwrite"
519
	retstr = returnstr(1)
520
}
521
522
# compat_sync_file_range _____________________________________
523
# SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes,
524
#                 unsigned int, flags)
525
#
526
probe nd_syscall.compat_sync_file_range =
527
	kprobe.function("sys_sync_file_range") ?
528
{
529
	# On s390x RHEL7 (3.10.0-229.el7.s390x), when longlong_arg()
530
	# gets called On a 32-bit executable it tries to grab the
531
	# 64-bit value out of 2 different registers. However, at this
532
	# point the value has been put into a single
533
	# register. Normally we'd fix this by probing the the compat
534
	# function. But, on this kernel the compat function is in
535
	# assembly language, which we can't probe. So, we'll grab the
536
	# registers directly
537
	#
538
	if (! %{ /* pure */ _stp_is_compat_task() %}) next
539
	asmlinkage()
540
	name = "sync_file_range"
541
	fd = int_arg(1)
542
	offset = u_register("r3")
543
	nbytes = u_register("r4")
544
	flags = uint_arg(4)
545
	flags_str = _sync_file_range_flags_str(flags)
546
	argstr = sprintf("%d, %d, %d, %s", fd, offset, nbytes,
547
	_sync_file_range_flags_str(flags))
548
}
549
probe nd_syscall.compat_sync_file_range.return =
550
	kprobe.function("sys_sync_file_range").return ?
551
{
552
	if (! %{ /* pure */ _stp_is_compat_task() %}) next
553
	name = "sync_file_range"
554
	retstr = returnstr(1)
555
}
556
480
%)
557
%)
(-)a/tapset/powerpc/registers.stp (-8 / +10 lines)
Lines 124-131 function u_register:long (name:string) { Link Here
124
 * If truncate=1, mask off the top 32 bits.
124
 * If truncate=1, mask off the top 32 bits.
125
 * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a
125
 * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a
126
 * 32-bit app), sign-extend the 32-bit value.
126
 * 32-bit app), sign-extend the 32-bit value.
127
 * If force64=1, return a 64-bit value even if we're in a 32-bit app.
127
 */
128
 */
128
function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) {
129
function _stp_arg:long (argnum:long, sign_extend:long, truncate:long)
130
{
131
	return _stp_arg2(argnum, sign_extend, truncate, 0)
132
}
133
function _stp_arg2:long (argnum:long, sign_extend:long, truncate:long,
134
			 force64:long)
135
{
129
	val = 0
136
	val = 0
130
	if (argnum < 1 || argnum > 8) {
137
	if (argnum < 1 || argnum > 8) {
131
		error(sprintf("Cannot access arg(%d)", argnum))
138
		error(sprintf("Cannot access arg(%d)", argnum))
Lines 149-155 function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) { Link Here
149
	else if (argnum == 8)
156
	else if (argnum == 8)
150
		val = u_register("r10")
157
		val = u_register("r10")
151
158
152
	if (truncate) {
159
	if ((truncate || @__compat_task) && !force64) {
153
		if (sign_extend)
160
		if (sign_extend)
154
			val = _stp_sign_extend32(val)
161
			val = _stp_sign_extend32(val)
155
		else
162
		else
Lines 178-189 function ulong_arg:long (argnum:long) { Link Here
178
}
185
}
179
186
180
function longlong_arg:long (argnum:long) {
187
function longlong_arg:long (argnum:long) {
181
	if (probing_32bit_app()) {
188
	return _stp_arg(argnum, 0, 0)
182
		lowbits = _stp_arg(argnum, 0, 1)
183
		highbits = _stp_arg(argnum+1, 0, 1)
184
		return ((highbits << 32) | lowbits)
185
	} else
186
		return _stp_arg(argnum, 0, 0)
187
}
189
}
188
190
189
function ulonglong_arg:long (argnum:long) {
191
function ulonglong_arg:long (argnum:long) {
(-)a/tapset/s390/registers.stp (-13 / +13 lines)
Lines 198-206 function u_register:long (name:string) { Link Here
198
 * If truncate=1, mask off the top 32 bits.
198
 * If truncate=1, mask off the top 32 bits.
199
 * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a
199
 * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a
200
 * 32-bit app), sign-extend the 32-bit value.
200
 * 32-bit app), sign-extend the 32-bit value.
201
 * If force64=1, return a 64-bit value even if we're in a 32-bit app.
201
 */
202
 */
202
function _stp_arg:long (argnum:long, sign_extend:long, truncate:long)
203
function _stp_arg:long (argnum:long, sign_extend:long, truncate:long)
203
{
204
{
205
	return _stp_arg2(argnum, sign_extend, truncate, 0)
206
}
207
function _stp_arg2:long (argnum:long, sign_extend:long, truncate:long,
208
			 force64:long)
209
{
204
	val = 0
210
	val = 0
205
	if (argnum < 1 || argnum > 8) {
211
	if (argnum < 1 || argnum > 8) {
206
		error(sprintf("Cannot acces arg(%d)", argnum))
212
		error(sprintf("Cannot acces arg(%d)", argnum))
Lines 237-243 function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) Link Here
237
	else if (argnum >= 6)
243
	else if (argnum >= 6)
238
		val = _stp_get_kernel_stack_param(argnum - 6)
244
		val = _stp_get_kernel_stack_param(argnum - 6)
239
245
240
	if (truncate || %{ /* pure */ _stp_is_compat_task() %}) {
246
	if ((truncate || @__compat_task) && !force64) {
241
		/* High bits may be garbage. */
247
		/* High bits may be garbage. */
242
		val = (val & 0xffffffff)
248
		val = (val & 0xffffffff)
243
		if (sign_extend)
249
		if (sign_extend)
Lines 248-277 function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) Link Here
248
254
249
/* Return the value of function arg #argnum (1=first arg) as a signed int. */
255
/* Return the value of function arg #argnum (1=first arg) as a signed int. */
250
function int_arg:long (argnum:long) {
256
function int_arg:long (argnum:long) {
251
	return _stp_arg(argnum, 1, 1)
257
	return _stp_arg2(argnum, 1, 1, 0)
252
}
258
}
253
259
254
/* Return the value of function arg #argnum (1=first arg) as an unsigned int. */
260
/* Return the value of function arg #argnum (1=first arg) as an unsigned int. */
255
function uint_arg:long (argnum:long) {
261
function uint_arg:long (argnum:long) {
256
	return _stp_arg(argnum, 0, 1)
262
	return _stp_arg2(argnum, 0, 1, 0)
257
}
263
}
258
264
259
function long_arg:long (argnum:long) {
265
function long_arg:long (argnum:long) {
260
	return _stp_arg(argnum, 1, 0)
266
	return _stp_arg2(argnum, 1, 0, 0)
261
}
267
}
262
268
263
function ulong_arg:long (argnum:long) {
269
function ulong_arg:long (argnum:long) {
264
	return _stp_arg(argnum, 0, 0)
270
	return _stp_arg2(argnum, 0, 0, 0)
265
}
271
}
266
272
267
function longlong_arg:long (argnum:long) {
273
function longlong_arg:long (argnum:long) {
268
	if (probing_32bit_app()) {
274
	return _stp_arg2(argnum, 0, 0, 1)
269
		/* TODO verify if this is correct for 31bit apps */
270
		highbits = _stp_arg(argnum, 0, 1)
271
		lowbits = _stp_arg(argnum+1, 0, 1)
272
		return ((highbits << 32) | lowbits)
273
	} else
274
		return _stp_arg(argnum, 0, 0)
275
}
275
}
276
276
277
function ulonglong_arg:long (argnum:long) {
277
function ulonglong_arg:long (argnum:long) {
Lines 279-285 function ulonglong_arg:long (argnum:long) { Link Here
279
}
279
}
280
280
281
function pointer_arg:long (argnum:long) {
281
function pointer_arg:long (argnum:long) {
282
	return _stp_arg(argnum, 0, 0)
282
	return _stp_arg2(argnum, 0, 0, 0)
283
}
283
}
284
284
285
function s32_arg:long (argnum:long) {
285
function s32_arg:long (argnum:long) {
(-)a/tapset/x86_64/registers.stp (-15 / +19 lines)
Lines 112-119 function u_register:long (name:string) { Link Here
112
 * If truncate=1, mask off the top 32 bits.
112
 * If truncate=1, mask off the top 32 bits.
113
 * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a
113
 * If sign_extend=1 and (truncate=1 or the probepoint we've hit is in a
114
 * 32-bit app), sign-extend the 32-bit value.
114
 * 32-bit app), sign-extend the 32-bit value.
115
 * If force64=1, return a 64-bit value even if we're in a 32-bit app.
115
 */
116
 */
116
function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) %{ /* pure */
117
function _stp_arg:long (argnum:long, sign_extend:long, truncate:long)
118
{
119
	return _stp_arg2(argnum, sign_extend, truncate, 0)
120
}
121
function _stp_arg2:long (argnum:long, sign_extend:long, truncate:long,
122
			 force64:long)
123
%{ /* pure */
124
117
	long val;
125
	long val;
118
	struct pt_regs *regs;
126
	struct pt_regs *regs;
119
	int result, n, nr_regargs;
127
	int result, n, nr_regargs;
Lines 138-144 function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) %{ /* pure Link Here
138
			nr_regargs = 6;
146
			nr_regargs = 6;
139
	} else
147
	} else
140
		nr_regargs = (CONTEXT->regparm & _STP_REGPARM_MASK);
148
		nr_regargs = (CONTEXT->regparm & _STP_REGPARM_MASK);
141
	if (CONTEXT->user_mode_p && _stp_is_compat_task()) {
149
	if (!STAP_ARG_force64 && CONTEXT->user_mode_p && _stp_is_compat_task()) {
142
		argsz = sizeof(int);
150
		argsz = sizeof(int);
143
		result = _stp_get_arg32_by_number(n, nr_regargs, regs, &val);
151
		result = _stp_get_arg32_by_number(n, nr_regargs, regs, &val);
144
	} else
152
	} else
Lines 167-173 function _stp_arg:long (argnum:long, sign_extend:long, truncate:long) %{ /* pure Link Here
167
	default:
175
	default:
168
		goto bad_argnum;
176
		goto bad_argnum;
169
	}
177
	}
170
	if (STAP_ARG_truncate || argsz == sizeof(int)) {
178
	if ((STAP_ARG_truncate || _stp_is_compat_task())
179
	    && !STAP_ARG_force64) {
171
		if (STAP_ARG_sign_extend)
180
		if (STAP_ARG_sign_extend)
172
			STAP_RETVALUE = (int64_t) __stp_sign_extend32(val);
181
			STAP_RETVALUE = (int64_t) __stp_sign_extend32(val);
173
		else
182
		else
Lines 198-234 function probing_32bit_app:long() %{ /* pure */ Link Here
198
207
199
/* Return the value of function arg #argnum (1=first arg) as a signed int. */
208
/* Return the value of function arg #argnum (1=first arg) as a signed int. */
200
function int_arg:long (argnum:long) {
209
function int_arg:long (argnum:long) {
201
	return _stp_arg(argnum, 1, 1)
210
	return _stp_arg2(argnum, 1, 1, 0)
202
}
211
}
203
212
204
/* Return the value of function arg #argnum (1=first arg) as an unsigned int. */
213
/* Return the value of function arg #argnum (1=first arg) as an unsigned int. */
205
function uint_arg:long (argnum:long) {
214
function uint_arg:long (argnum:long) {
206
	return _stp_arg(argnum, 0, 1)
215
	return _stp_arg2(argnum, 0, 1, 0)
207
}
216
}
208
217
209
function long_arg:long (argnum:long) {
218
function long_arg:long (argnum:long) {
210
	return _stp_arg(argnum, 1, 0)
219
	return _stp_arg2(argnum, 1, 0, 0)
211
}
220
}
212
221
213
function ulong_arg:long (argnum:long) {
222
function ulong_arg:long (argnum:long) {
214
	return _stp_arg(argnum, 0, 0)
223
	return _stp_arg2(argnum, 0, 0, 0)
215
}
224
}
216
225
217
function longlong_arg:long (argnum:long) {
226
function longlong_arg:long (argnum:long) {
218
	if (probing_32bit_app()) {
227
	return _stp_arg2(argnum, 0, 0, 1)
219
		lowbits = _stp_arg(argnum, 0, 1)
220
		highbits = _stp_arg(argnum+1, 0, 1)
221
		return ((highbits << 32) | lowbits)
222
	} else
223
		return _stp_arg(argnum, 0, 0)
224
}
228
}
225
229
226
function ulonglong_arg:long (argnum:long) {
230
function ulonglong_arg:long (argnum:long) {
227
	return longlong_arg(argnum)
231
	return _stp_arg2(argnum, 0, 0, 1)
228
}
232
}
229
233
230
function pointer_arg:long (argnum:long) {
234
function pointer_arg:long (argnum:long) {
231
	return _stp_arg(argnum, 0, 0)
235
	return _stp_arg2(argnum, 0, 0, 0)
232
}
236
}
233
237
234
function s32_arg:long (argnum:long) {
238
function s32_arg:long (argnum:long) {
(-)a/testsuite/systemtap.syscall/pread.c (+10 lines)
Lines 1-11 Link Here
1
/* COVERAGE: pread pread64 */
1
/* COVERAGE: pread pread64 */
2
#define _BSD_SOURCE
2
#define _BSD_SOURCE
3
#define _DEFAULT_SOURCE
3
#define _DEFAULT_SOURCE
4
#define _LARGEFILE64_SOURCE
5
#define _ISOC99_SOURCE		   /* Needed for LLONG_MAX on RHEL5 */
6
#define _FILE_OFFSET_BITS 64
4
#include <sys/types.h>
7
#include <sys/types.h>
5
#include <sys/stat.h>
8
#include <sys/stat.h>
6
#include <fcntl.h>
9
#include <fcntl.h>
7
#include <stdlib.h>
10
#include <stdlib.h>
8
#include <unistd.h>
11
#include <unistd.h>
12
#include <limits.h>
9
#include <linux/unistd.h>
13
#include <linux/unistd.h>
10
#include <sys/uio.h>
14
#include <sys/uio.h>
11
#include <sys/syscall.h>
15
#include <sys/syscall.h>
Lines 55-60 int main() Link Here
55
  pread(fd, buf, 11, -1);
59
  pread(fd, buf, 11, -1);
56
  //staptest// pread (NNNN, XXXX, 11, -1) = NNNN
60
  //staptest// pread (NNNN, XXXX, 11, -1) = NNNN
57
61
62
  pread(fd, buf, 11, 0x12345678deadbeefLL);
63
  //staptest// pread (NNNN, XXXX, 11, 1311768468603649775) = NNNN
64
65
  pread(fd, buf, 11, LLONG_MAX);
66
  //staptest// pread (NNNN, XXXX, 11, 9223372036854775807) = NNNN
67
58
  close (fd);
68
  close (fd);
59
  //staptest// close (NNNN) = 0
69
  //staptest// close (NNNN) = 0
60
70
(-)a/testsuite/systemtap.syscall/pwrite.c (+10 lines)
Lines 1-11 Link Here
1
/* COVERAGE: pwrite pwrite64 */
1
/* COVERAGE: pwrite pwrite64 */
2
#define _BSD_SOURCE
2
#define _BSD_SOURCE
3
#define _DEFAULT_SOURCE
3
#define _DEFAULT_SOURCE
4
#define _LARGEFILE64_SOURCE
5
#define _ISOC99_SOURCE		   /* Needed for LLONG_MAX on RHEL5 */
6
#define _FILE_OFFSET_BITS 64
4
#include <sys/types.h>
7
#include <sys/types.h>
5
#include <sys/stat.h>
8
#include <sys/stat.h>
6
#include <fcntl.h>
9
#include <fcntl.h>
7
#include <stdlib.h>
10
#include <stdlib.h>
8
#include <unistd.h>
11
#include <unistd.h>
12
#include <limits.h>
9
#include <linux/unistd.h>
13
#include <linux/unistd.h>
10
#include <sys/uio.h>
14
#include <sys/uio.h>
11
#include <sys/syscall.h>
15
#include <sys/syscall.h>
Lines 46-51 int main() Link Here
46
  pwrite(fd, "Hello Again", 11, -1);
50
  pwrite(fd, "Hello Again", 11, -1);
47
  //staptest// pwrite (NNNN, "Hello Again", 11, -1) = NNNN
51
  //staptest// pwrite (NNNN, "Hello Again", 11, -1) = NNNN
48
52
53
  pwrite(-1, "Hello Again", 11, 0x12345678deadbeefLL);
54
  //staptest// pwrite (-1, "Hello Again", 11, 1311768468603649775) = NNNN
55
56
  pwrite(-1, "Hello Again", 11, LLONG_MAX);
57
  //staptest// pwrite (-1, "Hello Again", 11, 9223372036854775807) = NNNN
58
49
  close (fd);
59
  close (fd);
50
  //staptest// close (NNNN) = 0
60
  //staptest// close (NNNN) = 0
51
61

Return to bug 18597