1
V2: Changed bc invocation to return 0 on success and 1 on error.
2
1
There is a known issue that the leader sampling is inconsistent, since
3
There is a known issue that the leader sampling is inconsistent, since
2
throttle only affect leader, not the slave. The detail is in [1]. To
4
throttle only affect leader, not the slave. The detail is in [1]. To
3
maintain test coverage, this patch sets a tolerance rate of 80% to
5
maintain test coverage, this patch sets a tolerance rate of 80% to
4
accommodate the throttled samples and prevent test failures due to
6
accommodate the throttled samples and prevent test failures due to
5
throttling.
7
throttling.
...
...
8
10
9
Signed-off-by: Chun-Tse Shao <ctshao@google.com>
11
Signed-off-by: Chun-Tse Shao <ctshao@google.com>
10
Suggested-by: Ian Rogers <irogers@google.com>
12
Suggested-by: Ian Rogers <irogers@google.com>
11
Suggested-by: Thomas Richter <tmricht@linux.ibm.com>
13
Suggested-by: Thomas Richter <tmricht@linux.ibm.com>
12
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
14
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
15
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
13
---
16
---
14
tools/perf/tests/shell/record.sh | 25 +++++++++++++++++++------
17
tools/perf/tests/shell/record.sh | 26 ++++++++++++++++++++------
15
1 file changed, 19 insertions(+), 6 deletions(-)
18
1 file changed, 20 insertions(+), 6 deletions(-)
16
19
17
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
20
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
18
index XXXXXXX..XXXXXXX 100755
21
index XXXXXXX..XXXXXXX 100755
19
--- a/tools/perf/tests/shell/record.sh
22
--- a/tools/perf/tests/shell/record.sh
20
+++ b/tools/perf/tests/shell/record.sh
23
+++ b/tools/perf/tests/shell/record.sh
...
...
48
fi
51
fi
49
index=$(($index+1))
52
index=$(($index+1))
50
prev_cycles=$cycles
53
prev_cycles=$cycles
51
done < $script_output
54
done < $script_output
52
- echo "Basic leader sampling test [Success]"
55
- echo "Basic leader sampling test [Success]"
53
+ if [[ "$(echo "scale=2; $invalid_counts/($invalid_counts+$valid_counts)" | bc)" > 1-$tolerance_rate ]]
56
+ isok=$(echo "scale=2; val=$invalid_counts/($invalid_counts+$valid_counts); if (val < (1-$tolerance_rate)) { 0 } else { 1 };" | bc -q)
57
+ if [ $isok -eq 1 ]
54
+ then
58
+ then
55
+ echo "Leader sampling [Failed inconsistent cycles count]"
59
+ echo "Leader sampling [Failed inconsistent cycles count]"
56
+ err=1
60
+ err=1
57
+ else
61
+ else
58
+ echo "Basic leader sampling test [Success]"
62
+ echo "Basic leader sampling test [Success]"
59
+ fi
63
+ fi
60
}
64
}
61
65
62
test_topdown_leader_sampling() {
66
test_topdown_leader_sampling() {
63
--
67
--
64
2.49.0.472.ge94155a9ec-goog
68
2.49.0
diff view generated by jsdifflib