summaryrefslogtreecommitdiffstats
path: root/buildrun.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add -Werror to tracequery buildJosh Stone2009-09-291-1/+1
| | | | | | | | The final module build uses -Werror, so tracequery should as well to catch problems as early as possible. Some ext4 errors have crept in again (PR10703). * buildrun.cxx (make_tracequery): Add -Werror to EXTRA_CFLAGS.
* Try to build tracequery for all headers at onceJosh Stone2009-09-281-9/+4
| | | | | | | | | | | | | | | | | | | | | | To mitigate PR10424, we switched to building a separate tracequery module for each tracepoint header, so a bad header wouldn't break all of the others. However, with recent kernels that leads to ~18 make commands, which adds up quickly in time. It's cached, so that's not too bad, but as a developer who rebuilds stap frequently, it gets annoying. If we're going to call 18 makes, it's worth it to start with one bigger make that covers all the headers at once (like we used to). If that one fails, we can still fall back to compiling individually. FWIW, the failing ext4.h header was only created in 2.6.31, and was fixed before 2.6.32, so the specific failure in PR10424 has a fairly small window. * buildrun.cxx (make_tracequery): Just take a single vector of headers. * hash.cxx (find_tracequery_hash): Deal with multiple headers. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto. (tracepoint_builder::init_dw): Attempt all system headers together, and if that fails, try again individually.
* PR10390: ftrace() tapset functionFrank Ch. Eigler2009-09-231-0/+1
| | | | | | | | | | | * tapset/logging.stp (ftrace): New function. (*): Add kerneldoc to other functions. * doc/SystemTap_Tapset_Reference/tapsets.tmpl: Process logging.stp. * stapfuncs.3stap.in: Remove "LOGGING" section, now redundant. * runtime/autoconf-trace-printk.c: New autoconf test. * buildrun.cxx (compile_pass): Build it. * NEWS: Mention it. * testsuite/buildok/logging.stp: Test it.
* 2009-09-14 Dave Brolley <brolley@redhat.com>Dave Brolley2009-09-141-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modsign.cxx (init_cert_db_path): Use 'system' call. (sign_module): Renamed to 'main'. This is now an independant program. Check for arguments. Return 1 on error. * buildrun.cxx (modsign.h): Don't #include it. (compile_pass): Don't sign the module. * main.cxx (main): Don't copy the module signature. * cache.cxx (add_to_cache): Don't cache the module signature. * Makefile.am (bin_PROGRAMS): Add stap-sign-module. (stap_SOURCES): Remove modsign.cxx and nsscommon.c. (stap_sign_module_SOURCES): New variable. (stap_sign_module_CPPFLAGS): New variable. (stap_sign_module_LDFLAGS): New variable. (stap_sign_module_LDADD): New variable. * stap-server (initialization): Initialize unprivileged. (parse_options): Handle --unprivileged. (create_response): Call stap-sign-module if --unprivileged was specified. * systemtap.spec: Add stap-sign-module to stap-server. * Makefile.in: Regenerated. * doc/Makefile.in: Regenerated. * doc/SystemTap_Tapset_Reference/Makefile.in: Regenerated. * grapher/Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * aclocal.m4: Likewise. * testsuite/aclocal.m4: Likewise. * configure: Likewise. * testsuite/configure: Likewise.
* Unify lex_cast* and avoid string copiesJosh Stone2009-09-021-5/+5
| | | | | | | | | | | | | | | We always use lex_cast either to string or from string, so I made that explicit, and got rid of some string copies in the process. There was also stringify(), which was redundant to lex_cast<string>. We also always used lex_cast_hex to string, so that's now hard-coded and again eliminated a string copy. For lex_cast_qstring<string>, there's no need to write the streamify the input, so a specialization now operates directly on the input. Hopefully this is a bit cleaner, and I do measure it to be a little faster on scripts with many probes.
* PR10581: Use ARCH for tracepoints and kernel typequeriesJosh Stone2009-09-011-0/+16
| | | | | | | | | | | | These are kernel modules that we generate for querying debuginfo, so they need to use the same ARCH settings that we put in the main script module. * buildrun.cxx (make_tracequery, make_typequery_kmod): Add the arch and kbuild flags to make_cmd. * hash.cxx (find_stapconf_hash, find_tracequery_hash, find_typequery_hash): The arch is in the base hash already, but add the kbuild flags too.
* PR4186 cont'd: tolerate older kbuild Makefile's chattinessFrank Ch. Eigler2009-08-241-0/+8
| | | | * buildrun.cxx (run_make_cmd): Add back >/dev/null for older kernels.
* PR4186: cross-architecture probe buildingFrank Ch. Eigler2009-08-241-4/+13
| | | | | | | | | | | * main.cxx (main): Add 'a:' and 'B:' options. * session.h (kbuildflags): New place to store -B args. * testsuite/systemtap.base/cmd_parse.exp: Test them lightly. * buildrun.cxx (run_make_cmd): Use "--no-print-directory" rather than ">/dev/null" in kbuild invocations. Pass '-a' and '-B' flags along. * hash.cxx (find_script_hash): Add them. * NEWS, stap.1.in: Mention this.
* PR10551: build compatibility for pax/grsecurity include/linux/module.hFrank Ch. Eigler2009-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* PR10544: clean up stap child process error handlingFrank Ch. Eigler2009-08-211-25/+7
| | | | | | | * util.cxx (stap_system): Take extra verbosity value. Standardize error handling / tracing. * util.h: Corresponding changes. * buildrun.cxx, main.cxx, modsign.cxx: Update callers.
* usability: don't suppress pass-4 compiler errorsFrank Ch. Eigler2009-08-141-1/+1
| | | | | | ... since a pass-4 compilation error is just as bad as pass-2 error. * buildrun.cxx (run_make_cmd): Remove "2>&1".
* Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-231-38/+12
|\
| * PR10424: Consider each tracepoint header separatelyJosh Stone2009-07-201-37/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the current monolithic tracepoint query module, a failure in any of the discovered tracepoint headers means that you can't use any of the others either. This patch creates a separate query module for each header so they can pass or fail independently. * buildrun.cxx (make_tracequery): take a single header name instead of globbing for everything we can find. * hash.cxx (find_tracequery_hash): name the header file we're hashing. * tapsets.cxx (tracepoint_query::handle_query_func): make sure we don't duplicate tracepoints found through different headers. (tracepoint_builder::get_tracequery_module): get a header's module (tracepoint_builder::init_dw): glob for all tracepoint headers, and feed all their modules into dwflpp.
| * Fixed PR 10386 by removing the need to convert a pid to a task.David Smith2009-07-201-1/+0
| | | | | | | | | | | | | | | | | | * runtime/itrace.c (usr_itrace_init): Changed prototype to take a task_struct instead of a pid. * tapset-itrace.cxx (emit_module_decls): Updated usr_itrace_init() call. * runtime/autoconf-find-task-pid.c: Removed, since only user_itrace_init() was using it. * buildrun.cxx (compile_pass): Removed autoconf-find-task-pid.c test.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-141-1/+10
|\| | | | | | | | | | | Conflicts: main.cxx
| * Remove -O[0123s] gcc optimization flags for gcc pass 4 speedups again.Mark Wielaard2009-07-141-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | We cannot guarantee that (un)optimized code compiles and/or generates fully functional code, so don't tempt the user to try it out. * session.h (struct systemtap_session): Remove gcc_flags string field. * hash.cxx (find_script_hash): Don't add gcc_flags. * main.cxx (usage): Remove -O[0123s] documentation. (main): Don't use gcc_flags. * buildrun.cxx (compile_pass): Don't add gcc_flags to EXTRA_CFLAGS. * stap1.in: Remove -O[0123s] documentation. * testsuite/systemtap.base/cache.exp: Remove tests for -O[0123s].
| * Make kernel opt-level the default again.Mark Wielaard2009-07-141-0/+6
| | | | | | | | | | | | | | * main.cxx (main): Default gcc_flags to kernel opt-level (empty). * buildrun.cxx (compile_pass): Add -freorder-blocks back, document choices. * stap.1.in: Document new default opt-level. * testsuite/systemtap.base/cache.exp: Adjust for new caching results.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-131-1/+1
|\| | | | | | | | | | | Conflicts: main.cxx
| * Add -O[0123s] gcc optimization flags for gcc pass 4 speedup.Mark Wielaard2009-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | * session.h (struct systemtap_session): Add gcc_flags string field. * main.cxx (usage): Document -O[0123s]. (main): Default gcc_flags to -O0. Add O:: to getopt_long. Handle case 'O' to set gcc_flags. * buildrun.cxx (compile_pass): Add gcc_flags to EXTRA_CFLAGS. * stap1.in: Add -O[0123s] documentation. * testsuite/systemtap.base/cache.exp: Add tests for -O[0123s].
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-101-0/+1
|\|
| * Added timer data flushing and overwrite handling to the ring_buffer transport.David Smith2009-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * buildrun.cxx (compile_pass): Checks for ring_buffer api change. * runtime/autoconf-ring_buffer-flags.c: New file. * runtime/transport/ring_buffer.c (tracing_wait_pipe): No longer schedules, just returns. The timer function will handle it later. (_stp_data_write_reserve): Handles ring_buffer api change. Added overwrite processing. If we're full, delete an event to make room. (_stp_data_write_commit): Handles ring_buffer api change. (__stp_relay_wakeup_timer): New function. (__stp_relay_timer_start): Ditto. (__stp_relay_timer_stop): Ditto. (_stp_transport_data_fs_start): Calls __stp_relay_timer_start(). (_stp_transport_data_fs_stop): Calls __stp_relay_timer_stop(). (_stp_transport_data_fs_overwrite): Sets overwrite flag.
* | Only sign modules if --unprivileged is specified.Dave Brolley2009-06-111-2/+3
|/ | | | | | Don't generate an error message for unsigned modules. Make sure module signature exists before attempting to copy to the cache. Allow timer p[robes for unprivileged users.
* Don't attempt NSS if the module failed to buildJosh Stone2009-05-081-1/+2
|
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapDave Brolley2009-05-041-2/+12
|\
| * add verboser strerrors if posix_spawn failedFrank Ch. Eigler2009-04-301-2/+12
| | | | | | | | | | | | * buildrun.cxx (run_make_cmd, kernel_built_uprobes, copy_uprobes_symbols, run_pass, make_typequery_umod): Print strerror after a failed stap_system() if verbose.
* | Module signing and verification using a separate file for the module signature.Dave Brolley2009-05-041-0/+11
|/
* [tracepoints] Resolve implicit trace_X useJosh Stone2009-04-211-1/+2
| | | | | | | Some of the tracepoints are actually being called in inlines in the common headers (e.g. trace_kmalloc), which is causing errors about implicit function declarations. We don't care about ever running the code in the tracequery module, so I'm just suppressing that error.
* [tracepoints] Don't use TRACE_HEADER_MULTI_READJosh Stone2009-04-211-4/+0
| | | | | | | At one point that macro was needed to get all of the tracepoints on the tip tree, but now it's causing us to get duplicate stapprobe_X definitions. AFAICS, we're now getting all tracepoints even without MULTI_READ, so I'm pulling that workaround out.
* NB @cast's relative header searchingJosh Stone2009-04-211-0/+14
|
* Refine the @cast-with-header syntaxJosh Stone2009-04-211-2/+31
| | | | | | | The special syntax to generate a module for type information is now: - "kernel<path/to/header.h>" to use the kernel's build environment - "<path/to/header.h>" to use no special build environment, and so use gcc's default parameters only (for user mode).
* Add functions to build umod & kmod typequeryJosh Stone2009-04-171-0/+57
|
* Remove module boilerplate from tracequeryJosh Stone2009-04-171-5/+0
| | | | | | | Kernel modules will actually build just fine with none of the module boilerplate code. We don't care about ever actually loading the tracequery module that we make, so don't bother emitting code we don't need.
* Keep up with tracepoint changes in kernel-tipJosh Stone2009-04-161-5/+19
| | | | | | | | - Define TRACE_HEADER_MULTI_READ to allow re-pulling headers that were already included indirectly elsewhere. - Some tracepoint headers were moved down to include/trace/events/, so add that to our glob paths. - Add ftrace.h as a header that we should never include.
* Uses <asm/syscall.h> when available.David Smith2009-04-091-0/+2
| | | | | | | | | | | | | | | | | | | | 2009-04-09 David Smith <dsmith@redhat.com> * buildrun.cxx (compile_pass): Compile autoconf test for <asm/syscall.h>. * runtime/autoconf-asm-syscall.c: New "autoconf" test the presence of <asm/syscall.h>. * runtime/syscall.h: If <asm/syscall.h> exists, use it. Otherwise, use our private copy of the functions for each architecture. (syscall_get_nr): Renamed from __stp_user_syscall_nr(). (syscall_get_return_value): Renamed from __stp_user_syscall_return_value(). (syscall_get_arguments): Renamed from __stp_user_syscall_arg(). * runtime/task_finder.c (__stp_utrace_task_finder_target_syscall_exit): Uses new syscall.h functions. * tapset/utrace.stp: Ditto.
* Disable ccache during kernel module buildsJosh Stone2009-04-021-0/+6
| | | | | | | | Our module builds always have a 0% ccache hit rate, because the compiler commands always include the randomized tmpdir. Thus, I'm setting CCACHE_DISABLE=1 so ccache never saves these one-use objects. (Besides, we already have our own caching in place for this stuff...)
* PR10016: Purge stap of all pgrp and system() usageJosh Stone2009-04-011-4/+4
| | | | | | | | | | | | | | | | | | | We hereby no longer try to manipulate process groups in any way. We don't set a private process group, and we never kill() our entire group either. Instead of using system(), we now have a stap_system() which saves the child PID, so when we get a terminating signal we can pass it along to the child. Signals sent through the TTY have always worked, since the TTY sends it to the entire pgrp. However, if we're running as part of a wrapper script or GUI, which may not have a separate process group for stap, we still would like to allow "kill -TERM $STAPPID" to terminate stap nicely. There's still a short window of failure in the time that staprun is active, because we can't kill a setuid process from a user process. Once staprun drops privileges and execs to stapio though, everything should work fine.
* PR9998: adapt tapset/i686/registers.stp to latest kernelWenji Huang2009-03-301-0/+1
| | | | | | | | | * buildrun.cxx (compile_pass): Add autoconf-x86-gs.c. * tapset/i686/registers.stp (_stp_register_regs): Update offsets. (test_x86_gs): Auxiliary function. * runtime/autoconf-x86-gs.c : New file. * testsuite/systemtap.base/x86_gs.exp : New test case. * testsuite/systemtap.base/x86_gs.stp : Ditto.
* PR9993: tracepoint toleration for undeclared types in trace/*.h headersFrank Ch. Eigler2009-03-241-1/+6
| | | | | | | | | * tapsets.cxx (tracepoint_extra_headers): New function to return needed header file names. (emit_module_decls): Emit them. * buildrun.cxx (make_tracequery): Emit them. * testsuite/systemtap.base/tracepoints.exp: Rewrite to exercise building each tracepoint.
* support tracepoint extraction for kernel build trees built with O=/pathFrank Ch. Eigler2009-03-201-13/+17
| | | | * buildrun.cxx (make_tracequery): Also search source/include/trace/*.h.
* PR6930: stap: supports on-file flight recorder optionsMasami Hiramatsu2009-03-201-1/+4
| | | | | | | Add on-file flight recorder options (the combination of -F and -o, and -S option) to stap command, and change manpages and NEWS. - Both of -F and -o is specified, stap passes -D option to staprun. - stap just passes -S option to staprun.
* add runtime/autoconf magic for itrace on pre-find_task_by_vpid kernelsFrank Ch. Eigler2009-03-191-0/+1
|
* Adapt to linux-next commit changing __alloc_percpu API.Frank Ch. Eigler2009-03-081-0/+1
| | | | | After linux-next commit f2a8205c, it takes two parameters again, so we autoconf for it rather than use KERNEL_VERSION ifdefs.
* Support older tracepoints using DEFINE_TRACEJosh Stone2009-03-061-0/+5
| | | | | | | | | At one point, the tracepoints API didn't have DECLARE_TRACE, and the trace headers all used DEFINE_TRACE. This is what got pulled into RHEL, so we need to support this older usage. The rest of the API stays the same though. * buildrun.cxx (make_tracequery): Redefine DEFINE_TRACE as well.
* Build tracequery to scan for tracepointsJosh Stone2009-03-061-0/+70
| | | | | | | | | | * session.h (systemtap_session): add tracepoint_derived_probes * buildrun.cxx (make_tracequery): New - builds a kernel module that hijacks the tracepoint declarations, so we can query debuginfo. * buildrun.h: declare above * tapsets.cxx (tracepoint_builder): New builder for tracepoint probes. For now it just handles the initialization to build the tracequery kernel module.
* stap autoconf test for kernel stack trace supportTim Moore2009-03-041-0/+2
| | | | | | | | | | * buildrun.cxx (compile_pass): Add autoconf line for stack trace test, which defines STAPCONF_KERNEL_STACKTRACE. * runtime/autoconf-save-stack-trace.c: New file. * runtime/stack.c : Use STAPCONF_KERNEL_STACKTRACE instead of tests for kernel configuration and versions. * runtime/stack-i386.c : ditto * runtime/stack-x86_64.c : ditto
* Remove STAPCONF_CFLAGS from the generated MakefileJosh Stone2009-02-201-3/+0
| | | | | This was leftover from my initial draft of autoconf caching. It's not used at all anymore...
* Clean up the autoconf cachingJosh Stone2009-02-071-33/+43
| | | | | | | | | | | | | | | | | This makes the stapconf caching process quite a bit more transparent. The options are now cached in a header file as #defines, and this header file is a normal build dependency instead of calling so many make $(shell ...) commands. * buildrun.cxx (compile_pass): Pull in autoconf options in a header of #defines rather than -DXXX, and make that header a build dependency. * buildrun.cxx (output_autoconf): New function to consolidate the computation of each autoconf test. * cache.cxx (add_to_cache, get_from_cache, clean_cache): Start treating the stapconf header as a first-class cached item. * cache.h: Move definitions of things only needed in cache.cxx * hash.cxx (find_stapconf_hash): Generate stapconf_name as a .h now. * main.cxx (main): Default the stapconf_name based on getpid().
* Save kernel autoconf options in a cache fileJosh Stone2009-02-061-18/+36
| | | | | | | | | | We're getting enough autoconf tests now that it's a significant chunk of the build time. Adding this cache shaves several seconds off for me. * hash.cxx (find_hash): Compute a separate script-independent hash for caching autoconf values, saved in session.stapconf_path. * buildrun.cxx (compile_pass): Tweak the Makefile to read/save the autoconf values in the cache directory
* 2.6.29rc build fix: autoconf for proc_dir_entry->owner going awayFrank Ch. Eigler2009-02-061-1/+2
|
* PR9740/9816? - workaround for kernel valloc bugFrank Ch. Eigler2009-02-051-0/+1
|