Lines Matching +full:cpu +full:- +full:2

2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2021-2022 NXP
5 tc_testing_scripts_dir=$(dirname $0)/../../tc-testing/scripts
15 # https://github.com/vladimiroltean/tsn-scripts
16 # WARNING: isochron versions pre-1.0 are unstable,
31 if ! [ -z "${uds_address}" ]; then
32 extra_args="${extra_args} -z ${uds_address}"
37 chrt -f 10 phc2sys -m \
38 -a -rr \
39 --step_threshold 0.00002 \
40 --first_step_threshold 0.00002 \
42 > "${phc2sys_log}" 2>&1 &
52 { kill ${phc2sys_pid} && wait ${phc2sys_pid}; } 2> /dev/null
53 rm "${phc2sys_log}" 2> /dev/null
67 local slave_only=$2
74 extra_args="${extra_args} -i ${if_name}"
78 extra_args="${extra_args} -s"
83 declare -g "${log}=$(mktemp)"
85 chrt -f 10 ptp4l -m -2 -P \
86 --step_threshold 0.00002 \
87 --first_step_threshold 0.00002 \
88 --tx_timestamp_timeout 100 \
89 --uds_address="${uds_address}" \
91 > "${!log}" 2>&1 &
92 declare -g "${pid}=$!"
105 { kill ${!pid} && wait ${!pid}; } 2> /dev/null
106 rm "${!log}" 2> /dev/null
111 local cpu=$1
112 local freq="cpu${cpu}_freq"
113 local governor="cpu${cpu}_governor"
116 if ! [ -d /sys/bus/cpu/devices/cpu${cpu}/cpufreq ]; then
120 # declare dynamic variables cpu${cpu}_freq and cpu${cpu}_governor as
122 declare -g "${freq}=$(cat /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_min_freq)"
123 declare -g "${governor}=$(cat /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_governor)"
125 cat /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_max_freq > \
126 /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_min_freq
127 echo -n "performance" > \
128 /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_governor
133 local cpu=$1
134 local freq="cpu${cpu}_freq"
135 local governor="cpu${cpu}_governor"
137 if ! [ -d /sys/bus/cpu/devices/cpu${cpu}/cpufreq ]; then
141 echo "${!freq}" > /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_min_freq
142 echo -n "${!governor}" > \
143 /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_governor
149 local uds=$2
154 if ! [ -z "${uds}" ]; then
155 extra_args="${extra_args} --unix-domain-socket ${uds}"
159 --interface ${if_name} \
160 --sched-priority 98 \
161 --sched-fifo \
162 --utc-tai-offset ${UTC_TAI_OFFSET} \
163 --stats-port ${stats_port} \
164 --quiet \
166 declare -g "${pid}=$!"
176 { kill ${!pid} && wait ${!pid}; } 2> /dev/null
199 if ! [ -z "${dst_ip}" ]; then
203 if ! [ -z "${vrf}" ]; then
207 if ! [ -z "${vid}" ]; then
208 vid="--vid=${vid}"
211 if [ -z "${receiver_uds}" ]; then
212 extra_args="${extra_args} --omit-remote-sync"
215 if ! [ -z "${shift_time}" ]; then
216 extra_args="${extra_args} --shift-time=${shift_time}"
219 if ! [ -z "${window_size}" ]; then
220 extra_args="${extra_args} --window-size=${window_size}"
224 extra_args="${extra_args} --l2 --etype=0xdead ${vid}"
225 receiver_extra_args="--l2 --etype=0xdead"
227 extra_args="${extra_args} --l4 --ip-destination=${dst_ip}"
228 receiver_extra_args="--l4"
236 --interface ${sender_if_name} \
237 --unix-domain-socket ${sender_uds} \
238 --priority ${priority} \
239 --base-time ${base_time} \
240 --cycle-time ${cycle_time} \
241 --num-frames ${num_pkts} \
242 --frame-size 64 \
243 --txtime \
244 --utc-tai-offset ${UTC_TAI_OFFSET} \
245 --cpu-mask $((1 << ${ISOCHRON_CPU})) \
246 --sched-fifo \
247 --sched-priority 98 \
248 --client 127.0.0.1 \
249 --sync-threshold 5000 \
250 --output-file ${isochron_dat} \
252 --quiet
263 # Count all received packets by looking at the non-zero RX timestamps
265 --input-file "${isochron_dat}" \
266 --printf-format "%u\n" --printf-args "R" | \
267 grep -w -v '0' | wc -l