From ba6498649eb65b3baeba6fdf2a9510503e96b841 Mon Sep 17 00:00:00 2001 From: Alan Jowett Date: Wed, 31 Jan 2024 12:22:49 -0800 Subject: [PATCH] Include PDBs for .sys Signed-off-by: Alan Jowett --- bpf/CMakeLists.txt | 11 +++++++++++ bpf/lpm.c | 4 ---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bpf/CMakeLists.txt b/bpf/CMakeLists.txt index 5c162c8..633d8af 100644 --- a/bpf/CMakeLists.txt +++ b/bpf/CMakeLists.txt @@ -134,8 +134,19 @@ function(convert_to_native file_name out_name option) COMMENT "Copying BPF object ${bpf_sys_file_path} to output directory" POST_BUILD) + # Copy the .pdb file to the output directory as part of post build + add_custom_command( + OUTPUT ${bpf_pdb_file_output_path} + COMMAND ${CMAKE_COMMAND} -E copy ${bpf_pdb_file_path} ${bpf_pdb_file_output_path} + DEPENDS ${bpf_pdb_file_path} + COMMENT "Copying BPF object ${bpf_pdb_file_path} to output directory" + POST_BUILD) + # Add a custom target that depends on the .sys file add_custom_target(${bpf_sys_file_name}_out ALL DEPENDS ${bpf_sys_file_output_path} SOURCES ${bpf_sys_file_path}) + + # Add a custom target that depends on the .pdb file + add_custom_target(${bpf_pdb_file_name}_out ALL DEPENDS ${bpf_pdb_file_output_path} SOURCES ${bpf_pdb_file_path}) endfunction() configure_file( diff --git a/bpf/lpm.c b/bpf/lpm.c index 0ec802e..5fd6801 100644 --- a/bpf/lpm.c +++ b/bpf/lpm.c @@ -130,8 +130,6 @@ SEC("sockops/update") int update(void* ctx) ipv4_route route_key = {32, 0}; if (!test_route) { - - bpf_printk("Failed to lookup route %d\n", key); return 1; } route_key = *test_route; @@ -149,8 +147,6 @@ SEC("sockops/replace") int replace(void* ctx) ipv4_route route_key = {32, 0}; if (!test_route) { - - bpf_printk("Failed to lookup route %d\n", key); return 1; } route_key = *test_route;