Skip to content

Commit

Permalink
edriver-rust: sync trans
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskaliX committed Feb 15, 2024
1 parent c238ac5 commit 6f197e2
Show file tree
Hide file tree
Showing 22 changed files with 4,438 additions and 6,225 deletions.
3 changes: 3 additions & 0 deletions plugins/edriver-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ anyhow = "1.0"
log = { version = "0.4", features = ["std"] }
libc = "0.2.0"
lru = "0.12.2"
users = "0.11.0"
governor = "0.6.0"
lazy_static = "1.4.0"
twox-hash = "1.6"
hex = "0.4"
libbpf-rs = {version = "0.22.1", features=["static"]}
libbpf-sys = { version = "1.2.1" }
sdk = { path = "../../SDK/rust" }
Expand Down
3 changes: 2 additions & 1 deletion plugins/edriver-rust/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
THE RUST VERSION IS NOT AVAILABLE
USE EDRIVER INSTEAD

PLEASE USE EDRIVER INSTEAD
215 changes: 0 additions & 215 deletions plugins/edriver-rust/src/bpf/Makefile

This file was deleted.

4 changes: 1 addition & 3 deletions plugins/edriver-rust/src/bpf/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,6 @@ static __always_inline struct file *fget_raw(struct task_struct *task, u64 fd_nu
return NULL;
struct file *file;
bpf_core_read(&file, sizeof(void *), &fd[fd_num]);
if (file == NULL)
return NULL;
return file;
}

Expand Down Expand Up @@ -242,8 +240,8 @@ static __always_inline void *get_path(struct path *path)
/* off check */
if (off > buf_off)
break;
sz = bpf_probe_read_str(&(cache->buf[off & MID_PERCPU_MASK]), (d_name.len + 1) & MID_PERCPU_MASK, (void *)d_name.name);
/* size check */
sz = bpf_probe_read_str(&(cache->buf[off & MID_PERCPU_MASK]), (d_name.len + 1) & MID_PERCPU_MASK, (void *)d_name.name);
if (!sz)
break;
cache->buf[(buf_off - 1) & MAX_PERCPU_MASK] = '/';
Expand Down
Loading

0 comments on commit 6f197e2

Please sign in to comment.