summaryrefslogtreecommitdiffstats
path: root/main.cxx
Commit message (Collapse)AuthorAgeFilesLines
* PR10702: preprocessor conditional for kernel CONFIG_fooFrank Ch. Eigler2009-10-081-3/+29
| | | | | | | | * session.h (kernel_config[]): New session field. * main.cxx (parse_kernel_config): Populate it. * parse.cxx (eval_comparison): Use it. * testsuite/buildok/utrace.stp, testsuite/parseok/kconfig.stp: New tests. * NEWS, stap.1.in, doc/langref.tex: Mention it.
* Print total memory usage in verbose mode after pass 1, 2 and 3.Mark Wielaard2009-10-011-6/+35
| | | | | | | Makes it easier to see which probe queries use lots of memory. * main.cxx (getmemusage): New function. (main): Use new function printing passes in verbose mode.
* Simplify copy_file callsJosh Stone2009-09-281-8/+2
| | | | | | | | | | | | | | Every single copy_file call we had was converting strings to char*, printing the same error message, and optionally printing the same verbose string. Let's canonicalize that. * util.cxx (copy_file): Take string filenames, add a verbose flag, and consolidate the message printing. * cache.cxx (add_to_cache): Pass strings and remove message printing. (get_from_cache): Ditto. * main.cxx (main): Ditto. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto. (dwarf_cast_expanding_visitor::filter_special_modules): Ditto.
* Check for unprivileged options conflicts on the server side.Dave Brolley2009-09-171-41/+5
| | | | Gneral work on options in the client and server.
* 2009-09-14 Dave Brolley <brolley@redhat.com>Dave Brolley2009-09-141-17/+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-2/+2
| | | | | | | | | | | | | | | 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.
* PR10552: Removed references to the merge ('-M') option.David Smith2009-09-011-18/+1
| | | | | | | | | | | * hash.cxx (find_script_hash): Removed unused merge option. * main.cxx (checkOptions): Removed merge option checks. (main): Removed merge option. * session.h: Ditto. * initscript/README.initscript: Removed reference to '-M' option. * initscript/systemtap.in (stap_getopt): Ditto. * testsuite/parseko/cmdline01.stp: Removed merge option test. * testsuite/parseko/cmdline05.stp: Ditto.
* PR4186 cont'd: option #2: standardize on kernel ARCH/SUBARCH throughoutFrank Ch. Eigler2009-08-251-7/+20
| | | | | | | | * main.cxx (main): Perform equivalent sed by hand on uname()->machine. * stap.1.in: Clarify -a ARCH slightly. * tapsets.cxx (validate_module_elf): Accept "arm*"for EM_ARM. * tapset/**, testsuite/**: Removed/collapsed "i386"/"i686" branches, renamed "ppc64"->"powerpc" and "s390x"->"s390".
* PR4186 cont'd: fix 32-bit i386 buildsFrank Ch. Eigler2009-08-241-0/+5
| | | | | * main.cxx (main): Initialize s.architecture to value as if from `uname -i`. Specifically, squash i?86 -> i386.
* PR4186: cross-architecture probe buildingFrank Ch. Eigler2009-08-241-2/+12
| | | | | | | | | | | * 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.
* PR10543: do module cache cleaning before copying new file into the cacheFrank Ch. Eigler2009-08-211-1/+1
| | | | | | ... otherwise the new stuff can get cleaned before use. * cache.cxx (add_to_cache): Do clean_cache() first, not last.
* PR10544: clean up stap child process error handlingFrank Ch. Eigler2009-08-211-4/+2
| | | | | | | * util.cxx (stap_system): Take extra verbosity value. Standardize error handling / tracing. * util.h: Corresponding changes. * buildrun.cxx, main.cxx, modsign.cxx: Update callers.
* PR10228: use task_finder_vma for -d /user/object files.Frank Ch. Eigler2009-08-141-0/+5
| | | | | | | | | | | | * main.cxx (main): For "-d /path" arguments, enable task finder. * runtime/sym.h (_stp_module): Add *vmcb member. * task_finder{.cxx,.h} (emit_vma_callback_probe_decl): Zap. * tapset-itrace.cxx, tapset-utrace.cxx: Use unwindsyms_modules instead. * tapsets.cxx (uprobe::emit_module_decls): Ditto. * translate.cxx (emit_module_init): Emit task finder registrations for vmcb's associated with _stp_modules. (dump_unwindsyms): Associate vmcbs with user-space unwindsyms entries.
* Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-08-041-10/+39
|\ | | | | | | | | | | Conflicts: cache.cxx
| * PR10204: Place userspace markers in systemtap itselfKent Sebastian2009-07-311-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | * cache.cxx (add_to_cache,clean_cache): add static markers * main.cxx (main): likewise * runtime/staprun/common.c (send_request): likewise * runtime/staprun/mainloop.c (stp_main_loop): likewise * runtime/staprun/staprun.c (remove_module): likewise * runtime/staprun/staprun.h: include sdt.h * runtime/staprun/staprun_funcs.c (insert_module): likewise * util.cxx (stap_system): likewise * tapset/stap_staticmarkers.stp: new file
| * Use a real session flag for -LJosh Stone2009-07-291-10/+13
| | | | | | | | | | | | | | | | | | Rather than relying on 'unoptimized' to tell us that the listing mode should print the variables too, this adds an explicit listing_mode_vars. * session.h (systemtap_session): Add listing_mode_vars * main.cxx (main): Set s.listing_mode_vars appropriately. (printscript): Use the new flag for deciding whether to print locals
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-07-141-27/+1
|\| | | | | | | | | | | Conflicts: main.cxx
| * Remove -O[0123s] gcc optimization flags for gcc pass 4 speedups again.Mark Wielaard2009-07-141-26/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | * 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/+27
|\| | | | | | | | | | | Conflicts: main.cxx
| * Add -O[0123s] gcc optimization flags for gcc pass 4 speedup.Mark Wielaard2009-07-111-1/+26
| | | | | | | | | | | | | | | | | | | | * 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].
* | Check for options conflicts with --unprivileged.Dave Brolley2009-06-181-32/+87
| |
* | Ensure signature file exists before copying it to the temp directory.Dave Brolley2009-06-151-8/+11
| |
* | Respect SYSTEMTAP_DIR when looking for nss certificate databases.Dave Brolley2009-06-101-8/+8
| |
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-05-271-0/+4
|\|
| * Suggest rpms to install using debuginfo-install.William Cohen2009-05-271-0/+4
| | | | | | | | | | | | | | | | | | The patch makes use of the RPM libraries to determine which rpm supplied the executable and from that information suggest a command to install the appropriate debuginfo rpm. This is enabled using the "--with-rpm" option for configure. Can be explicitly disabled with "--without-rpm".
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-05-191-5/+11
|\|
| * Enhance -x option checking to only accept valid pidSunzen Wang2009-05-191-1/+6
| | | | | | | | Fix: Enhance -x option checking to only accept valid pid
| * Enhance -s option checking to only accept valid size numberSunzen Wang2009-05-191-2/+2
| | | | | | | | Fix: Enhance -s option checking to only accept valid size number
| * Fix: Enhance -p option checking so as to just accept valid numberSunzen Wang2009-05-191-2/+3
| |
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-05-051-0/+8
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: modsign.cxx runtime/staprun/modverify.c runtime/staprun/staprun_funcs.c stap-authorize-server-cert stap-authorize-signing-cert stap-serverd systemtap.spec
| * Module signing and verification using a separate file for the module signature.Dave Brolley2009-05-041-0/+22
| |
* | 2009-04-30 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-301-43/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | * modsign.cxx (unistd.h,sts/stat.h,systypes.h,pwd.h): #include them. (check_cert_file_permissions, check_db_file_permissions) (check_cert_db_permissions): New functions. (check_cert_db_path): Don't check for keyFiles. * main.cxx (usage): Remove --signing-cert option. (main): Likewise. * cache.cxx (cassert): #include it. (add_to_cache): Assume the module is signed. * buildrun.cxx (compile_pass): Always sign the module. * stap-server.8.in: Update documentation.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-04-271-50/+30
|\| | | | | | | | | | | | | Conflicts: configure testsuite/configure
| * PR10082: refactor duplicated codeKent Sebastian2009-04-241-50/+30
| |
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-04-231-2/+1
|\| | | | | | | | | | | Conflicts: Makefile.in
| * PR 9821: Use genuine strftime in staprun/stapioMasami Hiramatsu2009-04-221-2/+1
| | | | | | | | | | | | | | | | | | | | * Makefile.am: Add -fno-builtin-strftime to stapio_CFLAGS. * Makefile.in: Ditto. * runtime/staprun/common.c (stap_strfloctime): Use strftime(3). (parse_args): Remove strftime format limitation message. * main.cxx (usage): Ditto. * stap.1.in: Ditto. * staprun.8.in: Ditto.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-04-211-0/+30
|\| | | | | | | | | | | | | Conflicts: aclocal.m4 configure
| * PR10082: add environment variable to pass -r RELEASE/PATH optionKent Sebastian2009-04-171-0/+30
| |
* | 2009-04-20 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | * main.cxx (main): Turn of guru_mode if --unprivileged is specified and vice-versa. * elaborate.h (unprivileged_whitelist): New member of match_node. * elaborate.cxx (match_node::match_node): Initialize unprivileged_whitelist. (match_node::find_and_build): In --unprivileged mode, throw a semantic_error for probe components which are not in uinprivileged_whitelist.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-04-021-73/+4
|\| | | | | | | | | | | Conflicts: configure
| * PR10016: Purge stap of all pgrp and system() usageJosh Stone2009-04-011-73/+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.
* | 2009-04-02 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-021-22/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stap-serverd (initialization): Create client certificate database if it does not exist. * stap-server (call_stap): Don't pass --sign-module to stap. * session.h (unprivileged): New member of systemtap_session. * modsign.cxx (init_cert_db_path, check_cert_db_path): New functions. (sign_module): Call check_cert_db_path. * main.cxx (usage): Document --signing-cert and --unprivileged. (runner): Set default signing certificate path. Initialize s.unprivileged. (LONG_OPT_SIGN_MODULE): Renamed to LONG_OPT_SIGNING_CERT. (LONG_OPT_UNPRIVILEGED): #define it. (long_options): Add --signing-cert and --unprivileged. (runner): Allow multiple --signing-cert options. Use the last specified. Don't reset unless the new setting is valid. Handle LONG_OPT_UNPRIVILEGED.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-03-311-0/+64
|\|
| * PR10016: Run stap in its own process group with waiter process for signals.Mark Wielaard2009-03-311-2/+56
| | | | | | | | | | | | | | * main.cxx (runner): New main function. (waiter_handler): Signal handler for waiter process. (waiter): Waiter process waitpid function. (main): Fork and run wait and runner in their own processes.
| * PR10016: systemtap kills all processes in process group on signal.Mark Wielaard2009-03-301-0/+10
| | | | | | | | * main.cxx (main): Make sure we run in our own process group.
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-03-301-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: aclocal.m4 configure testsuite/aclocal.m4 Also: 2009-03-30 Dave Brolley <brolley@redhat.com> * nsscommon.c (nssError): Handle SEC_ERROR_BAD_SIGNATURE. 2009-03-30 Dave Brolley <brolley@redhat.com> * modverify.c (verify_it): Print a message if the module may have been tampered with.
| * initialize skip_badvars=0. rererenag developers in session.h to do so in ↵Frank Ch. Eigler2009-03-271-0/+1
| | | | | | | | the future
* | Merge branch 'master' of git://sources.redhat.com/git/systemtapDave Brolley2009-03-231-3/+11
|\|
| * PR9821: staprun supports subset of strftime.Masami Hiramatsu2009-03-201-1/+3
| | | | | | | | | | Add strftime subset format support for output file name to systemtap. This format will be evaluated when opening a new output file.