(root)/
strace-6.5/
src/
trace_event.h
       1  /*
       2   * Copyright (c) 2017-2021 The strace developers.
       3   * All rights reserved.
       4   *
       5   * SPDX-License-Identifier: LGPL-2.1-or-later
       6   */
       7  
       8  #ifndef STRACE_TRACE_EVENT_H
       9  # define STRACE_TRACE_EVENT_H
      10  
      11  /* Possible trace event loop states. Returned by next_event() and dispatched by
      12   * dispatch_event(). */
      13  enum trace_event {
      14  	/* Break the main loop. */
      15  	TE_BREAK,
      16  
      17  	/* Call next_event() again. */
      18  	TE_NEXT,
      19  
      20  	/* Restart the tracee with signal 0 and call next_event() again. */
      21  	TE_RESTART,
      22  
      23  	/*
      24  	 * For all the events below, current_tcp is set to current tracee's
      25  	 * tcb.  All the suggested actions imply that you want to continue
      26  	 * tracing of the current tracee; alternatively, you can detach it.
      27  	 */
      28  
      29  	/*
      30  	 * Syscall entry or exit.
      31  	 * Restart the tracee with signal 0, or with an injected signal number.
      32  	 */
      33  	TE_SYSCALL_STOP,
      34  
      35  	/*
      36  	 * Tracee received signal with number WSTOPSIG(*pstatus); signal info
      37  	 * is written to *si.  Restart the tracee (with that signal number
      38  	 * if you want to deliver it).
      39  	 */
      40  	TE_SIGNAL_DELIVERY_STOP,
      41  
      42  	/*
      43  	 * Tracee was killed by a signal with number WTERMSIG(*pstatus).
      44  	 */
      45  	TE_SIGNALLED,
      46  
      47  	/*
      48  	 * Tracee was stopped by a signal with number WSTOPSIG(*pstatus).
      49  	 * Restart the tracee with that signal number.
      50  	 */
      51  	TE_GROUP_STOP,
      52  
      53  	/*
      54  	 * Tracee exited with status WEXITSTATUS(*pstatus).
      55  	 */
      56  	TE_EXITED,
      57  
      58  	/*
      59  	 * Tracee is going to perform execve().
      60  	 * Restart the tracee with signal 0.
      61  	 */
      62  	TE_STOP_BEFORE_EXECVE,
      63  
      64  	/*
      65  	 * Tracee is going to terminate.
      66  	 * Restart the tracee with signal 0.
      67  	 */
      68  	TE_STOP_BEFORE_EXIT,
      69  
      70  	/*
      71  	 * SECCOMP_RET_TRACE rule is triggered.
      72  	 */
      73  	TE_SECCOMP,
      74  };
      75  
      76  #endif /* !STRACE_TRACE_EVENT_H */