Skip to content

Commit 9ac5d2f

Browse files
committed
fixup! userspace-probe: Implements ELF support tests
1 parent db52da0 commit 9ac5d2f

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ health_check
116116
/tests/perf/test_perf_raw
117117
/tests/unit/test_string_utils
118118
/tests/utils/testapp/gen-ust-nevents-str/gen-ust-nevents-str
119+
/tests/utils/testapp/userspace-probe-elf-binary/userspace-probe-elf-binary
119120

120121
# man pages
121122
/doc/man/*.1

tests/regression/kernel/test_userspace_probe

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TEST_DESC="Userspace probe - Testing userspace probe on ELF symbol"
2121
CURDIR=$(dirname "$0")/
2222
TESTDIR=$CURDIR/../..
2323
TEST_BIN_DIR="$TESTDIR/utils/testapp/userspace-probe-elf-binary/"
24-
TEST_BIN="$TEST_BIN_DIR/test-binary"
24+
TEST_BIN="$TEST_BIN_DIR/userspace-probe-elf-binary"
2525
SESSION_NAME=userspace_probe_test_session
2626
PROBE_EVENT_NAME=userspace_probe_test_event
2727
NUM_TESTS=39
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# no optimization
22
AM_CPPFLAGS = -O0
3-
noinst_PROGRAMS = test-binary
4-
test_binary_SOURCES = test-binary.c
3+
noinst_PROGRAMS = userspace-probe-elf-binary
4+
test_binary_SOURCES = userspace-probe-elf-binary.c

tests/utils/testapp/userspace-probe-elf-binary/test-binary.c

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (C) 2017 Francis Deslauriers <[email protected]>
3+
*
4+
* This library is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This library is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with this library; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
volatile int not_a_function = 0;
20+
void __attribute__ ((noinline)) test_function()
21+
{
22+
not_a_function+=1;
23+
}
24+
int main(int argc, char *argv[])
25+
{
26+
test_function();
27+
return 0;
28+
}

0 commit comments

Comments
 (0)