This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new f34364888 [cgroups2][ebpf] Addresses formatting inconsistences.
f34364888 is described below
commit f343648888d9b54fe74c6681b2464bc859148db3
Author: Devin Leamy <[email protected]>
AuthorDate: Tue Mar 12 14:18:55 2024 -0400
[cgroups2][ebpf] Addresses formatting inconsistences.
- Two free lines between functions.
- One free line between ending namespaces.
- One free line between methods.
- Ending namespace having format `} // namespace <name> {`.
This closes #514
---
src/linux/cgroups2.cpp | 1 +
src/linux/cgroups2.hpp | 7 ++++++-
src/linux/ebpf.hpp | 2 ++
src/tests/containerizer/cgroups2_tests.cpp | 2 ++
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/linux/cgroups2.cpp b/src/linux/cgroups2.cpp
index 0a71a296a..f37a9ba81 100644
--- a/src/linux/cgroups2.cpp
+++ b/src/linux/cgroups2.cpp
@@ -279,4 +279,5 @@ Try<Nothing> enable(const string& cgroup, const
vector<string>& controllers)
}
} // namespace controllers {
+
} // namespace cgroups2 {
diff --git a/src/linux/cgroups2.hpp b/src/linux/cgroups2.hpp
index df4272b25..91b605149 100644
--- a/src/linux/cgroups2.hpp
+++ b/src/linux/cgroups2.hpp
@@ -33,14 +33,17 @@ const std::string ROOT_CGROUP = "";
// Checks if cgroups2 is available on the system.
bool enabled();
+
// Mounts the cgroups2 file system at /sys/fs/cgroup. Errors if
// the cgroups v2 file system is already mounted.
Try<Nothing> mount();
+
// Checks if the cgroup2 file systems is mounted at /sys/fs/cgroup,
// returns an error if the mount is found at an unexpected location.
Try<bool> mounted();
+
// Unmounts the cgroups2 file system from /sys/fs/cgroup. Errors if
// the cgroup2 file system is not mounted at /sys/fs/cgroup. It's the
// responsibility of the caller to ensure all child cgroups have been
destroyed.
@@ -53,6 +56,7 @@ namespace controllers {
// on the host.
Try<std::set<std::string>> available(const std::string& cgroup);
+
// Enables the given controllers in the cgroup and disables all other
// controllers. Errors if a requested controller is not available.
Try<Nothing> enable(
@@ -60,6 +64,7 @@ Try<Nothing> enable(
const std::vector<std::string>& controllers);
} // namespace controllers {
-} // namespace cgroups2
+
+} // namespace cgroups2 {
#endif // __CGROUPS_V2_HPP__
diff --git a/src/linux/ebpf.hpp b/src/linux/ebpf.hpp
index 3e192f9fc..5bf9d34d4 100644
--- a/src/linux/ebpf.hpp
+++ b/src/linux/ebpf.hpp
@@ -52,9 +52,11 @@ namespace cgroups2 {
// Load and attach a BPF_CGROUP_DEVICE eBPF program to a cgroup.
Try<Nothing> attach(const std::string& cgroup, const Program& program);
+
// Detach a BPF_CGROUP_DEVICE eBPF program from a cgroup, by program id.
Try<Nothing> detach(const std::string& cgroup, uint32_t program_id);
+
// Get the program ids of all programs that have been attached to a cgroup.
Try<std::vector<uint32_t>> attached(const std::string& cgroup);
diff --git a/src/tests/containerizer/cgroups2_tests.cpp
b/src/tests/containerizer/cgroups2_tests.cpp
index ca696d5fd..4fbad6d93 100644
--- a/src/tests/containerizer/cgroups2_tests.cpp
+++ b/src/tests/containerizer/cgroups2_tests.cpp
@@ -60,6 +60,8 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AvailableSubsystems)
}
} // namespace tests {
+
} // namespace internal {
+
} // namespace mesos {