ftrace_regression01.sh 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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: panic while using userstacktrace ##
  24. ## ##
  25. ## BUG: unable to handle kernel paging request at 00000000417683c0 ##
  26. ## IP: [<ffffffff8105c834>] update_curr+0x124/0x1e0 ##
  27. ## PGD 41a796067 PUD 0 ##
  28. ## Thread overran stack, or stack corrupted ##
  29. ## Oops: 0000 [#1] SMP ##
  30. ## last sysfs file: ../system/cpu/cpu15/cache/index2/shared_cpu_map ##
  31. ## ##
  32. ## The bug was fixed by: ##
  33. ## 1dbd195 (tracing: Fix preempt count leak) ##
  34. ## ##
  35. ###########################################################################
  36. export TCID="ftrace_regression01"
  37. export TST_TOTAL=1
  38. . ftrace_lib.sh
  39. LOOP=10
  40. TSTACK_TRACE_PATH="/proc/sys/kernel/stack_tracer_enabled"
  41. EXC_PAGE_FAULT_ENABLE="$TRACING_PATH/events/exceptions/page_fault_kernel/enable"
  42. MM_PAGE_FAULT_ENABLE="$TRACING_PATH/events/kmem/mm_kernel_pagefault/enable"
  43. ftrace_userstacktrace_test()
  44. {
  45. if [ ! -e "$TSTACK_TRACE_PATH" ]; then
  46. tst_brkm TCONF "Stack Tracer is not cofigured in This kernel"
  47. fi
  48. for i in $(seq $LOOP); do
  49. echo 1 > $TSTACK_TRACE_PATH
  50. echo userstacktrace > $TRACING_PATH/trace_options
  51. grep -q "^userstacktrace" $TRACING_PATH/trace_options
  52. if [ $? -ne 0 ]; then
  53. tst_brkm TBROK "Failed to set userstacktrace"
  54. fi
  55. if [ -f "$EXC_PAGE_FAULT_ENABLE" ]; then
  56. exc_page_fault_enable=`cat $EXC_PAGE_FAULT_ENABLE`
  57. echo 1 > $EXC_PAGE_FAULT_ENABLE
  58. else
  59. mm_page_fault_enable=`cat $MM_PAGE_FAULT_ENABLE`
  60. echo 1 > $MM_PAGE_FAULT_ENABLE
  61. fi
  62. done
  63. if [ -f "$EXC_PAGE_FAULT_ENABLE" ]; then
  64. echo "$exc_page_fault_enable" > $EXC_PAGE_FAULT_ENABLE
  65. else
  66. echo "$mm_page_fault_enable" > $MM_PAGE_FAULT_ENABLE
  67. fi
  68. tst_resm TPASS "Finished running the test"
  69. }
  70. ftrace_userstacktrace_test
  71. tst_exit