File: relocs_enum.c

package info (click to toggle)
golang-github-cilium-ebpf 0.17.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,684 kB
  • sloc: ansic: 1,259; makefile: 127; python: 113; awk: 29; sh: 24
file content (16 lines) | stat: -rw-r--r-- 450 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "bpf_core_read.h"

enum cgroup_subsys_id {
	cpuset_cgrp_id,
	cpuset_cgrp_id_lublub,
	CGROUP_SUBSYS_COUNT,
};

#define __section(NAME) __attribute__((section(NAME), used))

__section("socket/core_ld64imm") int core_ld64imm() {
	if (bpf_core_enum_value_exists(enum cgroup_subsys_id, cpuset_cgrp_id_lublub)) {
		__attribute__((unused)) const volatile int val = bpf_core_enum_value(enum cgroup_subsys_id, cpuset_cgrp_id_lublub);
	}
	return 0;
}