1#!/bin/sh
2# description: Snapshot and tracing setting
3# flags: instance
4
5[ ! -f snapshot ] && exit_unsupported
6
7echo "Set tracing off"
8echo 0 > tracing_on
9
10echo "Allocate and take a snapshot"
11echo 1 > snapshot
12
13# Since trace buffer is empty, snapshot is also empty, but allocated
14grep -q "Snapshot is allocated" snapshot
15
16echo "Ensure keep tracing off"
17test `cat tracing_on` -eq 0
18
19echo "Set tracing on"
20echo 1 > tracing_on
21
22echo "Take a snapshot again"
23echo 1 > snapshot
24
25echo "Ensure keep tracing on"
26test `cat tracing_on` -eq 1
27
28exit 0
29