summaryrefslogtreecommitdiffstats
path: root/buildrun.cxx
Commit message (Collapse)AuthorAgeFilesLines
* autoconf: standardize CPU_KHZ based on session kernel_exportsFrank Ch. Eigler2010-03-181-35/+11
| | | | | * buildrun.cxx (output_cpu_khz): Replace with generalized output_exportconf().
* Add startswith/endswith helpersJosh Stone2010-03-111-1/+1
| | | | | Inspired by the Python equivalents, these new utility functions just make it a little cleaner to match at the beginning or end of a string.
* PR11370: Add multi-header @castsJosh Stone2010-03-101-19/+29
| | | | | | | | | | Sometimes you need multiple headers to fully describe a type, so we now permit them to be listed together, e.g. "kernel<foo.h><bar.h>". * buildrun.cxx (make_typequery): Split the input string into a vector. (make_typequery_kmod, make_typequery_umod): Use the vector of headers. * testsuite/semok/cast.stp: Add a multi-header case. * stap.1.in, NEWS: Document it.
* undocumented, obfuscated, *evil* option to suppress -Werror during module ↵Przemysław Pawełczyk2010-02-061-3/+3
| | | | | | | | building * session.h (omit_werror): New flag. * buildrun.cxx (compile_pass): Use it. * main.cxx (main): Set it.
* PR10493: autoconf for cpu_khzWenji Huang2010-01-131-0/+38
| | | | | | * buildrun.cxx (output_cpu_khz): New function to check cpu_khz. (compile_pass): Invoke function output_cpu_khz. * runtime/time.c : Use STAPCONF_CPU_KHZ.
* RHBZ543529: Make implicit -BCONFIG_MODULE_SIG=nFrank Ch. Eigler2009-12-201-0/+3
| | | | * buildrun.cxx (compile_pass): Disable module signing goo.
* PR10601 cont'd, RHEL5 backward compatibility with more runtime/autoconf*Frank Ch. Eigler2009-12-201-0/+2
|
* - Allow root, the owner of the uprobes build directory and the members of theDave Brolley2009-11-251-12/+63
| | | | | | | | | | group owner of the uprobes buld directory to build uprobes.ko. - When building uprobes.ko, make all generated files writable by the group owner of the uprobes build directory. - Don't change the group owner of the uprobes build directory during 'make install'
* Ensure uprobes/Makefile never returns failure due to setting permissions.Dave Brolley2009-11-231-1/+1
| | | | | Ensure uprobes install directory has group 'stap-server'. Rename igid_in to in_group.
* Allow members of the group stap-server to build the uprobes module.Dave Brolley2009-11-201-7/+9
|
* Relax the -Wframe-larger-than checkJosh Stone2009-10-211-1/+3
| | | | | This is just a workaround for PR10821, and should be reverted when that bug is fixed.
* PR10750 cont'd: Build with -Wframe-larger-than=512Josh Stone2009-10-211-0/+3
| | | | | * buildrun.cxx (compile_pass): Add the warning to limit the frame size even lower than the Kbuild default (only works for gcc 4.4+).
* check for module-building Makefile more clearlyFrank Ch. Eigler2009-10-141-6/+5
| | | | | * buildrun.cxx (compile_pass): stat the Makefile, not just the build/ directory.
* 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.