From e04a90e5811692b67b589e1e4ddb75e1c15eec53 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Tue, 19 Aug 2025 14:51:55 +0300 Subject: [PATCH] cmd/oci-runtime-tool: new flags for linux.intelRdt Introduce --linux-intelRdt-schema and --linux-intelRdt-enableMonitoring flags for the oci-runtime-tool generate. Signed-off-by: Markus Lehtonen --- cmd/oci-runtime-tool/generate.go | 8 ++++++++ man/oci-runtime-tool-generate.1.md | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/cmd/oci-runtime-tool/generate.go b/cmd/oci-runtime-tool/generate.go index 0936da76..bd537cf1 100644 --- a/cmd/oci-runtime-tool/generate.go +++ b/cmd/oci-runtime-tool/generate.go @@ -55,6 +55,8 @@ var generateFlags = []cli.Flag{ cli.StringSliceFlag{Name: "linux-hugepage-limits-add", Usage: "add hugepage resource limits"}, cli.StringSliceFlag{Name: "linux-hugepage-limits-drop", Usage: "drop hugepage resource limits"}, cli.StringFlag{Name: "linux-intelRdt-closid", Usage: "RDT Class of Service, i.e. group under the resctrl pseudo-filesystem which to associate the container with"}, + cli.BoolFlag{Name: "linux-intelRdt-enableMonitoring", Usage: "Enable resctrl monitoring for the container"}, + cli.StringSliceFlag{Name: "linux-intelRdt-schema", Usage: "Specifies the resctrl schema. May be specified multiple times to set multiple schemata."}, cli.StringFlag{Name: "linux-intelRdt-l3CacheSchema", Usage: "specifies the schema for L3 cache id and capacity bitmask"}, cli.StringSliceFlag{Name: "linux-masked-paths", Usage: "specifies paths can not be read inside container"}, cli.Uint64Flag{Name: "linux-mem-kernel-limit", Usage: "kernel memory limit (in bytes)"}, @@ -749,6 +751,12 @@ func setupSpec(g *generate.Generator, context *cli.Context) error { if context.IsSet("linux-intelRdt-closid") { g.SetLinuxIntelRdtClosID(context.String("linux-intelRdt-closid")) } + if context.IsSet("linux-intelRdt-enableMonitoring") { + g.SetLinuxIntelRdtEnableMonitoring(context.Bool("linux-intelRdt-enableMonitoring")) + } + if context.IsSet("linux-intelRdt-schema") { + g.SetLinuxIntelRdtSchemata(context.StringSlice("linux-intelRdt-schema")) + } if context.IsSet("linux-intelRdt-l3CacheSchema") { g.SetLinuxIntelRdtL3CacheSchema(context.String("linux-intelRdt-l3CacheSchema")) diff --git a/man/oci-runtime-tool-generate.1.md b/man/oci-runtime-tool-generate.1.md index 56663679..c1620f05 100644 --- a/man/oci-runtime-tool-generate.1.md +++ b/man/oci-runtime-tool-generate.1.md @@ -201,6 +201,13 @@ read the configuration from `config.json`. RDT Class of Service, i.e. group under the resctrl pseudo-filesystem, which to associate the container with. +**--linux-intelRdt-enableMonitoring**="" + Enable resctrl monitoring for the container. + +**--linux-intelRdt-schema**=[] + Specifies one resctrl schema. May be specified multiple times to configure the complete schemata. + e.g. --linux-intelRdt-schemata="MB:0=80" --linux-intelRdt-schemata="L3:0=ff" + **--linux-intelRdt-l3CacheSchema**="" Specifies the schema for L3 cache id and capacity bitmask.