ftrace_regression02.sh 2.7 KB

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