Skip to content

Commit cec3adf

Browse files
mhiramatShuah Khan (Samsung OSG)
authored andcommitted
selftests/ftrace: Use loopback address instead of localhost
Use raw loopback address instead of localhost, because "localhost" can depend on nsswitch and in some case we can not resolve the localhost. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
1 parent 72ce3da commit cec3adf

11 files changed

Lines changed: 14 additions & 25 deletions

‎tools/testing/selftests/ftrace/test.d/event/event-enable.tc‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ fail() { #msg
1313
exit_fail
1414
}
1515

16-
yield() {
17-
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
18-
}
19-
2016
if [ ! -f set_event -o ! -d events/sched ]; then
2117
echo "event tracing is not supported"
2218
exit_unsupported

‎tools/testing/selftests/ftrace/test.d/event/event-pid.tc‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ fail() { #msg
1616
exit_fail
1717
}
1818

19-
yield() {
20-
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
21-
}
22-
2319
if [ ! -f set_event -o ! -d events/sched ]; then
2420
echo "event tracing is not supported"
2521
exit_unsupported

‎tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ fail() { #msg
1313
exit_fail
1414
}
1515

16-
yield() {
17-
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
18-
}
19-
2016
if [ ! -f set_event -o ! -d events/sched ]; then
2117
echo "event tracing is not supported"
2218
exit_unsupported

‎tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ fail() { #msg
1212
exit_fail
1313
}
1414

15-
yield() {
16-
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
17-
}
18-
1915
if [ ! -f available_events -o ! -f set_event -o ! -d events ]; then
2016
echo "event tracing is not supported"
2117
exit_unsupported

‎tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ fail() { # msg
4848
exit_fail
4949
}
5050

51-
yield() {
52-
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
53-
}
54-
5551
do_test() {
5652
disable_tracing
5753

‎tools/testing/selftests/ftrace/test.d/functions‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,9 @@ initialize_ftrace() { # Reset ftrace to initial-state
103103
clear_trace
104104
enable_tracing
105105
}
106+
107+
LOCALHOST=127.0.0.1
108+
109+
yield() {
110+
ping $LOCALHOST -c 1 || sleep .001 || usleep 1 || sleep 1
111+
}

‎tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-field-variable-support.tc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo 'hist:keys=comm:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/
2323
echo 'hist:keys=next_comm:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger
2424
echo 'hist:keys=pid,prio,comm:vals=lat:sort=pid,prio' > events/synthetic/wakeup_latency/trigger
2525

26-
ping localhost -c 3
26+
ping $LOCALHOST -c 3
2727
if ! grep -q "ping" events/synthetic/wakeup_latency/hist; then
2828
fail "Failed to create inter-event histogram"
2929
fi

‎tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-inter-event-combined-hist.tc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ echo 'waking+wakeup_latency u64 lat; pid_t pid' >> synthetic_events
3737
echo 'hist:keys=pid,lat:sort=pid,lat:ww_lat=$waking_lat+$wakeup_lat:onmatch(synthetic.wakeup_latency).waking+wakeup_latency($ww_lat,pid)' >> events/synthetic/wakeup_latency/trigger
3838
echo 'hist:keys=pid,lat:sort=pid,lat' >> events/synthetic/waking+wakeup_latency/trigger
3939

40-
ping localhost -c 3
40+
ping $LOCALHOST -c 3
4141
if ! grep -q "pid:" events/synthetic/waking+wakeup_latency/hist; then
4242
fail "Failed to create combined histogram"
4343
fi

‎tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-action-hist.tc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ echo "Test histogram variables,simple expression support and onmatch action"
2929
echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
3030
echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger
3131
echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > events/synthetic/wakeup_latency/trigger
32-
ping localhost -c 5
32+
33+
ping $LOCALHOST -c 5
3334
if ! grep -q "ping" events/synthetic/wakeup_latency/hist; then
3435
fail "Failed to create onmatch action inter-event histogram"
3536
fi

‎tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-onmatch-onmax-action-hist.tc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ echo "Test histogram variables,simple expression support and onmatch-onmax actio
2929
echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
3030
echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm):onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
3131
echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > events/synthetic/wakeup_latency/trigger
32-
ping localhost -c 5
32+
33+
ping $LOCALHOST -c 5
3334
if [ ! grep -q "ping" events/synthetic/wakeup_latency/hist -o ! grep -q "max:" events/sched/sched_switch/hist]; then
3435
fail "Failed to create onmatch-onmax action inter-event histogram"
3536
fi

0 commit comments

Comments
 (0)