Lines Matching +full:local +full:- +full:pid
3 # SPDX-License-Identifier: GPL-2.0
7 local line=$1
8 local name=$2
9 local base=$3
10 local output=$4
11 local lock=$5
12 local up=$6
14 local line_name=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $2 }'`
15 local line_base=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $3 }'`
16 local line_output=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $4 }'`
17 local line_lock=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $5 }'`
18 local line_up=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $6 }'`
48 local line=$1
49 local name=$2
50 local run=$3
51 local base=$4
52 local output=$5
53 local control=$6
54 local ack=$7
55 local up=$8
57 local line_name=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $2 }'`
58 local line_run=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $3 }'`
59 local line_base=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $4 }'`
60 local line_output=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $5 }'`
61 local line_control=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $6 }'`
62 local line_ack=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $7 }'`
63 local line_up=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $8 }'`
103 local config=$1
105 local line=`perf daemon --config ${config} -x: | head -1`
106 local pid=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $1 }'`
109 trap - SIGINT SIGTERM
112 perf daemon stop --config ${config}
114 # ... and wait for the pid to go away
115 tail --pid=${pid} -f /dev/null
120 local config=$1
121 local session=$2
123 perf daemon start --config ${config}
129 local state="FAIL"
130 local retries=0
132 state=`perf daemon ping --config ${config} --session ${session} | awk '{ print $1 }'`
135 if [ ${retries} -ge 600 ]; then
147 local config=$(mktemp /tmp/perf.daemon.config.XXX)
148 local base=$(mktemp -d /tmp/perf.daemon.base.XXX)
154 [session-size]
155 run = -e cpu-clock -m 1 sleep 10
157 [session-time]
158 run = -e task-clock -m 1 sleep 10
161 sed -i -e "s|BASE|${base}|" ${config}
167 # pid:daemon:base:base/output:base/lock
168 local line=`perf daemon --config ${config} -x: | head -1`
172 # pid:size:-e cpu-clock:base/size:base/size/output:base/size/control:base/size/ack:0
173 local line=`perf daemon --config ${config} -x: | head -2 | tail -1`
174 check_line_other "${line}" size "-e cpu-clock -m 1 sleep 10" ${base}/session-size \
175 ${base}/session-size/output ${base}/session-size/control \
176 ${base}/session-size/ack "0"
179 # pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0
180 local line=`perf daemon --config ${config} -x: | head -3 | tail -1`
181 check_line_other "${line}" time "-e task-clock -m 1 sleep 10" ${base}/session-time \
182 ${base}/session-time/output ${base}/session-time/control \
183 ${base}/session-time/ack "0"
188 rm -rf ${base}
189 rm -f ${config}
196 local config=$(mktemp /tmp/perf.daemon.config.XXX)
197 local base=$(mktemp -d /tmp/perf.daemon.base.XXX)
204 [session-size]
205 run = -e cpu-clock -m 1 sleep 10
207 [session-time]
208 run = -e task-clock -m 1 sleep 10
211 sed -i -e "s|BASE|${base}|" ${config}
217 # pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0
218 local line=`perf daemon --config ${config} -x: | head -3 | tail -1`
219 check_line_other "${line}" time "-e task-clock -m 1 sleep 10" ${base}/session-time \
220 ${base}/session-time/output ${base}/session-time/control ${base}/session-time/ack "0"
221 local pid=`echo "${line}" | awk 'BEGIN { FS = ":" } ; { print $1 }'`
224 local config_new=${config}.new
229 [session-size]
230 run = -e cpu-clock -m 1 sleep 10
232 [session-time]
233 run = -e cpu-clock -m 1 sleep 10
236 # TEST 1 - change config
238 sed -i -e "s|BASE|${base}|" ${config_new}
242 tail --pid=${pid} -f /dev/null
245 local state="FAIL"
247 state=`perf daemon ping --config ${config} --session time | awk '{ print $1 }'`
251 # pid:time:-e task-clock:base/time:base/time/output:base/time/control:base/time/ack:0
252 local line=`perf daemon --config ${config} -x: | head -3 | tail -1`
253 check_line_other "${line}" time "-e cpu-clock -m 1 sleep 10" ${base}/session-time \
254 ${base}/session-time/output ${base}/session-time/control ${base}/session-time/ack "0"
256 # TEST 2 - empty config
258 local config_empty=${config}.empty
265 sed -i -e "s|BASE|${base}|" ${config_empty}
269 local state="OK"
271 state=`perf daemon ping --config ${config} --session time | awk '{ print $1 }'`
274 local state="OK"
276 state=`perf daemon ping --config ${config} --session size | awk '{ print $1 }'`
279 local one=`perf daemon --config ${config} -x: | wc -l`
281 if [ ${one} -ne "1" ]; then
286 # TEST 3 - config again
291 local state="FAIL"
293 state=`perf daemon ping --config ${config} --session size | awk '{ print $1 }'`
297 local state="FAIL"
299 state=`perf daemon ping --config ${config} --session time | awk '{ print $1 }'`
305 rm -rf ${base}
306 rm -f ${config}
307 rm -f ${config_new}
308 rm -f ${config_empty}
315 local config=$(mktemp /tmp/perf.daemon.config.XXX)
316 local base=$(mktemp -d /tmp/perf.daemon.base.XXX)
323 [session-size]
324 run = -e cpu-clock -m 1 sleep 10
326 [session-time]
327 run = -e task-clock -m 1 sleep 10
330 sed -i -e "s|BASE|${base}|" ${config}
335 …local pid_size=`perf daemon --config ${config} -x: | head -2 | tail -1 | awk 'BEGIN { FS = ":" } ;…
336 …local pid_time=`perf daemon --config ${config} -x: | head -3 | tail -1 | awk 'BEGIN { FS = ":" } ;…
339 if [ ! -d "/proc/${pid_size}" ]; then
343 if [ ! -d "/proc/${pid_time}" ]; then
351 if [ -d "/proc/${pid_size}" ]; then
355 if [ -d "/proc/${pid_time}" ]; then
359 rm -rf ${base}
360 rm -f ${config}
367 local config=$(mktemp /tmp/perf.daemon.config.XXX)
368 local base=$(mktemp -d /tmp/perf.daemon.base.XXX)
375 [session-test]
376 run = -e cpu-clock --switch-output -m 1 sleep 10
379 sed -i -e "s|BASE|${base}|" ${config}
385 perf daemon signal --config ${config} --session test
386 perf daemon signal --config ${config}
392 count=`ls ${base}/session-test/ | grep perf.data | wc -l`
393 if [ ${count} -ne 3 ]; then
398 rm -rf ${base}
399 rm -f ${config}
406 local config=$(mktemp /tmp/perf.daemon.config.XXX)
407 local base=$(mktemp -d /tmp/perf.daemon.base.XXX)
414 [session-size]
415 run = -e cpu-clock -m 1 sleep 10
417 [session-time]
418 run = -e task-clock -m 1 sleep 10
421 sed -i -e "s|BASE|${base}|" ${config}
426 size=`perf daemon ping --config ${config} --session size | awk '{ print $1 }'`
427 type=`perf daemon ping --config ${config} --session time | awk '{ print $1 }'`
429 if [ ${size} != "OK" -o ${type} != "OK" ]; then
437 rm -rf ${base}
438 rm -f ${config}
445 local config=$(mktemp /tmp/perf.daemon.config.XXX)
446 local base=$(mktemp -d /tmp/perf.daemon.base.XXX)
453 [session-size]
454 run = -e cpu-clock -m 1 sleep 10
457 sed -i -e "s|BASE|${base}|" ${config}
463 failed=`perf daemon start --config ${config} 2>&1 | awk '{ print $1 }'`
474 rm -rf ${base}
475 rm -f ${config}