2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2019-2021 Mikhail Morfikov
|
2020-09-12 17:19:23 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
|
|
# License published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/cpupower
|
|
|
|
profile cpupower @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Needed to read the /dev/cpu/[0-9]*/msr device, and hence remove the following error:
|
|
|
|
# Could not read perf-bias value[-1]
|
|
|
|
capability sys_rawio,
|
|
|
|
|
|
|
|
# Needed to operate on CPU IDLE states
|
|
|
|
capability sys_admin,
|
|
|
|
|
|
|
|
@{exec_path} mr,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
|
|
|
/{usr/,}bin/kmod rCx -> kmod,
|
|
|
|
/{usr/,}bin/man rPx,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{sys}/devices/system/cpu/{cpufreq,cpuidle}/ r,
|
|
|
|
@{sys}/devices/system/cpu/{cpufreq,cpuidle}/** r,
|
|
|
|
@{sys}/devices/system/cpu/cpu[0-9]*/{cpufreq,cpuidle}/ r,
|
|
|
|
@{sys}/devices/system/cpu/cpu[0-9]*/{cpufreq,cpuidle}/** r,
|
|
|
|
|
|
|
|
@{sys}/devices/system/cpu/cpufreq/policy[0-9]*/scaling_{min,max}_freq rw,
|
|
|
|
@{sys}/devices/system/cpu/cpufreq/policy[0-9]*/scaling_governor rw,
|
|
|
|
@{sys}/devices/system/cpu/cpufreq/policy[0-9]*/scaling_setspeed rw,
|
|
|
|
@{sys}/devices/system/cpu/cpu[0-9]*/cpuidle/state[0-9]/disable rw,
|
|
|
|
|
|
|
|
@{sys}/devices/system/cpu/cpu[0-9]*/topology/{physical_package_id,core_id} r,
|
|
|
|
|
|
|
|
@{sys}/devices/system/cpu/cpu[0-9]*/online r,
|
|
|
|
|
|
|
|
/dev/cpu/[0-9]*/msr r,
|
|
|
|
|
|
|
|
|
|
|
|
profile kmod {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/kmod mr,
|
|
|
|
|
|
|
|
@{PROC}/cmdline r,
|
|
|
|
#@{PROC}/modules r,
|
|
|
|
|
|
|
|
/etc/modprobe.d/ r,
|
|
|
|
/etc/modprobe.d/*.conf r,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/cpupower>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|