Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Minor conflicts in drivers/net/ethernet/mellanox/mlx5/core/en_rep.c, we had some overlapping changes: 1) In 'net' MLX5E_PARAMS_LOG_{SQ,RQ}_SIZE --> MLX5E_REP_PARAMS_LOG_{SQ,RQ}_SIZE 2) In 'net-next' params->log_rq_size is renamed to be params->log_rq_mtu_frames. 3) In 'net-next' params->hard_mtu is added. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# description: Kprobe event string type argument
|
||||
|
||||
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
||||
|
||||
echo 0 > events/enable
|
||||
echo > kprobe_events
|
||||
|
||||
case `uname -m` in
|
||||
x86_64)
|
||||
ARG2=%si
|
||||
OFFS=8
|
||||
;;
|
||||
i[3456]86)
|
||||
ARG2=%cx
|
||||
OFFS=4
|
||||
;;
|
||||
aarch64)
|
||||
ARG2=%x1
|
||||
OFFS=8
|
||||
;;
|
||||
arm*)
|
||||
ARG2=%r1
|
||||
OFFS=4
|
||||
;;
|
||||
*)
|
||||
echo "Please implement other architecture here"
|
||||
exit_untested
|
||||
esac
|
||||
|
||||
: "Test get argument (1)"
|
||||
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string" > kprobe_events
|
||||
echo 1 > events/kprobes/testprobe/enable
|
||||
! echo test >> kprobe_events
|
||||
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test\""
|
||||
|
||||
echo 0 > events/kprobes/testprobe/enable
|
||||
: "Test get argument (2)"
|
||||
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string arg2=+0(+${OFFS}(${ARG2})):string" > kprobe_events
|
||||
echo 1 > events/kprobes/testprobe/enable
|
||||
! echo test1 test2 >> kprobe_events
|
||||
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test1\" arg2=\"test2\""
|
||||
|
||||
echo 0 > events/enable
|
||||
echo > kprobe_events
|
@@ -0,0 +1,97 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# description: Kprobe event argument syntax
|
||||
|
||||
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
||||
|
||||
grep "x8/16/32/64" README > /dev/null || exit_unsupported # version issue
|
||||
|
||||
echo 0 > events/enable
|
||||
echo > kprobe_events
|
||||
|
||||
PROBEFUNC="vfs_read"
|
||||
GOODREG=
|
||||
BADREG=
|
||||
GOODSYM="_sdata"
|
||||
if ! grep -qw ${GOODSYM} /proc/kallsyms ; then
|
||||
GOODSYM=$PROBEFUNC
|
||||
fi
|
||||
BADSYM="deaqswdefr"
|
||||
SYMADDR=0x`grep -w ${GOODSYM} /proc/kallsyms | cut -f 1 -d " "`
|
||||
GOODTYPE="x16"
|
||||
BADTYPE="y16"
|
||||
|
||||
case `uname -m` in
|
||||
x86_64|i[3456]86)
|
||||
GOODREG=%ax
|
||||
BADREG=%ex
|
||||
;;
|
||||
aarch64)
|
||||
GOODREG=%x0
|
||||
BADREG=%ax
|
||||
;;
|
||||
arm*)
|
||||
GOODREG=%r0
|
||||
BADREG=%ax
|
||||
;;
|
||||
esac
|
||||
|
||||
test_goodarg() # Good-args
|
||||
{
|
||||
while [ "$1" ]; do
|
||||
echo "p ${PROBEFUNC} $1" > kprobe_events
|
||||
shift 1
|
||||
done;
|
||||
}
|
||||
|
||||
test_badarg() # Bad-args
|
||||
{
|
||||
while [ "$1" ]; do
|
||||
! echo "p ${PROBEFUNC} $1" > kprobe_events
|
||||
shift 1
|
||||
done;
|
||||
}
|
||||
|
||||
echo > kprobe_events
|
||||
|
||||
: "Register access"
|
||||
test_goodarg ${GOODREG}
|
||||
test_badarg ${BADREG}
|
||||
|
||||
: "Symbol access"
|
||||
test_goodarg "@${GOODSYM}" "@${SYMADDR}" "@${GOODSYM}+10" "@${GOODSYM}-10"
|
||||
test_badarg "@" "@${BADSYM}" "@${GOODSYM}*10" "@${GOODSYM}/10" \
|
||||
"@${GOODSYM}%10" "@${GOODSYM}&10" "@${GOODSYM}|10"
|
||||
|
||||
: "Stack access"
|
||||
test_goodarg "\$stack" "\$stack0" "\$stack1"
|
||||
test_badarg "\$stackp" "\$stack0+10" "\$stack1-10"
|
||||
|
||||
: "Retval access"
|
||||
echo "r ${PROBEFUNC} \$retval" > kprobe_events
|
||||
! echo "p ${PROBEFUNC} \$retval" > kprobe_events
|
||||
|
||||
: "Comm access"
|
||||
test_goodarg "\$comm"
|
||||
|
||||
: "Indirect memory access"
|
||||
test_goodarg "+0(${GOODREG})" "-0(${GOODREG})" "+10(\$stack)" \
|
||||
"+0(\$stack1)" "+10(@${GOODSYM}-10)" "+0(+10(+20(\$stack)))"
|
||||
test_badarg "+(${GOODREG})" "(${GOODREG}+10)" "-(${GOODREG})" "(${GOODREG})" \
|
||||
"+10(\$comm)" "+0(${GOODREG})+10"
|
||||
|
||||
: "Name assignment"
|
||||
test_goodarg "varname=${GOODREG}"
|
||||
test_badarg "varname=varname2=${GOODREG}"
|
||||
|
||||
: "Type syntax"
|
||||
test_goodarg "${GOODREG}:${GOODTYPE}"
|
||||
test_badarg "${GOODREG}::${GOODTYPE}" "${GOODREG}:${BADTYPE}" \
|
||||
"${GOODTYPE}:${GOODREG}"
|
||||
|
||||
: "Combination check"
|
||||
|
||||
test_goodarg "\$comm:string" "+0(\$stack):string"
|
||||
test_badarg "\$comm:x64" "\$stack:string" "${GOODREG}:string"
|
||||
|
||||
echo > kprobe_events
|
43
tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc
Normal file
43
tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# description: Kprobe events - probe points
|
||||
|
||||
[ -f kprobe_events ] || exit_unsupported # this is configurable
|
||||
|
||||
TARGET_FUNC=create_trace_kprobe
|
||||
|
||||
dec_addr() { # hexaddr
|
||||
printf "%d" "0x"`echo $1 | tail -c 8`
|
||||
}
|
||||
|
||||
set_offs() { # prev target next
|
||||
A1=`dec_addr $1`
|
||||
A2=`dec_addr $2`
|
||||
A3=`dec_addr $3`
|
||||
TARGET="0x$2" # an address
|
||||
PREV=`expr $A1 - $A2` # offset to previous symbol
|
||||
NEXT=+`expr $A3 - $A2` # offset to next symbol
|
||||
OVERFLOW=+`printf "0x%x" ${PREV}` # overflow offset to previous symbol
|
||||
}
|
||||
|
||||
# We have to decode symbol addresses to get correct offsets.
|
||||
# If the offset is not an instruction boundary, it cause -EILSEQ.
|
||||
set_offs `grep -A1 -B1 ${TARGET_FUNC} /proc/kallsyms | cut -f 1 -d " " | xargs`
|
||||
|
||||
UINT_TEST=no
|
||||
# printf "%x" -1 returns (unsigned long)-1.
|
||||
if [ `printf "%x" -1 | wc -c` != 9 ]; then
|
||||
UINT_TEST=yes
|
||||
fi
|
||||
|
||||
echo 0 > events/enable
|
||||
echo > kprobe_events
|
||||
echo "p:testprobe ${TARGET_FUNC}" > kprobe_events
|
||||
echo "p:testprobe ${TARGET}" > kprobe_events
|
||||
echo "p:testprobe ${TARGET_FUNC}${NEXT}" > kprobe_events
|
||||
! echo "p:testprobe ${TARGET_FUNC}${PREV}" > kprobe_events
|
||||
if [ "${UINT_TEST}" = yes ]; then
|
||||
! echo "p:testprobe ${TARGET_FUNC}${OVERFLOW}" > kprobe_events
|
||||
fi
|
||||
echo > kprobe_events
|
||||
clear_trace
|
@@ -183,8 +183,10 @@ static void test_ptrace_syscall_restart(void)
|
||||
if (ptrace(PTRACE_TRACEME, 0, 0, 0) != 0)
|
||||
err(1, "PTRACE_TRACEME");
|
||||
|
||||
pid_t pid = getpid(), tid = syscall(SYS_gettid);
|
||||
|
||||
printf("\tChild will make one syscall\n");
|
||||
raise(SIGSTOP);
|
||||
syscall(SYS_tgkill, pid, tid, SIGSTOP);
|
||||
|
||||
syscall(SYS_gettid, 10, 11, 12, 13, 14, 15);
|
||||
_exit(0);
|
||||
@@ -301,9 +303,11 @@ static void test_restart_under_ptrace(void)
|
||||
if (ptrace(PTRACE_TRACEME, 0, 0, 0) != 0)
|
||||
err(1, "PTRACE_TRACEME");
|
||||
|
||||
pid_t pid = getpid(), tid = syscall(SYS_gettid);
|
||||
|
||||
printf("\tChild will take a nap until signaled\n");
|
||||
setsigign(SIGUSR1, SA_RESTART);
|
||||
raise(SIGSTOP);
|
||||
syscall(SYS_tgkill, pid, tid, SIGSTOP);
|
||||
|
||||
syscall(SYS_pause, 0, 0, 0, 0, 0, 0);
|
||||
_exit(0);
|
||||
|
Reference in New Issue
Block a user