generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scope(daemon) implement listing processes
The list is generated via the procfs crate. The following information is being transmitted via grpc: pid, ppid, comm, state, cmdline Signed-off-by: Mr-Kanister <[email protected]>
- Loading branch information
1 parent
a585dfc
commit 74b695e
Showing
10 changed files
with
269 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2024 Robin Seidl <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 The AMOS Projects | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
@@ -47,4 +48,4 @@ target | |
sbom.json | ||
|
||
.codebuddy/ | ||
|
||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2024 Benedikt Zinn <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Felix Hilgers <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Luca Bretting <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Robin Seidl <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
@@ -13,3 +14,5 @@ target/ | |
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
ziofa.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2024 Benedikt Zinn <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Felix Hilgers <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Luca Bretting <[email protected]> | ||
# SPDX-FileCopyrightText: 2024 Robin Seidl <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
|
@@ -46,6 +47,7 @@ backend-daemon = { path = "./backend/daemon" } | |
backend-ebpf = { path = "./backend/ebpf" } | ||
tracing = { version = "0.1.40" } | ||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } | ||
procfs = "0.17.0" | ||
|
||
[profile.dev] | ||
panic = "abort" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// SPDX-FileCopyrightText: 2024 Benedikt Zinn <[email protected]> | ||
// SPDX-FileCopyrightText: 2024 Robin Seidl <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
|
@@ -39,5 +40,19 @@ async fn main() { | |
println!("Error trying to set configuration"); | ||
println!("{:?}", e); | ||
} | ||
}; | ||
|
||
let processes = client.list_processes(()).await.and_then(|op| { | ||
Ok(op.into_inner()) | ||
}); | ||
match processes { | ||
Err(e) => println!("Error getting the process list: {:?}", e), | ||
Ok(pl) => { | ||
println!("Processes:"); | ||
println!("pid | ppid | comm | state | cmdline"); | ||
for p in pl.processes { | ||
println!("{} | {} | {} | {} | {}", p.pid, p.ppid, p.comm, p.state, p.cmdline) | ||
} | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// SPDX-FileCopyrightText: 2024 Benedikt Zinn <[email protected]> | ||
// SPDX-FileCopyrightText: 2024 Robin Seidl <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
|
@@ -10,6 +11,7 @@ pub mod counter; | |
mod ebpf_utils; | ||
mod helpers; | ||
mod server; | ||
mod procfs_utils; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
|
Oops, something went wrong.