Lines Matching refs:tracepoint
0 /* Tracepoint code for remote server for GDB.
19 #include "tracepoint.h"
40 implemented by patching the tracepoint location with a jump into a
43 instruction that was under the tracepoint jump (possibly adjusted,
48 agent's memory directly for downloading tracepoint and associated
75 fprintf (stderr, PROG "/tracepoint: %s\n", buf);
230 /* Agent understands static tracepoint, then check whether UST is in
335 tracepoint reaching the pass count, hitting conditional expression
392 trace_debug ("tracepoint_handler: tracepoint at 0x%s hit",
417 struct tracepoint;
418 static int tracepoint_send_agent (struct tracepoint *tpoint);
658 the tracepoint. The contents are not interpreted by the target,
679 /* Trap based tracepoint. */
682 /* A fast tracepoint implemented with a jump instead of a trap. */
685 /* A static tracepoint, implemented by a program call into a tracing
695 /* The definition of a tracepoint. */
705 both number and address to identify a tracepoint uniquely. */
707 struct tracepoint
709 /* The number of the tracepoint, as specified by GDB. Several
710 tracepoint objects here may share a number. */
713 /* Address at which the tracepoint is supposed to trigger. Several
717 /* Tracepoint type. */
720 /* True if the tracepoint is currently enabled. */
724 tracepoint hit. */
727 /* The number of times the tracepoint may be hit before it will
731 /* Pointer to the agent expression that is the tracepoint's
732 conditional, or NULL if the tracepoint is unconditional. */
735 /* The list of actions to take when the tracepoint triggers. */
739 /* Count of the times we've hit this tracepoint during the run.
748 /* Link to the next tracepoint in the list. */
749 struct tracepoint *next;
752 /* The list of actions to take when the tracepoint triggers, in
756 /* The collection of strings that describe the tracepoint as it was
770 tracepoint was relocated to. (_end is actually one byte past
776 assigned to this fast tracepoint. (_end is actually one byte
782 assigned to this fast tracepoint. (_end is actually one byte
794 /* Handle returned by the breakpoint or tracepoint module when we
795 inserted the trap or jump, or hooked into a static tracepoint.
805 than one tracepoint simultaneously. On the other hand, the same
806 tracepoint with a while-stepping action may be hit by more than one
816 /* The tracepoint number. */
818 /* The tracepoint's address. */
833 IP_AGENT_EXPORT_VAR struct tracepoint *tracepoints;
835 /* The first tracepoint to exceed its pass count. */
837 IP_AGENT_EXPORT_VAR struct tracepoint *stopping_tracepoint;
854 /* Pointer to the last tracepoint in the list, new tracepoints are
857 static struct tracepoint *last_tracepoint;
868 /* The tracepoint in which the error occurred. */
871 IP_AGENT_EXPORT_VAR struct tracepoint *error_tracepoint;
917 records the number of the tracepoint that created it. The data
943 /* The data collected at a tracepoint hit. This object should be as
951 /* Number of the tracepoint that collected this traceframe. A value
960 tracepoint hit. */
1277 /* Base "class" for tracepoint type specific data to be passed down to
1286 /* Fast/jump tracepoint specific data to be passed down to
1297 struct tracepoint *tpoint;
1300 /* Static tracepoint specific data to be passed down to
1307 the tracepoint hit. Initialized lazily, from REGS. */
1325 /* The GDB tracepoint matching the probed marker that was "hit". */
1326 struct tracepoint *tpoint;
1331 /* Static tracepoint specific data to be passed down to
1348 struct tracepoint *tpoint);
1357 struct tracepoint *tpoint);
1361 struct tracepoint *tpoint, int current_step);
1362 static void compile_tracepoint_condition (struct tracepoint *tpoint,
1367 struct tracepoint *tpoint,
1372 static struct tracepoint *fast_tracepoint_from_ipa_tpoint_address (CORE_ADDR);
1374 static void install_tracepoint (struct tracepoint *, char *own_buf);
1375 static void download_tracepoint (struct tracepoint *);
1376 static int install_fast_tracepoint (struct tracepoint *, char *errbuf);
1377 static void clone_fast_tracepoint (struct tracepoint *to,
1378 const struct tracepoint *from);
1398 record_tracepoint_error (struct tracepoint *tpoint, const char *which,
1401 trace_debug ("Tracepoint %d at %s %s eval reports error %d",
1785 /* Create a tracepoint (location) with given number and address. Add this
1786 new tracepoint to list and sort this list. */
1788 static struct tracepoint *
1791 struct tracepoint *tpoint, **tp_next;
1793 tpoint = XNEW (struct tracepoint);
1811 /* Find a place to insert this tracepoint into list in order to keep
1812 the tracepoint list still in the ascending order. There may be
1821 One jump pad was created for tracepoint A, B, and C, and the target
1845 /* Return the tracepoint with the given number and address, or NULL. */
1847 static struct tracepoint *
1850 struct tracepoint *tpoint;
1862 remove_tracepoint (struct tracepoint *tpoint)
1864 struct tracepoint *tp, *tp_prev;
1883 given tracepoint, or search from the beginning of the list if the
1886 static struct tracepoint *
1887 find_next_tracepoint_by_number (struct tracepoint *prev_tp, int num)
1889 struct tracepoint *tpoint;
1904 /* Append another action to perform when the tracepoint triggers. */
1907 add_tracepoint_action (struct tracepoint *tpoint, const char *packet)
2108 set up something to only call the getter once per tracepoint hit,
2184 /* Add a raw traceframe for the given tracepoint. */
2187 add_traceframe (struct tracepoint *tpoint)
2207 struct tracepoint *tpoint, int amt)
2263 struct tracepoint *tpoint;
2310 /* Search for the next traceframe recorded by the given tracepoint.
2421 struct tracepoint *tpoint;
2422 struct tracepoint *prev_stpoint;
2431 /* Catch the case where we might try to remove a tracepoint that
2435 trace_debug ("Tracepoint %d at 0x%s was "
2462 /* Nothing to do. We already unprobed a tracepoint set at
2480 /* Parse a packet that defines a tracepoint. */
2491 struct tracepoint *tpoint;
2497 tracepoint already supplied. */
2509 /* See if we already have this tracepoint. */
2517 trace_debug ("Tracepoint error: tracepoint %d"
2559 trace_debug ("Unknown optional tracepoint field");
2578 trace_debug ("Tracepoint error: tracepoint %d at 0x%s not found",
2584 /* Install tracepoint during tracing only once for each tracepoint location.
2585 For each tracepoint loc, GDB may send multiple QTDP packets, and we can
2586 determine the last QTDP packet for one tracepoint location by checking
2590 struct tracepoint *tp = NULL;
2605 /* Find another fast or static tracepoint at the same address. */
2626 /* Download and install fast tracepoint by agent. */
2660 struct tracepoint *tpoint;
2674 /* See if we already have this tracepoint. */
2679 trace_debug ("Tracepoint error: tracepoint %d at 0x%s not found",
2755 struct tracepoint *tp;
2768 trace_debug ("Tracepoint %d at 0x%s is already %s",
2775 trace_debug ("%s tracepoint %d at 0x%s",
2783 int offset = offsetof (struct tracepoint, enabled);
2800 trace_debug ("Tracepoint %d at 0x%s not found",
3040 clone_fast_tracepoint (struct tracepoint *to, const struct tracepoint *from)
3056 /* Install fast tracepoint. Return 0 if successful, otherwise return
3060 install_fast_tracepoint (struct tracepoint *tpoint, char *errbuf)
3067 /* The jump to the jump pad of the last fast tracepoint
3074 trace_debug ("Requested a fast tracepoint on an instruction "
3121 /* Install tracepoint TPOINT, and write reply message in OWN_BUF. */
3124 install_tracepoint (struct tracepoint *tpoint, char *own_buf)
3142 trace_debug ("Requested a %s tracepoint, but fast "
3151 trace_debug ("Requested a static tracepoint, but static "
3167 internal_error ("Unknown tracepoint type");
3178 static void download_tracepoint_1 (struct tracepoint *tpoint);
3183 struct tracepoint *tpoint, *prev_ftpoint, *prev_stpoint;
3245 trace_debug ("Requested a %s tracepoint, but fast "
3269 /* Tracepoint is installed successfully? */
3272 /* Download and install fast tracepoint by agent. */
3289 trace_debug ("Requested a static tracepoint, but static "
3321 + offsetof (struct tracepoint, next),
3331 /* Any error in tracepoint insertion is unacceptable; better to
3430 "tracepoint %d was hit %" PRIu64 " times",
3468 tracepoint trace frames from the inferior lib
3575 trace_debug ("Want to find next traceframe for tracepoint %d", tpnum);
3692 struct tracepoint *tpoint;
3701 /* See if we already have this tracepoint. */
3706 trace_debug ("Tracepoint error: tracepoint %d at 0x%s not found",
3716 /* State variables to help return all the tracepoint bits. */
3717 static struct tracepoint *cur_tpoint;
3724 tracepoint was originally downloaded. */
3727 response_tracepoint (char *packet, struct tracepoint *tpoint)
3750 tracepoint action was originally downloaded (with the difference
3756 response_action (char *packet, struct tracepoint *tpoint,
3765 tracepoint source piece was originally downloaded. */
3769 struct tracepoint *tpoint, struct source_string *src)
3783 /* Return the first piece of tracepoint definition, and initialize the
3784 state machine that will iterate through all the tracepoint
3790 trace_debug ("Returning first tracepoint definition piece");
3802 /* Return additional pieces of tracepoint definition. Each action and
3810 trace_debug ("Returning subsequent tracepoint definition piece");
3907 /* Return the first static tracepoint marker, and initialize the state
3927 /* Return the definition of the static tracepoint at a given address.
4279 /* Call this when thread TINFO has hit the tracepoint defined by
4280 TP_NUMBER and TP_ADDRESS, and that tracepoint has a while-stepping
4340 collecting tracepoint data, false otherwise. */
4345 struct tracepoint *tpoint;
4350 /* Pull in fast tracepoint trace frames from the inferior lib buffer into
4367 explained by a tracepoint. */
4374 trace_debug ("Thread %s finished a single-step for tracepoint %d at 0x%s",
4386 trace_debug ("NO TRACEPOINT %d at 0x%s FOR THREAD %s!",
4407 trace_debug ("Thread %s done stepping for tracepoint %d at 0x%s",
4450 /* Pull in fast tracepoint trace frames from the inferior in-process
4525 /* Return true if TINFO just hit a tracepoint. Collect data if
4531 struct tracepoint *tpoint;
4545 step over the fast tracepoint jump later, which avoids the
4553 trace_debug ("Thread %s at address of tracepoint %d at 0x%s",
4570 /* If the tracepoint had a 'while-stepping' action, then set
4571 the thread to collect this tracepoint on the following
4594 /* Create a trace frame for the hit of the given tracepoint in the
4599 struct tracepoint *tpoint)
4617 trace_debug ("Making new traceframe for tracepoint %d at 0x%s, hit %" PRIu64,
4627 trace_debug ("Tracepoint %d at 0x%s about to do action '%s'",
4648 struct tracepoint *tpoint, int current_step)
4654 "tracepoint %d at 0x%s, step %d of %" PRIu64 ", hit %" PRIu64,
4665 trace_debug ("Tracepoint %d at 0x%s about to do step action '%s'",
4720 /* Pass down the tracepoint address, because REGS doesn't
4746 struct tracepoint *tpoint,
4812 contain the tracepoint's address by the jump pad. */
4862 struct tracepoint *tpoint)
4868 IPA does. If the program stops at a fast tracepoint's address
4869 (e.g., due to a breakpoint, trap tracepoint, or stepping),
4870 gdbserver preemptively collect the fast tracepoint. Later, on
4871 resume, gdbserver steps over the fast tracepoint like it steps
4873 tracepoint. This avoids double collects of fast tracepoints in
4875 tracepoint gives the user a consistent view of when fast or trap
4878 resume. When a fast tracepoint is being processed by gdbserver,
4905 trace_debug ("Tracepoint %d at 0x%s condition evals to %s",
4911 /* See tracepoint.h. */
5160 struct tracepoint *tpoint;
5330 /* Read a requested block of static tracepoint data from a trace
5357 tracepoint data. */
5456 /* Return the first fast tracepoint whose jump pad contains PC. */
5458 static struct tracepoint *
5461 struct tracepoint *tpoint;
5471 /* Return the first fast tracepoint whose trampoline contains PC. */
5473 static struct tracepoint *
5476 struct tracepoint *tpoint;
5488 /* Return GDBserver's tracepoint that matches the IP Agent's
5489 tracepoint object that lives at IPA_TPOINT_OBJ in the IP Agent's
5492 static struct tracepoint *
5495 struct tracepoint *tpoint;
5507 /* The type of the object that is used to synchronize fast tracepoint
5512 /* The fast tracepoint number currently collecting. */
5534 STOP_PC, is presently locking the fast tracepoint collection, and
5552 struct tracepoint *tpoint;
5608 /* We can tell which tracepoint(s) the thread is collecting by
5609 matching the jump pad address back to the tracepoint. */
5636 /* We can tell which tracepoint(s) the thread is collecting by
5637 matching the trampoline address back to the tracepoint. */
5704 fast tracepoint collection quickly using a breakpoint. */
5746 /* The global fast tracepoint collect lock. Points to a collecting_t
5756 IP_AGENT_EXPORT_FUNC void gdb_collect (struct tracepoint *tpoint,
5764 gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
5793 /* Multiple tracepoints of different types, such as fast tracepoint and
5794 static tracepoint, can be set at the same address. */
5837 typedef void (*gdb_collect_ptr_type) (struct tracepoint *, unsigned char *);
5894 compile_tracepoint_condition (struct tracepoint *tpoint,
5900 trace_debug ("Starting condition compilation for tracepoint %d\n",
5917 trace_debug ("Condition compilation for tracepoint %d complete\n",
5926 trace_debug ("Condition compilation for tracepoint %d failed, "
5943 it may not be safe. We may be collecting a tracepoint in a signal
5994 /* Sync tracepoint with IPA, but leave maintenance of linked list to caller. */
5997 download_tracepoint_1 (struct tracepoint *tpoint)
5999 struct tracepoint target_tracepoint;
6044 + offsetof (struct tracepoint, cond),
6055 write_inferior_data_pointer (tpptr + offsetof (struct tracepoint,
6079 /* Send a command to agent to download and install tracepoint TPOINT. */
6082 tracepoint_send_agent (struct tracepoint *tpoint)
6132 /* The value of tracepoint's target address is stored in BUF. */
6159 download_tracepoint (struct tracepoint *tpoint)
6161 struct tracepoint *tp, *tp_prev;
6169 /* Find the previous entry of TPOINT, which is fast tracepoint or
6170 static tracepoint. */
6184 + offsetof (struct tracepoint, next),
6192 + offsetof (struct tracepoint, next),
6196 + offsetof (struct tracepoint, next),
6428 struct tracepoint *tpoint;
6549 /* UST puts a "struct tracepoint" in the global namespace, which
6550 conflicts with our tracepoint. Arguably, being a library, it
6553 #define tracepoint ust_tracepoint
6555 #undef tracepoint
6623 /* Given an UST marker, return the matching gdb static tracepoint.
6626 static struct tracepoint *
6629 struct tracepoint *tpoint;
6653 struct tracepoint *tpoint;
6692 trace_debug ("gdb_probe: tracepoint disabled");
6726 /* Called if the gdb static tracepoint requested collecting "$_sdata",
6727 static tracepoint string data. This is a string passed to the
6728 tracing library by the user, at the time of the tracepoint marker
6779 trace_debug ("Storing static tracepoint data in regblock: %s",
7000 /* Return the first static tracepoint, and initialize the state
7019 trace_debug ("Returning static tracepoint");
7313 /* Record the result of getting buffer space for fast tracepoint