This patch adds "fast" tracepoints to GDB. Formally, the meaning of a fast tracepoint is up to the architecture and target agent, and the user is simply requesting a faster implementation, with the possibility of the request being rejected, a la hardware breakpoints. In our current implementation on x86, the target agent implements fast tracepoints as jumps directly into the agent, rather than as traps. How fast is "fast" then? We've gotten it down to under 100 clock cycles to save registers, test a conditional (with bytecodes compiled into x86 machine code), and get back to the program - not much worse than a homemade logger compiled into your program. By contrast, taking a trap can chew up 10,000 clocks or more, depending on kernel efficiency. The tradeoff (and you knew this was coming :-) ) is that on x86 for example, the jump is a 5-byte instruction, and should only be inserted at the sites of instruction that are 5 bytes or longer. Most of the interesting trickery is on the target side - but don't despair, Pedro has upcoming patches for a free version using gdbserver and a special library. The GDB side is in this patch, mostly consisting of handling for a second type of tracepoint, and the architecture-specific oracle that checks request validity. Stan 2010-01-04 Stan Shebs Add fast tracepoints. * arch-utils.h (default_fast_tracepoint_valid_at): Declare. * arch-utils.c (default_fast_tracepoint_valid_at): New function. * breakpoint.h (enum bptype): Add bp_fast_tracepoint. * breakpoint.c (tracepoint_type): New function. (ALL_TRACEPOINTS): Use it. (should_be_inserted): Ditto. (bpstat_check_location): Ditto. (print_one_breakpoint_location): Ditto. (user_settable_breakpoint): Ditto. (set_breakpoint_location_function): Ditto. (disable_breakpoints_in_shlibs): Ditto. (delete_trace_command): Ditto. (print_it_typical): Add bp_fast_tracepoint case. (bpstat_what): Ditto. (print_one_breakpoint_location): Ditto. (allocate_bp_location): Ditto. (mention): Ditto. (breakpoint_re_set_one): Ditto. (disable_command): Ditto. (enable_command): Ditto. (check_fast_tracepoint_sals): New function. (break_command_really): Call it. (ftrace_command): New function. (_initialize_breakpoint): Add ftrace command. * gdbarch.sh (fast_tracepoint_valid_at): New. * gdbarch.h, gdbarch.c: Regenerate. * i386-tdep.c (i386_fast_tracepoint_valid_at): New function. (i386_gdbarch_init): Use it. * remote.c (struct remote_state): New field fast_tracepoints. (PACKET_FastTracepoints): New packet config type. (remote_fast_tracepoint_feature): New function. (remote_protocol_features): Add FastTracepoints. (remote_supports_fast_tracepoints): New function. (_initialize_remote): Add FastTracepoints. * tracepoint.c (download_tracepoint): Add fast tracepoint option. * NEWS: Mention fast tracepoints. * gdb.texinfo (Create and Delete Tracepoints): Describe fast tracepoints. * gdb.trace/tracecmd.exp: Test ftrace.