18c2ecf20Sopenharmony_ci#!/bin/sh 28c2ecf20Sopenharmony_ci# description: Snapshot and tracing setting 38c2ecf20Sopenharmony_ci# requires: snapshot 48c2ecf20Sopenharmony_ci# flags: instance 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciecho "Set tracing off" 78c2ecf20Sopenharmony_ciecho 0 > tracing_on 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciecho "Allocate and take a snapshot" 108c2ecf20Sopenharmony_ciecho 1 > snapshot 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci# Since trace buffer is empty, snapshot is also empty, but allocated 138c2ecf20Sopenharmony_cigrep -q "Snapshot is allocated" snapshot 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciecho "Ensure keep tracing off" 168c2ecf20Sopenharmony_citest `cat tracing_on` -eq 0 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciecho "Set tracing on" 198c2ecf20Sopenharmony_ciecho 1 > tracing_on 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ciecho "Take a snapshot again" 228c2ecf20Sopenharmony_ciecho 1 > snapshot 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ciecho "Ensure keep tracing on" 258c2ecf20Sopenharmony_citest `cat tracing_on` -eq 1 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ciexit 0 28