summaryrefslogtreecommitdiffstats
path: root/main.cxx
Commit message (Collapse)AuthorAgeFilesLines
* PR11405: Warn and continue for parsing errors in tapsetsJosh Stone2010-03-201-1/+4
| | | | | | | | | | | | When we start seeing tapsets provided by third parties, any errors in their files should not be fatal to us. Since we don't really know which tapsets are our own, this leniency applies to all. * main.cxx (main): Warn on tapset errors, but continue unless -W. * testsuite/parseko/bad_tapset/foo.stp: New bogus tapset. * testsuite/parseko/bad_tapset.stp: Check that "-W -I bad_tapset" fails. * testsuite/parseok/bad_tapset.stp: Check that "-I bad_tapset" succeeds. * testsuite/parseok/all_tapsets.stp: Check -W with the default tapsets.
* PR909: store kernel exported symbols in session objectFrank Ch. Eigler2010-03-181-3/+36
| | | | | | | * session.h (kernel_exports): New field. * main.cxx (parse_kernel_exports): Fill it. * tapset-perfmon.cxx (perf_builder::build): Check it for our pal perf_event_create_kernel_counter.
* Remove the old performance monitoring code.Will Cohen2010-03-171-1/+0
|
* PR10831: Remember derived "aliases" in the probe chainJosh Stone2010-03-161-4/+25
| | | | | | | | | | | | | SDT and label probes are not really final probe types themselves, but rather they get translated into some other final type. This patch preserves this relationship as if SDT and label probes were dynamically generated aliases. * elaborate.cxx (probe::create_alias): New, fake an alias_derived_probe. * tapsets.cxx (query_label): Append the label name as an alias. (sdt_query::handle_query_module): Let convert_location do the alias. (sdt_query::convert_location): Translate the location using an alias. * main.cxx (printscript): Elaborate the derivation debug dump.
* Add startswith/endswith helpersJosh Stone2010-03-111-7/+4
| | | | | 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.
* PR11246 cont'd: Add options for cache controlJosh Stone2010-03-021-0/+31
| | | | | | | | | | | | | | | | --disable-cache : turn off all caching --clean-cache : clean up stale entries and then quit --poison-cache : force regeneration of items that would have hit the cache These are undocumented for now, until we decide whether they are generally useful. * main.cxx (main): Parse the new options. * session.h (systemtap_session): Add poison_cache; document the others. * clean.cxx (clean_cache): No longer static. (get_stapconf_from_cache, get_script_from_cache): Respect poison. * tapsets.cxx (tracepoint_builder::get_tracequery_module): Ditto. (dwarf_cast_expanding_visitor::filter_special_modules): Ditto.
* PR11246 cont'd: Separate script/stapconf cachingJosh Stone2010-03-021-3/+11
| | | | | | | | | | | I'm separating the caching and creation logic for stapconf, so it can be conditionalized on s.use_cache instead of s.use_script_cache. * session.h (systemtap_session): Store base_hash for better reuse. * hash.cxx (get_base_hash): Get the base from the session, or build it. (find_hash): Split into separate script/stapconf versions. * cache.cxx (add_to_cache, get_from_cache): Ditto. * main.cxx (main): Adapt caller, and delay stapconf until pass-4.
* Move pass-3/4 cache checks after the reported pass-2 endJosh Stone2010-03-021-8/+9
| | | | * main.cxx (main): Reorganize the end of pass-2 a bit.
* PR11246: Add more granular cache controlJosh Stone2010-03-021-7/+8
| | | | | | | | | | | | | | There are some module options that require us to disable caching for the script, but before now this had a global effect. There are some cache objects, like tracepoint and @cast query modules, which we would like to cache even when the script itself needs to be uncached. * session.h (systemtap_session): New use_script_cache flag. * main.cxx (main): -m & -k can just disable the script cache. Failure to create the cache directories still disables all caching. * hash.cxx (create_hashdir): Failure disables all caching. * cache.cxx (add_to_cache): Failure only toggles the script caching. If the stapconf fails though, we don't need to block the .ko reuse.
* PR11229: Make parse_kernel_config return int and suggest that the user check ↵Charley Wang2010-03-011-2/+17
| | | | their installation of kernel devel
* PR11075: -W option to turn warnings into errorsFrank Ch. Eigler2010-02-251-1/+7
| | | | | | | | * session.h * NEWS: Discuss it. * main.cxx: Parse it. * session.h (num_errors): Provide it. * semok/fortyeight.stp, semok/thirtyseven.stp: Test it.
* PR11275: be less verbose in case of command line option parsingFrank Ch. Eigler2010-02-191-18/+23
| | | | | * main.cxx (main): exit() instead of printing usage for most errors. Also support --help.
* PR11281 Allow negative values for -D argument.Mark Wielaard2010-02-141-1/+1
| | | | | | | Change regexp match to "^[a-z_][a-z_0-9]*(=-?[a-z_0-9]+)?$". * main.cxx (main): case 'D' allow optional single minus sign after equal in assert_regexp_match().
* PR11105 part 2a, fix buggy \\. in -r option regexpFrank Ch. Eigler2010-02-121-1/+1
|
* PR11105 part 2: tighten constraints on stap-server parameters passed to makeFrank Ch. Eigler2010-02-121-11/+13
| | | | | | | * util.h, util.cxx (assert_match_regexp): New function. * main.cxx (main): Constrain -R, -r, -a, -D, -S, -q, -B flags. * stap-serverd (listen): Harden stap-server-connect with ulimit/loop. * testsuite/systemtap.server/{client,server}_args.exp: Revised.
* undocumented, obfuscated, *evil* option to suppress -Werror during module ↵Przemysław Pawełczyk2010-02-061-1/+13
| | | | | | | | building * session.h (omit_werror): New flag. * buildrun.cxx (compile_pass): Use it. * main.cxx (main): Set it.
* rhbz 560890: preserve -L/-l variable orderingNobuhiro Tachino2010-02-021-12/+41
| | | | | | Switch to list<string> from set<string> for collecting available $var lists. Use O(N**2) list-uniqueifier that preserves initial ordering.
* PR11105: robustify stap-serverFrank Ch. Eigler2010-01-151-2/+9
| | | | | | | | | | | * main.cxx (main): Always downgrade client-provided -p5 to -p4. * stap-client (unpack_response): Sanitize stdout due to same. * stap-server-connect.c: Eliminate a bunch of globals. (handle_connection): Make things locals instead. Base tmp files on $TMPDIR. (spawn_and_wait): New helper function. (handleRequest): New monster function to inline rest of old stap-server-request.
* Fix rawhide compile problem.David Smith2010-01-141-1/+1
| | | | | * main.cxx (getmemusage): On rawhide systems, 'getpagesize()' has been deprecated. Substitute 'sysconf(_SC_PAGESIZE)'.
* tweak stap argument checkingFrank Ch. Eigler2010-01-121-38/+22
| | | | * main.cxx (checkOptions): Inline into main(), abeam other option checks.
* Rework filtering of client options. Add testsuite.Dave Brolley2010-01-111-59/+27
|
* Filter options for unprivileged use after --stap-client is seen.Dave Brolley2010-01-111-1/+58
|
* Accept relative user module paths for -d.Mark Wielaard2009-11-131-5/+13
| | | | | | | | | | | | When using relative (non-canonical) paths for user modules one would get a confusing WARNING: missing unwind/symbol data for module 'bin/test'. Also unless the path started with '/' the task_finder wouldn't start. By checking that the given file can be made absolute (canonicalized) both issues are resolved and the user module will be correctly identified at both translation and runtime. * main.cxx (main): case 'd' try canonicalize_file_name() the argument first to identify user modules.
* PR10466: print the set-intersection of variables retrieved from each branchWenji Huang2009-11-041-11/+35
| | | | | | | * elaborate.h: Remove printargs and add getargs. * tapset-mark.cxx (mark_derived_probe): Ditto. * tapsets.cxx (dwarf_derived_probe,tracepoint_derived_probe): Ditto. * main.cxx (printscript): Make intersection before printing.
* 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".