Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3aacb3f
chore: +loop3.json
Tilnel Mar 12, 2026
96d6c60
Add Raft consensus testing with snapshot support and state management…
Tilnel Mar 12, 2026
dcc942b
feat: major hash, memory, and observability improvements
Tilnel Mar 14, 2026
cbe665d
feat: ncurses TUI for interactive debugging
Tilnel Mar 14, 2026
bc83473
fix: Raft dual-leader bug and message parsing
Tilnel Mar 15, 2026
b06e151
refactor: Modernize JSON config parsing and build system
Tilnel Mar 16, 2026
659eb65
feat: Implement process status tracking and crash handling
Tilnel Mar 17, 2026
7001782
refactor: split continue command into multiple search strategies
Tilnel Mar 17, 2026
4a9fd1f
feat: complete random search implementation and raft snapshot fix
Tilnel Mar 17, 2026
394185f
fix: missing ui.cpp & ui.h
Tilnel Mar 17, 2026
e758696
feat: file_lock to avoid two instances in same CWD
Mar 17, 2026
a09f429
feat: more check for raft, add tools to analyze network interaction
Tilnel Mar 18, 2026
97e1371
chore: ready for redisraft
Tilnel Mar 19, 2026
0114fda
fix(dwarf): forward declaration of struct overrides struct definition
Tilnel Mar 20, 2026
e9abb94
fix: redisraft checking
Tilnel Mar 20, 2026
fbc6145
chore: change redisraft submodule url
Tilnel Mar 20, 2026
9549bc7
feat: use packed storage for tracee_state
Tilnel Mar 21, 2026
793691c
perf: optimize expr, tracee_state save and load
Tilnel Mar 22, 2026
fdd3f2f
feat: complete state canonication. also fix state store
Tilnel Mar 22, 2026
8069802
fix: sigsegv after L2 used up
Tilnel Mar 24, 2026
43d5625
refactor: state store
Tilnel Mar 24, 2026
9e5acfc
Add comprehensive TCP socket, epoll, pipe, and mmap support for Redis
Tilnel Mar 24, 2026
042eb78
perf: optimize expreval to extreme
Tilnel Mar 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
!*.md
!*.rst
!*.sh
!*.txt
!*.py
!LICENSE

Expand All @@ -30,6 +29,12 @@
!src/subsys/*
!src/utils/
!src/utils/*
!src/ui/
!src/ui/*

# Perf benchmarks
!perf/
!perf/*

# Third party
!third_party/
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
[submodule "third_party/cereal"]
path = third_party/cereal
url = https://github.com/USCiLab/cereal.git
[submodule "examples/redisraft/raft"]
path = examples/redisraft/raft
url = https://github.com/Tilnel/redisraft
[submodule "examples/redis/redis"]
path = examples/redis/redis
url = https://github.com/Tilnel/redis
135 changes: 116 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
.PHONY: all debug release wc clean clear
.PHONY: all debug release wc clean clear benchmark

CC = gcc
CC = ccache gcc
CXX = ccache g++
LD = g++ -L/usr/local/lib
LD = ccache g++ -L/usr/local/lib

# Build directory
BUILD_DIR = build

# Include paths
INCLUDES = -I. -Isrc -Isrc/core -Isrc/subsys -Isrc/utils -Ithird_party
INCLUDES = -I. -Isrc -Isrc/core -Isrc/subsys -Isrc/utils -Isrc/ui -Ithird_party -Iexamples/redisraft/plugins

CXXFLAGS ?= $(INCLUDES) -MMD -MP -std=gnu++2a -fno-stack-protector -O3 -g -msse4.2
LDFLAGS = -g -ldwarf -lreadline -lcjson -ldw -lzstd -rdynamic \
-lunwind-ptrace -lunwind-x86_64 -lunwind -lelf -lfmt
CXXFLAGS ?= $(INCLUDES) -MMD -MP -std=gnu++2a -fno-stack-protector -O3 -g -msse4.2 -D_FORTIFY_SOURCE=0 -fno-omit-frame-pointer \
-mavx2 -mbmi -mbmi2
LDFLAGS = -g -ldwarf -lreadline -ldw -lzstd -lxxhash -rdynamic \
-lunwind-ptrace -lunwind-x86_64 -lunwind -lelf -lfmt \
-lncurses -lpthread -fno-omit-frame-pointer

# Source files with new directory structure
SRCS = src/main.cpp \
src/core/scheduler.cpp src/core/guest.cpp src/core/monitor.cpp src/core/state.cpp src/core/config.cpp src/core/syscall_fmt.cpp src/core/dwarf.cpp src/core/state_store.cpp \
SRCS = src/main.cpp\
src/core/scheduler.cpp src/core/guest.cpp src/core/monitor.cpp src/core/state.cpp src/core/config.cpp src/core/syscall_fmt.cpp \
src/core/dwarf.cpp src/core/state_store.cpp src/core/state_store_packed.cpp src/core/sysstate_store.cpp \
src/subsys/serialize.cpp src/subsys/sockstate.cpp src/subsys/fsstate.cpp src/subsys/emu.cpp src/subsys/fd_manager.cpp \
src/utils/utils.cpp src/utils/expr.cpp src/utils/expr_ast.cpp \
src/utils/expr_lexer.cpp src/utils/expr_parser.cpp \
src/utils/resolve.cpp src/utils/crc32.cpp
src/utils/resolve.cpp src/utils/crc32.cpp src/utils/file_lock.cpp \
examples/redisraft/plugins/raft_msg_parser.cpp \
src/ui/ncurses_ui.cpp src/ui/log_wrapper.cpp src/core/state_transition.cpp

OBJS = $(SRCS:.cpp=.o)
DEPS = $(SRCS:.cpp=.d)
# Object files in build directory
OBJS = $(patsubst %.cpp,$(BUILD_DIR)/%.o,$(SRCS))
DEPS = $(patsubst %.cpp,$(BUILD_DIR)/%.d,$(SRCS))

# Lex/Yacc generated files
LEX_SRC = src/utils/expr_lexer.cpp
Expand All @@ -29,36 +38,43 @@ YACC_HDR = src/utils/expr_parser.hpp

all: release

release: CXXFLAGS = $(INCLUDES) -MMD -MP -std=gnu++2a -fno-stack-protector -O3 -msse4.2
release: CXXFLAGS = $(INCLUDES) -MMD -MP -std=gnu++2a -fno-stack-protector -O3 -msse4.2 -mavx2 -mbmi -mbmi2
release: tracer

debug: CXXFLAGS = $(INCLUDES) -MMD -MP -std=gnu++2a -fno-stack-protector -O0 -g -msse4.2 -DNOCOMPRESS
debug: CXXFLAGS = $(INCLUDES) -MMD -MP -std=gnu++2a -fno-stack-protector -O3 -g -msse4.2 -mavx2 -mbmi -mbmi2
debug: LDFLAGS +=
debug: tracer

tracer: $(OBJS) nr2call.o
tracer: $(OBJS) $(BUILD_DIR)/nr2call.o
$(LD) $^ $(LDFLAGS) -o tracer
-mkdir memory sstate

nr2call.o: nr2call.c
gcc -c $< -O3 -g
$(BUILD_DIR)/nr2call.o: nr2call.c | $(BUILD_DIR)
gcc -c $< -O3 -g -o $@

$(LEX_SRC): src/utils/expr_lexer.l $(YACC_HDR)
flex -o $@ $<

$(YACC_SRC) $(YACC_HDR): src/utils/expr_parser.y
bison -d -o $(YACC_SRC) $<

%.o: %.cpp
# Compile C++ files to build directory
$(BUILD_DIR)/%.o: %.cpp | $(BUILD_DIR)
@if [ -z "$(NP)" ]; then \
echo "NP not set"; exit 1; \
fi
@mkdir -p $(dir $@)
@echo "Compiling $<"
@start=$$(date +%s.%N); \
$(CXX) $< $(CXXFLAGS) -c -o $@ -DNP=$(NP); \
end=$$(date +%s.%N); \
dur=$$(echo "$$end - $$start" | bc); \
echo "Compiled $< in $$dur seconds"

# Create build directory
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)/src/core $(BUILD_DIR)/src/subsys $(BUILD_DIR)/src/utils $(BUILD_DIR)/src/ui $(BUILD_DIR)/examples/redisraft/plugins

-include $(DEPS)

wc:
Expand All @@ -69,5 +85,86 @@ clear:
-mkdir memory sstate

clean:
-/bin/rm -f $(OBJS) $(DEPS) nr2call.o tracer *.so
-/bin/rm -rf $(BUILD_DIR) tracer *.so
-/bin/rm -f $(LEX_SRC) $(YACC_SRC) $(YACC_HDR) src/utils/expr_parser.output

# --- Benchmark Targets ---
# Exclude the main tracer entry point from the object list for linking the benchmark
TRACER_OBJS_NO_MAIN = $(filter-out $(BUILD_DIR)/src/main.o, $(OBJS))

# StateStore benchmark
BENCH1_SRC = perf/state_store_benchmark.cpp
BENCH1_OBJ = $(BUILD_DIR)/perf/state_store_benchmark.o
BENCH1_EXE = ss_bench

# SysStateStore benchmark
BENCH2_SRC = perf/sysstate_store_benchmark.cpp
BENCH2_OBJ = $(BUILD_DIR)/perf/sysstate_store_benchmark.o
BENCH2_EXE = sys_bench

# XXHash benchmark
BENCH3_SRC = perf/xxhash_benchmark.cpp
BENCH3_OBJ = $(BUILD_DIR)/perf/xxhash_benchmark.o
BENCH3_EXE = xxh_bench

benchmark: $(BENCH1_EXE) $(BENCH2_EXE) $(BENCH3_EXE)

$(BENCH1_EXE): $(BENCH1_OBJ) $(TRACER_OBJS_NO_MAIN) $(BUILD_DIR)/nr2call.o
@echo "==> Linking Benchmark: $(BENCH1_EXE)"
$(LD) $^ $(LDFLAGS) -o $@

$(BENCH2_EXE): $(BENCH2_OBJ) $(TRACER_OBJS_NO_MAIN) $(BUILD_DIR)/nr2call.o
@echo "==> Linking Benchmark: $(BENCH2_EXE)"
$(LD) $^ $(LDFLAGS) -o $@

$(BENCH3_EXE): $(BENCH3_OBJ) $(BUILD_DIR)/nr2call.o
@echo "==> Linking Benchmark: $(BENCH3_EXE)"
$(CXX) $^ -O3 -o $@

# Compile benchmark files to build directory
$(BUILD_DIR)/perf/%.o: perf/%.cpp | $(BUILD_DIR)
@if [ -z "$(NP)" ]; then \
echo "NP not set"; exit 1; \
fi
@mkdir -p $(dir $@)
@echo "Compiling benchmark $<"
@start=$$(date +%s.%N); \
$(CXX) $< $(CXXFLAGS) -c -o $@ -DNP=$(NP); \
end=$$(date +%s.%N); \
dur=$$(echo "$$end - $$start" | bc); \
echo "Compiled $< in $$dur seconds"

# --- Tool Targets ---
TOOLS_DIR = tools

# Tool executables
SSTATE_QUERY_SRC = $(TOOLS_DIR)/sstate_query.cpp
SSTATE_QUERY_OBJ = $(BUILD_DIR)/$(TOOLS_DIR)/sstate_query.o
SSTATE_QUERY_EXE = $(TOOLS_DIR)/sstate_query

VERIFY_SSTATE_SRC = $(TOOLS_DIR)/verify_sstate.cpp
VERIFY_SSTATE_OBJ = $(BUILD_DIR)/$(TOOLS_DIR)/verify_sstate.o
VERIFY_SSTATE_EXE = $(TOOLS_DIR)/verify_sstate

# Tool dependencies - need UI objects too
TOOL_DEPS = $(TRACER_OBJS_NO_MAIN) $(BUILD_DIR)/nr2call.o \
$(BUILD_DIR)/src/ui/ncurses_ui.o $(BUILD_DIR)/src/ui/log_wrapper.o

tools: $(SSTATE_QUERY_EXE) $(VERIFY_SSTATE_EXE)

$(SSTATE_QUERY_EXE): $(SSTATE_QUERY_OBJ) $(TOOL_DEPS)
@echo "==> Linking Tool: $(SSTATE_QUERY_EXE)"
$(LD) $^ $(LDFLAGS) -o $@

$(VERIFY_SSTATE_EXE): $(VERIFY_SSTATE_OBJ) $(TOOL_DEPS)
@echo "==> Linking Tool: $(VERIFY_SSTATE_EXE)"
$(LD) $^ $(LDFLAGS) -o $@

# Compile tool files to build directory
$(BUILD_DIR)/$(TOOLS_DIR)/%.o: $(TOOLS_DIR)/%.cpp | $(BUILD_DIR)
@if [ -z "$(NP)" ]; then \
echo "NP not set"; exit 1; \
fi
@mkdir -p $(dir $@)
@echo "Compiling tool $<"
$(CXX) $< $(CXXFLAGS) -c -o $@ -DNP=$(NP)
Loading