]>
sourceware.org Git - systemtap.git/blob - runtime/common_probe_context.h
1 /* Included once by translate.cxx c_unparser::emit_common_header ()
2 Defines all common fields and probe flags for struct context.
3 Available to C-based probe handlers as fields of the CONTEXT ptr. */
5 /* Used to indicate whether a probe context is in use.
6 Tested in the code entering the probe setup by common_probe_entry_prologue
7 and cleared by the common_probe_entry_epilogue code. When an early error
8 forces a goto probe_epilogue then needs an explicitly atomic_dec() first.
9 All context busy flags are tested on module unload to prevent unloading
10 while some probe is still running. */
13 /* The fully-resolved probe point associated with a currently running probe
14 handler, including alias and wild-card expansion effects.
15 aka stap_probe->pp. Setup by common_probe_entryfn_prologue.
16 Used in warning/error messages and accessible by pp() tapset function. */
17 const char *probe_point
;
19 /* The script-level probe point associated with a currently running probe
20 handler, including wild-card expansion effects as per 'stap -l'.
21 Guarded by STP_NEED_PROBE_NAME as setup in pn() tapset function. */
22 #ifdef STP_NEED_PROBE_NAME
23 const char *probe_name
;
26 /* The kind of probe this is. One of the _STP_PROBE_HANDLER_ constants.
27 Used to determined what other fields are setup and how. Often the
28 probe context fields depend on how the probe handler is triggered
29 and what information it gets passed. */
32 /* Common status of probe. _STP_PROBE_STATE_ flags. */
35 /* Number of "actions" this probe handler is still allowed to do.
36 Setup in common_probe_entryfn_prologue to either MAXACTION or
37 Checked by code generated by c_unparser::record_actions (), which will
38 set last_error in case this goes to zero and then jumps to out.
39 MAXACTION_INTERRUPTIBLE. Note special case in enter_all_profile_probes. */
42 /* The current nesting of a function. Needed to determine which "level" of
43 locals to use. See the recursion_info traversing_visitor for how the
44 maximum is calculated. Locals of a function are stored at
45 c->locals[c->nesting], see c_unparser::emit_function (). */
48 /* A place to format error messages into if some error occurs, last_error
49 will then be pointed here. */
50 string_t error_buffer
;
52 /* Only used when stap script uses tokenize.stp tapset. */
53 #ifdef STAP_NEED_CONTEXT_TOKENIZE
59 /* NB: last_error is used as a health flag within a probe.
60 While it's 0, execution continues
61 When it's "something", probe code unwinds, _stp_error's, sets error state */
62 const char *last_error
;
63 /* Last statement (token) executed. Often set together with last_error. */
64 const char *last_stmt
;
66 /* Set when probe handler gets pt_regs handed to it. This can be either
67 the kernel registers or the user space registers. The probe_flags field
68 will indicate which and whether the user registers are complete. */
71 /* unwaddr is caching unwound address in each probe handler on ia64. */
73 unsigned long *unwaddr
;
76 /* Individual Probe State (ips).
77 A union since only one can be active at a time. */
80 /* kretprobe state. */
82 struct kretprobe_instance
*pi
;
83 /* int64_t count in pi->data, the rest is string_t.
84 See the kretprobe.stp tapset. */
88 /* State for mark_derived_probes. */
90 va_list *mark_va_list
;
91 const char *marker_name
;
92 const char *marker_format
;
95 /* State for tracepoint probes. */
96 const char *tracepoint_name
;
99 struct uretprobe_instance
*ri
;
101 /* State for procfs probes, see tapset-procfs.cxx. */
106 /* Only used when stap script uses the i386 or x86_64 register.stp tapset. */
107 #ifdef STAP_NEED_REGPARM
111 /* Only used for overload processing. */
113 cycles_t cycles_base
;
117 /* Current state of the unwinder (as used in the unwind.c dwarf unwinder). */
118 #if defined(STP_NEED_UNWIND_DATA)
119 struct unwind_context uwcontext
;
This page took 0.038363 seconds and 5 git commands to generate.