Skip to content

Commit

Permalink
Fix locking issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Officeyutong committed Nov 9, 2023
1 parent c7c303a commit 7a00458
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
14 changes: 6 additions & 8 deletions daemon/kernel/bpf_tracer.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,12 @@ static int process_bpf_syscall_exit(struct bpf_args_t *ap, int ret)
.kernel_id = id };
set_bpf_fd_data(ret, &data);
bpf_printk("bpftime: bpf_link_create");
if (submit_bpf_events) {
bpf_printk("bpftime: Submitting link creation");
struct event *event =
get_ringbuf_sys_exit_bpf_event(ap, ret);
if (!event)
return 0;
bpf_ringbuf_submit(event, 0);
}
bpf_printk("bpftime: Submitting link creation");
struct event *event =
get_ringbuf_sys_exit_bpf_event(ap, ret);
if (!event)
return 0;
bpf_ringbuf_submit(event, 0);
break;
}
case BPF_BTF_LOAD: {
Expand Down
2 changes: 1 addition & 1 deletion daemon/user/daemon_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct daemon_config {
// should bpftime be involve
bool is_driving_bpftime = true;
// should trace and submit bpf related detail events
bool submit_bpf_events = true;
bool submit_bpf_events = false;
// specify whether uprobe should work similar to kernel uprobe and auto
// attach to the target process
bool enable_auto_attach = false;
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/bpf_map/shared/hash_map_kernel_user.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class hash_map_kernel_user_impl {
void init_map_fd();

public:
const static bool should_lock = true;
const static bool should_lock = false;
hash_map_kernel_user_impl(managed_shared_memory &memory, int km_id);
~hash_map_kernel_user_impl();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class percpu_array_map_kernel_user_impl {
bytes_vec value_data;

public:
const static bool should_lock = true;
const static bool should_lock = false;
void *elem_lookup(const void *key);

long elem_update(const void *key, const void *value, uint64_t flags);
Expand Down
1 change: 1 addition & 0 deletions vm/llvm-jit/src/bpf_jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ extern "C" void __aeabi_unwind_cpp_pr1();

ebpf_jit_fn bpf_jit_context::compile()
{
spdlog::info("Compiling using LLJIT");
// Create a JIT builder
auto jit = ExitOnErr(LLJITBuilder().create());
auto &mainDylib = jit->getMainJITDylib();
Expand Down

0 comments on commit 7a00458

Please sign in to comment.