Skip to content

Commit 8e4701b

Browse files
committed
all three profiling tests updated to generate valgrind results
1 parent f5ec549 commit 8e4701b

7 files changed

Lines changed: 17 additions & 67 deletions

File tree

src/tests/multi-server/scripts/profiling/start_valgrind_profiling.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
# Clear any stale marker from a previous run
66
rm -f /etc/prof-results/.profiling_complete
7-
rm -f /etc/prof-results/start_valgrind_profiling.log
7+
rm -f /etc/prof-results/valgrind_profiling.log
88

9-
exec > /etc/prof-results/start_valgrind_profiling.log 2>&1
9+
exec > /etc/prof-results/valgrind_profiling.log 2>&1
1010

1111
# Ignore SIGTERM — freeradius broadcasts it to the process group on shutdown,
1212
# which would otherwise kill this script before it can touch .profiling_complete
@@ -33,13 +33,13 @@ valgrind \
3333
--keep-debuginfo=yes \
3434
--instr-atstart=no \
3535
freeradius -f -l stdout -S resources.talloc_skip_cleanup=yes 2>&1 | \
36-
tee /etc/prof-results/freeradius_profiling.log &
36+
tee /etc/prof-results/freeradius.log &
3737
VALGRIND_PID=$!
3838

3939
# Wait for server ready (bail out if freeradius fails to start under valgrind)
4040
STARTUP_TIMEOUT=300
4141
STARTUP_ELAPSED=0
42-
until grep -q "Ready to process requests" /etc/prof-results/freeradius_profiling.log; do
42+
until grep -q "Ready to process requests" /etc/prof-results/freeradius.log; do
4343
sleep 1
4444
STARTUP_ELAPSED=$(( STARTUP_ELAPSED + 1 ))
4545
if [ ${STARTUP_ELAPSED} -ge ${STARTUP_TIMEOUT} ]; then
@@ -81,7 +81,12 @@ sleep 5
8181

8282
# Signal that valgrind has finished writing all profiling data
8383
echo "INFO: Profiling complete at $(date)"
84-
touch /etc/prof-results/.profiling_complete
8584

86-
# Restore stdout/stderr so subsequent commands in the parent shell
85+
echo "INFO: running callgrind_annotate to generate report"
86+
#callgrind_annotate $(find /etc/prof-results -name "callgrind.out.*" -size +0c | sort) > /etc/prof-results/callgrind_report.txt
87+
cmd='callgrind_annotate $(find /etc/prof-results -name "callgrind.out.*" -size +0c | sort) > /etc/prof-results/callgrind_report.txt'
88+
echo "$cmd"
89+
eval "$cmd"
90+
91+
# Restore stdout/stderr
8792
exec > /dev/null 2>&1

src/tests/multi-server/tests/prof-accept/short.ci.test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ loadgen:
1313
repeat: "no"
1414

1515
# Test framework
16-
# state_1 must cover: valgrind startup (slow under callgrind) + SEND_DURATION sleep (30s) + callgrind dump write
1716
test_timeout: 125
1817
test_state1_verify_timeout: 120
1918
test_state2_verify_timeout: 30

src/tests/multi-server/tests/prof-accept/template.yml.j2

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ states:
3232

3333
source /etc/freeradius/start_valgrind_profiling.sh
3434

35-
# Block until valgrind finishes writing all profiling data.
36-
# start_valgrind_profiling.sh touches this file after `wait` returns.
37-
#until [ -f /etc/prof-results/.profiling_complete ]; do sleep 5; done
38-
rm -f /etc/prof-results/.profiling_complete
39-
40-
echo "INFO: running callgrind_annotate to generate report" | tee -a /etc/prof-results/start_valgrind_profiling.log
41-
callgrind_annotate $(find /etc/prof-results -name "callgrind.out.*" -size +0c | sort) > /etc/prof-results/callgrind_report.txt
42-
4335
detach: true
4436
verify:
4537
timeout: {{ test_state1_verify_timeout }}

src/tests/multi-server/tests/prof-ldap/short.ci.test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ loadgen:
1313
repeat: "no"
1414

1515
# Test framework
16-
test_timeout: 165
17-
test_state1_verify_timeout: 130
18-
test_state2_verify_timeout: 5
16+
test_timeout: 125
17+
test_state1_verify_timeout: 120
18+
test_state2_verify_timeout: 30

src/tests/multi-server/tests/prof-ldap/template.yml.j2

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,9 @@ states:
3030
{%- endfor %}
3131
printf " NUM_MESSAGES: %s\n" "$TEST_LOADGEN_NUM_MESSAGES"
3232

33-
# No profiling
34-
#exec freeradius -f -l stdout
35-
3633
source /etc/freeradius/start_valgrind_profiling.sh
3734

3835
detach: true
39-
- execute_command:
40-
command: |
41-
# Block until valgrind finishes writing all profiling data.
42-
# start_valgrind_profiling.sh touches this file after `wait` returns.
43-
until [ -f /etc/prof-results/.profiling_complete ]; do sleep 5; done
44-
rm -f /etc/prof-results/.profiling_complete
4536
verify:
4637
timeout: {{ test_state1_verify_timeout }}
4738
trigger_mode: unordered
48-
state_2:
49-
description: >
50-
Generate Valgrind/callgrind profiling report
51-
host:
52-
profiling-server:
53-
actions:
54-
- execute_command:
55-
command: |
56-
# Generate report from non-empty callgrind.out.* output files
57-
cd /etc/prof-results
58-
callgrind_annotate $(find . -name "callgrind.out.*" -size +0c | sort) > callgrind_report.txt
59-
verify:
60-
timeout: {{ test_state2_verify_timeout }}
61-
trigger_mode: unordered

src/tests/multi-server/tests/prof-pap-auth/short.ci.test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ loadgen:
1313
repeat: "no"
1414

1515
# Test framework
16-
test_timeout: 165
17-
test_state1_verify_timeout: 130
18-
test_state2_verify_timeout: 5
16+
test_timeout: 125
17+
test_state1_verify_timeout: 120
18+
test_state2_verify_timeout: 30

src/tests/multi-server/tests/prof-pap-auth/template.yml.j2

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,9 @@ states:
3030
{%- endfor %}
3131
printf " NUM_MESSAGES: %s\n" "$TEST_LOADGEN_NUM_MESSAGES"
3232

33-
# No profiling
34-
#exec freeradius -f -l stdout
35-
3633
source /etc/freeradius/start_valgrind_profiling.sh
3734

3835
detach: true
39-
- execute_command:
40-
command: |
41-
# Block until valgrind finishes writing all profiling data.
42-
# start_valgrind_profiling.sh touches this file after `wait` returns.
43-
until [ -f /etc/prof-results/.profiling_complete ]; do sleep 5; done
44-
rm -f /etc/prof-results/.profiling_complete
4536
verify:
4637
timeout: {{ test_state1_verify_timeout }}
4738
trigger_mode: unordered
48-
state_2:
49-
description: >
50-
Generate Valgrind/callgrind profiling report
51-
host:
52-
profiling-server:
53-
actions:
54-
- execute_command:
55-
command: |
56-
# Generate report from non-empty callgrind.out.* output files
57-
cd /etc/prof-results
58-
callgrind_annotate $(find . -name "callgrind.out.*" -size +0c | sort) > callgrind_report.txt
59-
verify:
60-
timeout: {{ test_state2_verify_timeout }}
61-
trigger_mode: unordered

0 commit comments

Comments
 (0)