(ctx context.Context, pid int32)
| 384 | } |
| 385 | |
| 386 | func getProcessNameWithContext(ctx context.Context, pid int32) (string, error) { |
| 387 | data, err := os.ReadFile(fmt.Sprintf("/proc/%d/comm", pid)) |
| 388 | if err == nil && len(data) > 0 { |
| 389 | return strings.TrimSpace(string(data)), nil |
| 390 | } |
| 391 | p, err := process.NewProcessWithContext(ctx, pid) |
| 392 | if err != nil { |
| 393 | return "", err |
| 394 | } |
| 395 | return p.Name() |
| 396 | } |
| 397 | |
| 398 | func getConnectionType(connType uint32, family uint32) string { |
| 399 | switch { |
no test coverage detected