MCPcopy Index your code
hub / github.com/subtrace/subtrace / handle

Method handle

cmd/run/engine/engine.go:270–287  ·  view source on GitHub ↗
(n *seccomp.Notif)

Source from the content-addressed store, hash-verified

268}
269
270func (e *Engine) handle(n *seccomp.Notif) {
271 handler := process.Handlers[n.Syscall]
272 if handler == nil {
273 slog.Error(fmt.Sprintf("no handler found for %s", syscalls.GetName(n.Syscall)))
274 return
275 }
276
277 p := e.getProcess(n.PID)
278
279 switch err := handler(p, n); {
280 case err == nil:
281 case errors.Is(err, seccomp.ErrCancelled):
282 // The target's syscall was probably interrupted by a signal. We
283 // don't need to do anything more here.
284 default:
285 slog.Error(fmt.Sprintf("critical error in handling %s", syscalls.GetName(n.Syscall)), "notif", n, "proc", p, "err", err)
286 }
287}
288
289// Start receives and handles intercepted syscalls until all processes exit.
290func (e *Engine) Start() {

Callers 1

StartMethod · 0.95

Calls 2

getProcessMethod · 0.95
GetNameFunction · 0.92

Tested by

no test coverage detected