support cgroup2
* only shim v2 runc v2 ("io.containerd.runc.v2") is supported
* only PID metrics is implemented. Others should be implemented in separate PRs.
* lots of code duplication in v1 metrics and v2 metrics. Dedupe should be separate PR.
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
			
			
This commit is contained in:
		
							
								
								
									
										24
									
								
								vendor/github.com/cilium/ebpf/internal/endian.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/cilium/ebpf/internal/endian.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | ||||
| package internal | ||||
|  | ||||
| import ( | ||||
| 	"encoding/binary" | ||||
| 	"unsafe" | ||||
| ) | ||||
|  | ||||
| // NativeEndian is set to either binary.BigEndian or binary.LittleEndian, | ||||
| // depending on the host's endianness. | ||||
| var NativeEndian binary.ByteOrder | ||||
|  | ||||
| func init() { | ||||
| 	if isBigEndian() { | ||||
| 		NativeEndian = binary.BigEndian | ||||
| 	} else { | ||||
| 		NativeEndian = binary.LittleEndian | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func isBigEndian() (ret bool) { | ||||
| 	i := int(0x1) | ||||
| 	bs := (*[int(unsafe.Sizeof(i))]byte)(unsafe.Pointer(&i)) | ||||
| 	return bs[0] == 0 | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Akihiro Suda
					Akihiro Suda