tools api fs: Prefer cgroup v1 path in cgroupfs_find_mountpoint()
authorNamhyung Kim <namhyung@kernel.org>
Wed, 16 Dec 2020 09:05:54 +0000 (18:05 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 17 Feb 2021 18:06:22 +0000 (15:06 -0300)
commit27ab1c1c06529056df498b9647c03167e682b4d9
treeb939ea44fe97e2831e58dfc6a7318277a4fa27c5
parent6833e0b81aed44c0510aaf2eb72722ba1cf7ddbe
tools api fs: Prefer cgroup v1 path in cgroupfs_find_mountpoint()

The cgroupfs_find_mountpoint() looks up the /proc/mounts file to find
a directory for the given cgroup subsystem.  It keeps both cgroup v1
and v2 path since there's a possibility of the mixed hierarchly.

But we can simply use v1 path if it's found as it will override the v2
hierarchy.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20201216090556.813996-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/api/fs/cgroup.c