1f08c3bdfSopenharmony_ci#! /bin/sh
2f08c3bdfSopenharmony_ci
3f08c3bdfSopenharmony_ci###########################################################################
4f08c3bdfSopenharmony_ci##                                                                       ##
5f08c3bdfSopenharmony_ci## Copyright (c) 2015, Red Hat Inc.                                      ##
6f08c3bdfSopenharmony_ci##                                                                       ##
7f08c3bdfSopenharmony_ci## This program is free software: you can redistribute it and/or modify  ##
8f08c3bdfSopenharmony_ci## it under the terms of the GNU General Public License as published by  ##
9f08c3bdfSopenharmony_ci## the Free Software Foundation, either version 3 of the License, or     ##
10f08c3bdfSopenharmony_ci## (at your option) any later version.                                   ##
11f08c3bdfSopenharmony_ci##                                                                       ##
12f08c3bdfSopenharmony_ci## This program is distributed in the hope that it will be useful,       ##
13f08c3bdfSopenharmony_ci## but WITHOUT ANY WARRANTY; without even the implied warranty of        ##
14f08c3bdfSopenharmony_ci## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          ##
15f08c3bdfSopenharmony_ci## GNU General Public License for more details.                          ##
16f08c3bdfSopenharmony_ci##                                                                       ##
17f08c3bdfSopenharmony_ci## You should have received a copy of the GNU General Public License     ##
18f08c3bdfSopenharmony_ci## along with this program. If not, see <http://www.gnu.org/licenses/>.  ##
19f08c3bdfSopenharmony_ci##                                                                       ##
20f08c3bdfSopenharmony_ci## Author: Li Wang <liwang@redhat.com>                                   ##
21f08c3bdfSopenharmony_ci##                                                                       ##
22f08c3bdfSopenharmony_ci###########################################################################
23f08c3bdfSopenharmony_ci##                                                                       ##
24f08c3bdfSopenharmony_ci## Summary: check signal:signal_generate gives 2 more fields: grp res    ##
25f08c3bdfSopenharmony_ci##                                                                       ##
26f08c3bdfSopenharmony_ci## This testcase is writing for signal events change:                    ##
27f08c3bdfSopenharmony_ci##       6c303d3 tracing: let trace_signal_generate() report more info...##
28f08c3bdfSopenharmony_ci##       163566f tracing: send_sigqueue() needs trace_signal_generate()  ##
29f08c3bdfSopenharmony_ci##                                                                       ##
30f08c3bdfSopenharmony_ci###########################################################################
31f08c3bdfSopenharmony_ci
32f08c3bdfSopenharmony_ciexport TCID="ftrace_regression02"
33f08c3bdfSopenharmony_ciexport TST_TOTAL=1
34f08c3bdfSopenharmony_ci
35f08c3bdfSopenharmony_ci. ftrace_lib.sh
36f08c3bdfSopenharmony_ci
37f08c3bdfSopenharmony_ciftrace_signal_test()
38f08c3bdfSopenharmony_ci{
39f08c3bdfSopenharmony_ci	# Set envent
40f08c3bdfSopenharmony_ci	echo 'signal:signal_generate' > $TRACING_PATH/set_event
41f08c3bdfSopenharmony_ci	echo 1 > $TRACING_PATH/tracing_on
42f08c3bdfSopenharmony_ci	echo > $TRACING_PATH/trace
43f08c3bdfSopenharmony_ci
44f08c3bdfSopenharmony_ci	# just to generate trace
45f08c3bdfSopenharmony_ci	for i in $(seq 100); do
46f08c3bdfSopenharmony_ci		ls -l /proc > /dev/null 2>&1
47f08c3bdfSopenharmony_ci	done
48f08c3bdfSopenharmony_ci
49f08c3bdfSopenharmony_ci	grep -q 'grp=[0-9] res=[0-9]' $TRACING_PATH/trace
50f08c3bdfSopenharmony_ci	if [ $? -eq 0 ]; then
51f08c3bdfSopenharmony_ci		tst_resm TPASS "finished running the test."
52f08c3bdfSopenharmony_ci	else
53f08c3bdfSopenharmony_ci		tst_resm TFAIL "running the test failed, please check log message."
54f08c3bdfSopenharmony_ci	fi
55f08c3bdfSopenharmony_ci}
56f08c3bdfSopenharmony_ci
57f08c3bdfSopenharmony_ciif tst_kvcmp -lt "3.2"; then
58f08c3bdfSopenharmony_ci	tst_brkm TCONF "The test should be run in kernels >= 3.2.0 Skip the test..."
59f08c3bdfSopenharmony_cifi
60f08c3bdfSopenharmony_ci
61f08c3bdfSopenharmony_ciftrace_signal_test
62f08c3bdfSopenharmony_ci
63f08c3bdfSopenharmony_citst_exit
64