--- /dev/null
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: lttng-fuzzing-kprobe-test
+ description: "Run kprobe fuzzing test suite"
+install:
+ git-repos:
+ - url: https://github.com/lttng/lttng-ci
+ destination: ci
+ branch: master
+ steps:
+ - export TMPDIR="/tmp"
+ - cd
+ - ulimit -c unlimited
+ - mkdir -p coredump
+ - echo "$(pwd)/coredump/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern
+run:
+ steps:
+ - source /root/lttngvenv/activate
+ - cd ci/
+ - lava-test-case run-tests --shell "./scripts/lttng-baremetal-tests/kprobe-fuzzing.sh"
+ - tar czf coredump.tar.gz coredump
+ - lava-test-case-attach run-benchmarks coredump.tar.gz
--- /dev/null
+#!/bin/bash -xeu
+# Copyright (C) 2017 - Francis Deslauriers <francis.deslauriers@efficios.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+NB_KPROBE_PER_ITER=500
+SESSION_NAME="my_kprobe_session"
+
+# Silence the script to avoid redirection of kallsyms to fill the screen
+set +x
+syms=$(awk '{print $3;}' /proc/kallsyms | sort -R)
+nb_syms=$(echo "$syms" | wc -l)
+set -x
+
+# Loop over the list of symbols and enable the symbols in groups of
+# $NB_KPROBE_PER_ITER
+for i in $(seq 0 "$NB_KPROBE_PER_ITER" "$nb_syms"); do
+ # Pick $NB_KPROBE_PER_ITER symbols to instrument, craft enable-event
+ # command and save them to a file. We craft the commands and executed
+ # them in two steps so that the pipeline can be done without the bash
+ # '-x' option that would fill the serial buffer because of the multiple
+ # pipe redirections.
+ set +x
+ echo "$syms" | head -n $((i+NB_KPROBE_PER_ITER)) | tail -n $NB_KPROBE_PER_ITER |awk '{print "lttng enable-event --kernel --function=" $1 " " $1}' > lttng-enable-event.sh
+ set -x
+
+ # Print what iteration we are at
+ echo "$i" $((i+NB_KPROBE_PER_ITER))
+
+ # Destroy previous session and create a new one
+ lttng create "$SESSION_NAME"
+
+ # Expect commands to fail, turn off early exit of shell script on
+ # non-zero return value
+ set +e
+ source ./lttng-enable-event.sh
+ set -e
+
+ # Run stress util to generate some kernel activity
+ stress --cpu 2 --io 4 --vm 2 --vm-bytes 128M --hdd 3 --timeout 5s
+
+ lttng list "$SESSION_NAME"
+ lttng destroy "$SESSION_NAME"
+done
packages=['bsdtar', 'psmisc', 'wget', 'python3', 'python3-pip', \
'libglib2.0-dev', 'libffi-dev', 'elfutils', 'libdw-dev', \
'libelf-dev', 'libmount-dev', 'libxml2', 'libpfm4-dev', \
- 'libnuma-dev', 'python3-dev', 'swig']
+ 'libnuma-dev', 'python3-dev', 'swig', 'stress']
command = OrderedDict({
'command': 'lava_command_run',
'parameters': {
'git-repo': 'https://github.com/lttng/lttng-ci.git',
'revision': 'master',
'testdef': 'lava/baremetal-tests/destructive-tests.yml'
+ },
+ {
+ 'git-repo': 'https://github.com/lttng/lttng-ci.git',
+ 'revision': 'master',
+ 'testdef': 'lava/baremetal-tests/kprobe-fuzzing-tests.yml'
}
],
'timeout': 18000