tetragon
1// SPDX-License-Identifier: Apache-2.0
2// Copyright Authors of Tetragon
3
4package sensors
5
6import (
7"strings"
8)
9
10// PathJoin creates a path meant for sensor filenames in /sys/fs/bpf.
11//
12// At some point, we would like to have a file hierarchy under /sys/fs/bpf for each sensor.
13// see: https://github.com/cilium/tetragon/issues/408
14//
15// Unfortunately, this requires changes, for properly creating and deleting
16// these directories requires. As an intermediate step, we use this function
17// that uses dashes instead of / to create unique files in flat hierarchy,
18// without needeing to manage directories.
19func PathJoin(elem ...string) string {
20return strings.Join(elem, "-")
21}
22