Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cache available cgroup names

  • Loading branch information...
commit 1c3021f81f68751b42d5dc6697f46f35142bffa1 1 parent e2d8e88
Daniel Poelzleithner authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/core.lua
8 src/core.lua
View
@@ -187,7 +187,8 @@ function ulatency.tree_loaded(name)
return __CGROUP_LOADED[name]
end
-
+--! @brief returns boolean if name is available
+--! @param name name of subsystem to test
function ulatency.has_cgroup_subsystem(name)
if not __CGROUP_HAS then
ulatency.get_cgroup_subsystems()
@@ -195,8 +196,11 @@ function ulatency.has_cgroup_subsystem(name)
return (__CGROUP_HAS[name] == true)
end
-
+--!@brief returns a table of available cgroup subsystems
function ulatency.get_cgroup_subsystems()
+ if __CGROUP_AVAIL then
+ return __CGROUP_AVAIL
+ end
__CGROUP_AVAIL = {}
__CGROUP_HAS = {}
for line in io.lines("/proc/cgroups") do
Please sign in to comment.
Something went wrong with that request. Please try again.