Skip to content

Commit

Permalink
Add Intel PT case
Browse files Browse the repository at this point in the history
Add new processor trace case: filter_kernel_test

Signed-off-by: qwang59 <[email protected]>
  • Loading branch information
qwang59 committed Apr 12, 2024
1 parent 1e9eea1 commit e11f9ae
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pt/perf_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,20 @@ tracefilter_test() {
rm -f $temp_log
}

# Function to check kernel level trace filter with __sched samples
filter_kernel_test() {
do_cmd "perf record --kcore -e intel_pt//k --filter 'filter __schedule' -a -- sleep 0.1 >& $perf_log"
result_check
do_cmd "perf script --itrace=b | tail > $temp_log"
cat $temp_log
count_e=$(grep -c "__schedule" "$temp_log")
count_p=$(cat "$temp_log" | wc -l)
test_print_trc "count_e = $count_e count_p=$count_p"
[[ $count_e -eq $count_p ]] || die "__sched count is not right, trace filter with __schedule for kernel is failed!"
rm -f "$perf_log"
rm -f "$temp_log"
}

# Function to check if trace filter with __sched for kernel is supported and detected.
filter_kernel_cpu_test() {
rm perfdata -rf
Expand Down Expand Up @@ -644,6 +658,9 @@ perftest() {
trace_filter)
tracefilter_test
;;
trace_filter_kernel)
filter_kernel_test
;;
trace_filter_kernel_cpu)
filter_kernel_cpu_test
;;
Expand Down
2 changes: 2 additions & 0 deletions pt/tests
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ perf_tests.sh -t event_trace
perf_tests.sh -t trace_stop
# Verify the trace filter with main count
perf_tests.sh -t trace_filter
# Verify the kernel level trace filter with _sched samples
perf_tests.sh -t trace_filter_kernel
# Verify if trace filter with __sched for kernel is supported and detected
perf_tests.sh -t trace_filter_kernel_cpu

Expand Down

0 comments on commit e11f9ae

Please sign in to comment.