Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack_Analyzer:Adapted to MagicEyes #720

Merged
merged 18 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ eBPF_Supermarket/CPU_Subsystem/eBPF_proc_image/proc_image

# Stack_Analyser
eBPF_Supermarket/Stack_Analyser/stack_analyzer
eBPF_Supermarket/Stack_Analyser/exporter/exporter
eBPF_Supermarket/Stack_Analyser/exporter/exporter
eBPF_Supermarket/Stack_Analyser/bpf_skel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
set(TOOL_NAME stack_analyzer)
set(TOOL_BELONG_TO_MODULE system_diagnosis)

file(GLOB STACK_ANALYZER_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc)
file(GLOB STACK_ANALYZER_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB STACK_ANALYZER_WAPPER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/bpf/*.cpp)
file(GLOB apps ${CMAKE_CURRENT_SOURCE_DIR}/bpf/*.bpf.c)

# 若不用Rust,则排除 profile.bpf.c
Expand All @@ -28,6 +29,7 @@ if (NOT EXISTS ${SRC_GEN_TARGET_DIR})
message(STATUS "directory create success")
endif ()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/ ${SRC_GEN_TARGET_DIR})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果不想include名字太长,也可以的,建议最起码带上你的工具名,这样对以后的集成工具使用者比较友好。就是你在代码里 #include “stack_analyzer/.skel.h”, 而不是直接的 #include “.skel.h” 。下次提交pr的时候再改就行

# 遍历文件夹内所有的bpf.c
foreach(app ${apps})
get_filename_component(app_stem ${app} NAME_WE)
Expand All @@ -36,7 +38,7 @@ foreach(app ${apps})
add_dependencies(${app_stem}_skel libbpf-build bpftool-build)
endforeach()

add_executable(${TOOL_NAME} ${STACK_ANALYZER_SOURCE_FILES})
add_executable(${TOOL_NAME} ${STACK_ANALYZER_WAPPER_FILES} ${STACK_ANALYZER_SOURCE_FILES})
foreach (app ${apps})
get_filename_component(app_stem ${app} NAME_WE)
target_link_libraries(${TOOL_NAME} ${app_stem}_skel -lstdc++)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading