summaryrefslogtreecommitdiffstats
path: root/runtime/print.c
Commit message (Collapse)AuthorAgeFilesLines
* runtime: print stp_alloc statistics in startup printkFrank Ch. Eigler2009-12-101-19/+12
| | | | | * runtime/alloc.c: Define DEBUG_MEM. * runtime/print.c (_stp_print_kernel_info): Reformat/rescale mem values.
* PR10650: markup some unprivileged-safe tapset functionsFrank Ch. Eigler2009-09-161-2/+10
| | | | | | | | | | | | | | | | | Add /* unprivileged */ to a variety of tapset embedded-c functions, together with uid-assertion-checking code as needed. This is only an initial set, and may need to grow or shrink after further testing. Prototyped-By: Dave Brolley <brolley@redhat.com> * runtime/runtime.h (is_myproc, assert_is_myproc): New macros. * runtime/addr-map.c (lookup_bad_addr): Reject if !is_myproc in unprivileged mode. * runtime/print.c (_stp_print_kernel_info): Add unprivileged mode info. * tapset/DEVGUIDE: Document /* pure */ and /* unprivileged */. * tapset/*.stp: Add /* unprivileged */ here and there, in questionable cases along with an assert_is_myproc().
* PR10551: cont'dFrank Ch. Eigler2009-08-231-1/+2
| | | | * runtime/print.c (_stp_print_kernel_info): Also switch module_core->module_core_rx.
* PR10551: build compatibility for pax/grsecurity include/linux/module.hFrank Ch. Eigler2009-08-231-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adapts to patches such as: diff -urNp linux-2.6.29.6/include/linux/module.h linux-2.6.29.6/include/linux/module.h --- linux-2.6.29.6/include/linux/module.h 2009-07-02 19:41:20.000000000 -0400 +++ linux-2.6.29.6/include/linux/module.h 2009-07-30 17:59:26.175602427 -0400 @@ -278,16 +278,16 @@ struct module int (*init)(void); /* If this is non-NULL, vfree after init() returns */ - void *module_init; + void *module_init_rx, *module_init_rw; /* Here is the actual code + data, vfree'd on unload. */ - void *module_core; + void *module_core_rx, *module_core_rw; /* Here are the sizes of the init and core sections */ - unsigned int init_size, core_size; + unsigned int init_size_rw, core_size_rw; /* The size of the executable code in each section. */ - unsigned int init_text_size, core_text_size; + unsigned int init_size_rx, core_size_rx; * runtime/autoconf-grsecurity.c: New test. * buildrun.cxx: Try it. * runtime/print.c: Use it.
* Cleanup.David Smith2009-06-181-1/+1
| | | | | | * runtime/print_old.c: Removed unneeded file. * runtime/print_flush.c: Renamed from print_new.c * runtime/print.c: Includes print_flush.c (instead of print_new.c).
* Merge commit 'origin/master' into pr7043David Smith2009-05-211-25/+2
|\ | | | | | | | | | | | | Conflicts: runtime/print.c runtime/transport/transport.c runtime/transport/transport_msgs.h
| * PR7072: use _stp_reserve_bytes for printf bufferKent Sebastian2009-04-171-26/+2
| |
* | Start at supporting the original transport (STP_TRANSPORT_VERSION=1).David Smith2009-05-121-6/+0
| | | | | | | | | | | | | | | | | | * runtime/print.c: Only use print_new.c. * runtime/print_new.c (stp_print_flush): Add STP_TRANSPORT_VERSION 1 support. * runtime/transport/transport.c: Removed inclusion of procfs.c. * runtime/transport/procfs.c (_stp_proc_read): Adapt to new interface. (_stp_proc_write): Ditto. * runtime/transport/relayfs.c: Ditto.
* | Renamed STP_OLD_TRANSPORT to STP_TRANSPORT_VERSION.David Smith2009-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 2009-04-02 David Smith <dsmith@redhat.com> * runtime.h: Defines STP_TRANSPORT_VERSION instead of STP_OLD_TRANSPORT. * staprun/staprun.h (STP_OLD_TRANSPORT): Ditto. * print.c: Changed STP_OLD_TRANSPORT to STP_TRANSPORT_VERSION. * staprun/mainloop.c (stp_main_loop): Ditto. * transport/transport.c: Ditto. * transport/transport.h: Ditto. * transport/transport_msgs.h: Ditto. * transport/utt.h: Ditto.
* | Major hacking to minimal config.David Smith2009-02-241-0/+1
|/ | | | | | | | | | | | | | | | | | 2009-02-24 David Smith <dsmith@redhat.com> * print.h: New file. * print.c: Includes new print.h file. * print_new.c (stp_print_flush): Commented out some code that needs replacing. * sym.c: Includes sym.h. * transport/debugfs.c: Includes transport.h. * transport/relayfs.c: Updated _stp_get_root_dir() call. * transport/transport.c: Ifdef'ed out most setup. * transport/transport.h: Ifdef'ed out all but basics. * transport/utt.c (utt_create_tree): Updated _stp_get_root_dir() call. * transport/utt.h: Commented out 'rchan' in struct utt_trace. (utt_reserve): Ifdef'ed out guts.
* Removed unused functions and variables.David Smith2009-02-181-34/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-02-18 David Smith <dsmith@redhat.com> * io.c (_stp_log): Removed unused function. * map.c (_stp_cmp): Replace _stp_log() with dbug(). * mempool.c (_stp_mempool_resize): Removed unused function. * print.c (next_fmt): Removed unused function. * procfs.c: Removed unused variable '_stp_num_procfs_files'. * regs.c (_stp_ret_addr): Removed unused function. * string.c (_stp_text_str): Removed unused variable 'len'. * string.h: Removed unused variable '_stdout_' and function declaration for deleted function '_stp_vsprintf'. * sym.c: Removed unused variables. * unwind.c (_stp_create_unwind_hdr): Removed unused function. 2009-02-18 David Smith <dsmith@redhat.com> * control.c: Removed unused variable '_stp_current_buffers'. * procfs.c (_stp_set_buffers): Removed unused function. (_stp_register_ctl_channel_fs): Removed unused variables and label. * symbols.c (u32_swap): Removed unused function. (generic_swap): Ditto. (_stp_sort): Ditto. (_stp_section_is_interesting): Ditto. * transport.c (_stp_transport_init): Removed unused variable 'ret'.
* Use 'static' as much as possibleJosh Stone2009-01-281-8/+8
| | | | | | | | | | This change just inserts 'static' on runtime, tapset, and generated C functions and globals, so the compiler can do a better job of optimizing. My tests with small scripts show ~10% reduction in compile time and ~20% reduction in module size. Larger scripts may show less benefit, but I expect purely positive results.
* Remove _stp_pbuf_full.Martin Hunt2008-04-151-11/+0
|
* runtime backtrace: stop infinite loops by checking for full print bufferFrank Ch. Eigler2008-04-131-0/+10
| | | | | | | | 2008-04-13 Frank Ch. Eigler <fche@elastic.org> * print.c (_stp_pbuf_full): New function to note full print buffer. * stack-{i386,x86_64}.c: Use it in all stack-searching loops, to impose another limit against unbounded iteration.
* Add support for memory allocation tracking.hunt2008-01-151-7/+32
|
* 2007-11-12 Martin Hunt <hunt@redhat.com>hunt2007-11-121-7/+17
| | | | | * print.c (_stp_print): Rewrite to eliminate the strlen() call and save a bit of time.
* 2007-11-09 Masami Hiramatsu <mhiramat@redhat.com>hiramatu2007-11-091-0/+35
| | | | | | | | | | | | | | | | PR3858 * print.c: Add -DRELAY_HOST=<hostname> and -DRELAY_GUEST=<hostname> options support. (_stp_print_flush): Disable irqs if -DRELAY_* option is specified. * print_old.c: Export stp_print_flush to other modules if the -DRELAY_HOST option is specified. * print_new.c: Ditto. * transport.c (_stp_transport_init): Reduce relay buffer size to 64KB*2 if -DRELAY_GUEST is specified. * systemtap.printf/sharedbuf.exp: New test for buffer sharing option. * systemtap.printf/sharedbuf.stp: Ditto. * systemtap.printf/hello.stp: Ditto. * systemtap.printf/hello2.stp: Ditto.
* 2007-03-14 Martin Hunt <hunt@redhat.com>hunt2007-03-141-49/+8
| | | | | | | | | | | | | | | | | | | | * bench2/bench.rb: Updated to work with new transport and new itest.c. * bench2/Makefile: Updated for new itest.c * bench2/itest.c: Rewritten to use multiple threads and automatically divide the workload among the threads. * print.c (_stp_print_flush): Move to print_new.c and print_old.c. * print_new.c: New file containing _stp_print_flush() for the new transport. * print_old.c: Ditto for old transport. * runtime.h (STP_OLD_TRANSPORT): Define (errk): Define. (MAXSTRINGLEN): Define if not already defined. * io.c (_stp_vlog): Use _stp_ctl_write().
* 2007-01-31 Martin Hunt <hunt@redhat.com>hunt2007-01-311-51/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * string.c (_stp_string_init): Deleted. (_stp_sprintf): Deleted. (_stp_vsprintf): Deleted. (_stp_string_cat_cstr): Deleted. (_stp_string_cat_string): Deleted. (_stp_string_cat_char): Deleted. (_stp_string_ptr): Deleted. (_stp_string_cat): Deleted. (_stp_snprintf): Moved from vsprintf.c. (_stp_vscnprintf): Moved from vsprintf.c. * string.h (STP_STRING_SIZE): Deleted. (STP_NUM_STRINGS): Deleted. Remove all references to type "String". * vsprintf.c (_stp_vscnprintf): Moved to string.c. (_stp_snprintf): Moved to string.c * sym.c (_stp_symbol_sprint): Replaced with _stp_symbol_print, which writes to the print buffer. (_stp_symbol_sprint_basic): Replaced with _stp_symbol_snprint. * runtime.h: Include io.c. * stat-common.c: Use new _stp_print* functions. * stat.c: Ditto. * regs.c: Renamed to regs-ia64.c. * current.c: Renamed regs.c. * regs-ia64.c: New file (renamed from regs.c). * stack.c (_stp_stack_sprint): Renamed _stp_stack_print and now just prints to the print buffer. Calls __stp_stack_print instead of __stp_stack_sprint. (_stp_stack_snprint): New function. Calls _stp_stack_print and then copies the print buffer into a string. (_stp_stack_printj): Deleted. (_stp_ustack_sprint): Deleted. * stack-*.c: Rewritten to print instead of writing to strings. Uses new _stp_print* functions. * print.c (_stp_printf): Create new function instead of macro. (_stp_print): Ditto. (_stp_print_char): New function. * map.c: Use _stp_print() and _stp_print_char() instead of _stp_print_cstr(). * io.c (_stp_vlog): Use _stp_print() instead of _stp_string_cat_cstr(). * copy.c (_stp_string_from_user): Deleted.
* 2007-01-30 Martin Hunt <hunt@redhat.com>hunt2007-01-301-3/+14
| | | | | | | | | | | * io.c (_stp_vlog): Use dynamic percpu allocations instead of very wasteful static allocations. * print.c (_stp_print_init): Do percpu allocations for io.c. (_stp_print_cleanup): Free percpu allocations. * string.c (_stp_sprintf): Overflow check needed to be >= instead of >.
* 2007-01-29 Martin Hunt <hunt@redhat.com>hunt2007-01-291-0/+1
| | | | | | | | | | * alloc.c (_stp_kmalloc): New function. Call kmalloc with the coirrect flags and track usage. (_stp_kzalloc): Ditto. * map.c: Use new alloc calls. * print.c: Ditto. * stat.c: Ditto. * time.c: Ditto.
* 2006-12-15 Frank Ch. Eigler <fche@elastic.org>fche2006-12-151-1/+1
| | | | * print.c (_stp_print_flush): Add a likely() marker to the hot path.
* 2006-09-26 David Smith <dsmith@redhat.com>dsmith2006-09-261-2/+2
| | | | | | | | | | * README: Changed 'stpd' references to 'staprun'. * README.doc: Ditto. * TODO: Ditto. * io.c: Ditto. * print.c: Ditto. * runtime.h: Ditto. * bench2/bench.rb: Ditto.
* 2006-09-22 Martin Hunt <hunt@redhat.com>hunt2006-09-221-6/+3
| | | | | * print.c: Replace STP_PRINT_BUF_LEN with STP_BUFFER_SIZE. * string.c: Ditto.
* 2006-09-21 Martin Hunt <hunt@redhat.com>hunt2006-09-221-3/+16
| | | | | | | | | | | PR 3232 * print.c (_stp_print_init): New. Alloc per-cpu buffers. (_stp_print_cleanup): New. Free per-cpu buffers. (_stp_print_flush): Use per_cpu_ptr(). * string.c (_stp_sprintf): Ditto. (_stp_vsprintf): Ditto. (_stp_string_cat_cstr): Ditto. (_stp_string_cat_char): Ditto.
* 2006-09-18 Martin Hunt <hunt@redhat.com>hunt2006-09-181-52/+86
| | | | | | | | | | | | | | | | * print.c (_stp_print_flush): Rewrite so one version works for relayfs or procfs. Use proper per-cpu functions. (_stp_reserve_bytes): New function. Reserve bytes in the output buffer. (_stp_print_binary): New function. Write a variable number of 64-bit values directly into the output buffer. * string.c (_stp_sprintf): Rewrite using new per-cpu buffers. (_stp_vsprintf): Ditto. (_stp_string_cat_cstr): Ditto. (_stp_string_cat_char): Ditto. * runtime.h: Set defaults for MAXTRYLOCK and TRYLOCKDELAY to make runtime tests in bench2 happy.
* PR 3037wcohen2006-08-141-1/+0
| | | | | * string.c: * print.c: Remove includes for <linux/config.h>.
* fix TIMESTAMP_SIZE conflict with Suse kernelstrz2006-04-111-4/+4
|
* 2006-04-09 Martin Hunt <hunt@redhat.com>hunt2006-04-101-2/+3
| | | | | | | | | | | * print.c (_stp_print_flush): Send 'len" bytes instead of 'len+1', which included terminating 0. * string.c (_stp_sprintf): Call _stp_vsnprintf() instead of vsnprintf(). (_stp_vsprintf): Ditto. * vsprintf.c: New file.
* 2005-10-31 Martin Hunt <hunt@redhat.com>hunt2005-10-311-1/+11
| | | | * ALL: Cleanup copyrights.
* switch to binary TIMESTAMPtrz2005-10-191-5/+3
|
* Fix for PR 1455trz2005-10-141-1/+1
|
* 2005-08-19 Martin Hunt <hunt@redhat.com>hunt2005-08-191-3/+3
| | | | | | | | | | * print.c: Change ifdefs to STP_RELAYFS. * runtime.h: Ditto. * io.c (_stp_vlog): Call _stp_write instead of _stp_ctrl_send. * Makefile: Don't build stp-control. * README.doc: Update. * TODO: Update.
* 2005-08-03 Martin Hunt <hunt@redhat.com>hunt2005-08-041-0/+4
| | | | | * io.c (_stp_vlog): Revert previous change for now. * print.c (_stp_print_flush): Ditto.
* Added transport failure messagetrz2005-08-031-2/+8
|
* 2005-08-01 Martin Hunt <hunt@redhat.com>hunt2005-08-011-2/+2
| | | | | | | * io.c (_stp_vlog): Use _stp_pid instead os _stp_tport->pid. * print.c (_stp_print_flush): Don't need _stp_tport. *runtime.h (probe_start): Just call _stp_transport_init(). (probe_exit): Just call _stp_transport_close().
* 2005-07-19 Martin Hunt <hunt@redhat.com>hunt2005-07-201-2/+5
| | | | | * print.c (_stp_print_flush): Check return value and increment transport failures.
* 2005-07-08 Martin Hunt <hunt@redhat.com>hunt2005-07-081-2/+2
| | | | | | * print.c (_stp_print_flush): Rename "t" to "_stp_tport". * io.c (_stp_vlog): Ditto.
* 2005-07-01 Martin Hunt <hunt@redhat.com>hunt2005-07-011-1/+0
| | | | | | | | | * probes.c: Convert all _stp_log() calls to either stp_warn() or dbug(). * print.c: Comment out dbug()s. * stat-common.c: Comment out dbug()s.
* Added merging/sorting of per-cpu data, transport config/selection by probe, etctrz2005-06-211-8/+8
|
* 2005-06-18 Martin Hunt <hunt@redhat.com>hunt2005-06-181-3/+37
| | | | | | | | | | | | | | | | | | | | | | | * counter.c: New file. Counter aggregations. * stat.c: New file. Stat aggregations. * stat.h: Header file for stats. * map-int.c: New file. Support for int64 values. * map-stat.c: New file. Support for stat values. * map-str.c: New file. Support for string values. * map-values.c: Now just includes the necessary map-*.c files. * stat-common.c: New file. Stats stuff common to Stats and maps containing stats. * Doxyfile: Bumped version to 0.6. * README: Renamed README.doc and reorganized.
* 2005-06-02 Martin Hunt <hunt@redhat.com>hunt2005-06-021-1/+1
| | | | | | | * string.c (_stp_string_cat_cstr): Be sure result is always terminated. * print.c (_stp_vprintf): Fix typo.
* 2005-05-26 Martin Hunt <hunt@redhat.com>hunt2005-05-261-8/+4
| | | | | | | | * current.c (_stp_sprint_regs): Implement for i386. * sym.c (_stp_symbol_sprint): Check name before trying to print it. (_stp_symbol_print): Change to macro that calls _stp_symbol_sprint().
* 2005-05-18 Martin Hunt <hunt@redhat.com>hunt2005-05-191-85/+31
| | | | | | | | | * print.c: All functions except _stp_print_flush() are now macros which use _stp_stdout. * string.c: Add _stp_stdout support. Data written to _stp_stdout is automatically flushed when the print buffer is full.
* Rewritten maps and other updated files.hunt2005-05-171-2/+39
|
* updated to use new transporttrz2005-05-061-32/+1
|
* *** empty log message ***hunt2005-04-071-11/+43
|
* Update to use relayfs.hunt2005-04-071-0/+168