1f08c3bdfSopenharmony_ci# Test Case 5 - Pseudocode
2f08c3bdfSopenharmony_ci
3f08c3bdfSopenharmony_ci# This test looks for memory leaks or deadlocks
4f08c3bdfSopenharmony_ci
5f08c3bdfSopenharmony_ci# "mm_struct slab leak (affected only some architectures)"
6f08c3bdfSopenharmony_ci
7f08c3bdfSopenharmony_ciINTERVAL=30
8f08c3bdfSopenharmony_ciTHRESHHOLD='xxx'
9f08c3bdfSopenharmony_ci
10f08c3bdfSopenharmony_ci# TODO:  Start monitoring memory usage via vmstat and sar
11f08c3bdfSopenharmony_ci
12f08c3bdfSopenharmony_ci# TODO:  Start dbt2, running for at least 4 hours
13f08c3bdfSopenharmony_ci
14f08c3bdfSopenharmony_ciwhile [ 1 ]; do
15f08c3bdfSopenharmony_ci    last if workload has completed
16f08c3bdfSopenharmony_ci
17f08c3bdfSopenharmony_ci    select a cpu at random
18f08c3bdfSopenharmony_ci    if cpu is online
19f08c3bdfSopenharmony_ci        offline it
20f08c3bdfSopenharmony_ci    else
21f08c3bdfSopenharmony_ci        online it
22f08c3bdfSopenharmony_ci    fi
23f08c3bdfSopenharmony_ci
24f08c3bdfSopenharmony_ci    measure current throughput
25f08c3bdfSopenharmony_ci    # TODO:  Mary and Mark will better define how to detect
26f08c3bdfSopenharmony_ci    # the threshhold and what to do in response
27f08c3bdfSopenharmony_ci    if [ throughput falls below $THRESHHOLD ]; then
28f08c3bdfSopenharmony_ci        echo "Throughput has fallen below threshhold."
29f08c3bdfSopenharmony_ci    fi
30f08c3bdfSopenharmony_ci
31f08c3bdfSopenharmony_ci    sleep $INTERVAL
32f08c3bdfSopenharmony_cidone
33f08c3bdfSopenharmony_ci
34f08c3bdfSopenharmony_ci# Analyze system statistics to determine memory leaks
35f08c3bdfSopenharmony_ci# Analyze drops in activities
36