WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 7e6e9ce

Browse files
committed
fix compilation
1 parent d03b6dc commit 7e6e9ce

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ project(CXL-MEM-Simulator VERSION 0.1.0)
44
find_package(cxxopts REQUIRED)
55
find_package(fmt REQUIRED)
66
find_package(range-v3 REQUIRED)
7-
find_package(Clang REQUIRED)
87
file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
9-
message(${CLANG_INCLUDE_DIRS})
8+
109
execute_process(COMMAND uname -r OUTPUT_VARIABLE arch OUTPUT_STRIP_TRAILING_WHITESPACE)
1110
set(LINUX_SOURCE /lib/modules/${arch}/build/)
1211
set(CMAKE_CXX_FLAGS "-Wall -g -pthread -lrt -rdynamic")
@@ -19,8 +18,8 @@ target_link_libraries(CXL-MEM-Simulator cxxopts::cxxopts fmt::fmt range-v3::rang
1918

2019
function(bpf prefix)
2120
add_custom_target(${prefix}_bpf ALL
22-
COMMAND ${CLANG_INCLUDE_DIRS}/../bin/clang -S -nostdinc -I${LINUX_SOURCE}/arch/x86/include -I${LINUX_SOURCE}/arch/x86/include/uapi -I${LINUX_SOURCE}/arch/x86/include/generated -I${LINUX_SOURCE}/arch/x86/include/generated/uapi -I${LINUX_SOURCE}/include -I${LINUX_SOURCE}/include/uapi -I${LINUX_SOURCE}/include/generated/uapi -I${LINUX_SOURCE}/tools/testing/selftests/bpf -include ${LINUX_SOURCE}/include/linux/kconfig.h -Werror -D__KERNEL__ -D__ASM_SYSREG_H -D__BPF_TRACING__ -D__TARGET_ARCH_x86 -Wno-unused-value -Wno-pointer-sign -Wno-compare-distinct-pointer-types -Wno-gnu-variable-sized-type-not-at-end -Wno-tautological-compare -Wno-unknown-warning-option -Wno-address-of-packed-member -O2 -g -emit-llvm -c ${CMAKE_SOURCE_DIR}/src/${prefix}.c -o ${CMAKE_BINARY_DIR}/${prefix}.ll
23-
COMMAND ${CLANG_INCLUDE_DIRS}/../bin/llc -march=bpf -filetype=obj -o ${CMAKE_BINARY_DIR}/${prefix}.o ${CMAKE_BINARY_DIR}/${prefix}.ll
21+
COMMAND clang --target=bpf -nostdinc -S -I/usr/include/linux -I${CMAKE_SOURCE_DIR}/include -I${LINUX_SOURCE}/arch/x86/include -I/usr/include -I${LINUX_SOURCE}/arch/x86/include/uapi -I${LINUX_SOURCE}/arch/x86/include/generated -I${LINUX_SOURCE}/arch/x86/include/generated/uapi -I${LINUX_SOURCE}/include -I${LINUX_SOURCE}/include/uapi -I${LINUX_SOURCE}/include/generated/uapi -I${LINUX_SOURCE}/tools/testing/selftests/bpf -include ${LINUX_SOURCE}/include/linux/kconfig.h -D__KERNEL__ -D__ASM_SYSREG_H -D__BPF_TRACING__ -D__TARGET_ARCH_x86 -Wno-implicit-function-declaration -O3 -emit-llvm -g -c ${CMAKE_SOURCE_DIR}/src/${prefix}.c -o ${CMAKE_BINARY_DIR}/${prefix}.ll
22+
COMMAND llc -march=bpf -filetype=obj -o ${CMAKE_BINARY_DIR}/${prefix}.o ${CMAKE_BINARY_DIR}/${prefix}.ll
2423
)
2524
add_dependencies(CXL-MEM-Simulator ${prefix}_bpf)
2625
endfunction()

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $ sudo apt install llvm-dev clang libbpf-dev libclang-dev libcxxopts-dev libfmt-
99
```
1010
## User input
1111
```bash
12-
./CXL-MEM-Simulator -t ./microbench/many_calloc -i 5 -c 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
12+
LOGV=1 ./CXL-MEM-Simulator -t ./microbench/many_calloc -i 5 -c 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
1313
```
1414
1. -t Target: The path to the executable
1515
2. -i Interval: The epoch of the simulator, the parameter is in milisecond
@@ -29,5 +29,17 @@ $ sudo apt install llvm-dev clang libbpf-dev libclang-dev libcxxopts-dev libfmt-
2929
\
3030
3
3131
```
32+
9. env LOGV stands for logs level that you can see.
3233
## Limitation
33-
The pebs requires no larger than 5 `perf_open_event` attached to certain PID, so I limit the bpf program to munmap(kprobe) and sbrk(kprobe/kretprobe), you can configure them. For multiple process application, I need to first SIGSTOP the process and `send/recv` back the PID information. For client and server application, I need to SIGSTOP/SIGCONT on both client and server simultaneously, which is not implemented yet.
34+
The pebs requires no larger than 5 `perf_open_event` attached to certain PID, so I limit the bpf program to munmap(kprobe) and sbrk(kprobe/kretprobe), you can configure them. For multiple process application, I need to first SIGSTOP the process and `send/recv` back the PID information. For client and server application, I need to SIGSTOP/SIGCONT on both client and server simultaneously, which is not implemented yet.
35+
36+
## Cite
37+
```bash
38+
@article{yangyarch23,
39+
title={CXLMemSim: A pure software simulated CXL.mem for performance characterization},
40+
author={Yiwei Yang, Pooneh Safayenikoo, Jiacheng Ma, Tanvir Ahmed Khan, Andrew Quinn},
41+
journal={arXiv preprint arXiv:2303.06153},
42+
booktitle={The fifth Young Architect Workshop (YArch'23)},
43+
year={2023}
44+
}
45+
```

0 commit comments

Comments
 (0)