Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
81 lines
2.1 KiB
Bash
81 lines
2.1 KiB
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: event trigger - test synthetic_events syntax parser
|
|
|
|
do_reset() {
|
|
reset_trigger
|
|
echo > set_event
|
|
clear_trace
|
|
}
|
|
|
|
fail() { #msg
|
|
do_reset
|
|
echo $1
|
|
exit_fail
|
|
}
|
|
|
|
if [ ! -f set_event ]; then
|
|
echo "event tracing is not supported"
|
|
exit_unsupported
|
|
fi
|
|
|
|
if [ ! -f synthetic_events ]; then
|
|
echo "synthetic event is not supported"
|
|
exit_unsupported
|
|
fi
|
|
|
|
reset_tracer
|
|
do_reset
|
|
|
|
echo "Test synthetic_events syntax parser"
|
|
|
|
echo > synthetic_events
|
|
|
|
# synthetic event must have a field
|
|
! echo "myevent" >> synthetic_events
|
|
echo "myevent u64 var1" >> synthetic_events
|
|
|
|
# synthetic event must be found in synthetic_events
|
|
grep "myevent[[:space:]]u64 var1" synthetic_events
|
|
|
|
# it is not possible to add same name event
|
|
! echo "myevent u64 var2" >> synthetic_events
|
|
|
|
# Non-append open will cleanup all events and add new one
|
|
echo "myevent u64 var2" > synthetic_events
|
|
|
|
# multiple fields with different spaces
|
|
echo "myevent u64 var1; u64 var2;" > synthetic_events
|
|
grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
|
|
echo "myevent u64 var1 ; u64 var2 ;" > synthetic_events
|
|
grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
|
|
echo "myevent u64 var1 ;u64 var2" > synthetic_events
|
|
grep "myevent[[:space:]]u64 var1; u64 var2" synthetic_events
|
|
|
|
# test field types
|
|
echo "myevent u32 var" > synthetic_events
|
|
echo "myevent u16 var" > synthetic_events
|
|
echo "myevent u8 var" > synthetic_events
|
|
echo "myevent s64 var" > synthetic_events
|
|
echo "myevent s32 var" > synthetic_events
|
|
echo "myevent s16 var" > synthetic_events
|
|
echo "myevent s8 var" > synthetic_events
|
|
|
|
echo "myevent char var" > synthetic_events
|
|
echo "myevent int var" > synthetic_events
|
|
echo "myevent long var" > synthetic_events
|
|
echo "myevent pid_t var" > synthetic_events
|
|
|
|
echo "myevent unsigned char var" > synthetic_events
|
|
echo "myevent unsigned int var" > synthetic_events
|
|
echo "myevent unsigned long var" > synthetic_events
|
|
grep "myevent[[:space:]]unsigned long var" synthetic_events
|
|
|
|
# test string type
|
|
echo "myevent char var[10]" > synthetic_events
|
|
grep "myevent[[:space:]]char\[10\] var" synthetic_events
|
|
|
|
do_reset
|
|
|
|
exit 0
|