162306a36Sopenharmony_ci#!/bin/sh 262306a36Sopenharmony_ci# description: Snapshot and tracing setting 362306a36Sopenharmony_ci# requires: snapshot 462306a36Sopenharmony_ci# flags: instance 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciecho "Set tracing off" 762306a36Sopenharmony_ciecho 0 > tracing_on 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciecho "Allocate and take a snapshot" 1062306a36Sopenharmony_ciecho 1 > snapshot 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci# Since trace buffer is empty, snapshot is also empty, but allocated 1362306a36Sopenharmony_cigrep -q "Snapshot is allocated" snapshot 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ciecho "Ensure keep tracing off" 1662306a36Sopenharmony_citest `cat tracing_on` -eq 0 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ciecho "Set tracing on" 1962306a36Sopenharmony_ciecho 1 > tracing_on 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ciecho "Take a snapshot again" 2262306a36Sopenharmony_ciecho 1 > snapshot 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ciecho "Ensure keep tracing on" 2562306a36Sopenharmony_citest `cat tracing_on` -eq 1 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ciexit 0 28