Skip to content

Commit

Permalink
selftests: new x86 breakpoints selftest
Browse files Browse the repository at this point in the history
Bring a first selftest in the relevant directory.  This tests several
combinations of breakpoints and watchpoints in x86, as well as icebp traps
and int3 traps.  Given the amount of breakpoint regressions we raised
after we merged the generic breakpoint infrastructure, such selftest
became necessary and can still serve today as a basis for new patches that
touch the do_debug() path.

Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Jason Wessel <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
fweisbec authored and torvalds committed Jan 13, 2012
1 parent 274343a commit 85bbddc
Show file tree
Hide file tree
Showing 4 changed files with 416 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/testing/selftests/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TARGETS =
TARGETS = breakpoints

all:
for TARGET in $(TARGETS); do \
Expand Down
20 changes: 20 additions & 0 deletions tools/testing/selftests/breakpoints/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Taken from perf makefile
uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
ifeq ($(ARCH),i386)
ARCH := x86
endif
ifeq ($(ARCH),x86_64)
ARCH := x86
endif


all:
ifeq ($(ARCH),x86)
gcc breakpoint_test.c -o run_test
else
echo "Not an x86 target, can't build breakpoints selftests"
endif

clean:
rm -fr run_test
Loading

0 comments on commit 85bbddc

Please sign in to comment.