summaryrefslogtreecommitdiffstats
path: root/hash.cxx
Commit message (Collapse)AuthorAgeFilesLines
* PR11246 cont'd: Separate script/stapconf cachingJosh Stone2010-03-021-22/+18
| | | | | | | | | | | 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.
* PR11246: Add more granular cache controlJosh Stone2010-03-021-1/+1
| | | | | | | | | | | | | | 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.
* hashing: add in the -Werror-defeating flagFrank Ch. Eigler2010-02-221-0/+1
|
* PR9931: generate log to help diagnosing occasional cache hash collisionsWenji Huang2010-02-031-0/+33
| | | | | | | | | | | | | | | | | Ideas from Frank Ch. Eigler: - extending the hash.add() function to pass names along with the hash-mix values, so that class hash can internally track the hash-report string - storing the reports themselves in the cache, beside the .ko / .c files, and changing the cache-size-limit logic to delete these .txt files upon garbage collection * hash.h : New member parm_stream. * hash.cxx (get_parms): New function to convert parms stream to string. (hash::add): Aggregrate parms stream. (create_hash_log): New function to log hash operation. (find_*_hash): Log hash at the end of function. * cache.cxx (clean_cache): Remove log when cache reaches limitation.
* Try to build tracequery for all headers at onceJosh Stone2009-09-281-3/+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.
* Add --unprivileged to the module hashJosh Stone2009-09-031-0/+1
| | | | * hash.cxx (find_script_hash): Add s.unprivileged.
* PR10552: Removed references to the merge ('-M') option.David Smith2009-09-011-1/+0
| | | | | | | | | | | * 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.
* PR10581: Use ARCH for tracepoints and kernel typequeriesJosh Stone2009-09-011-1/+13
| | | | | | | | | | | | 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: cross-architecture probe buildingFrank Ch. Eigler2009-08-241-0/+3
| | | | | | | | | | | * 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.
* PR10424: Consider each tracepoint header separatelyJosh Stone2009-07-201-2/+3
| | | | | | | | | | | | | | | | 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.
* Make sure that non-existent files still affect hashingJosh Stone2009-07-201-6/+6
| | | | | | | The fact that a file _doesn't_ exist is significant, so adding such a file to a computed hash should still influence the output. * hash.cxx (hash::add_file): add bogus stat info for non-existent files
* Return hash module values directly as stringsJosh Stone2009-07-201-7/+7
| | | | | | | | * session.h (systemtap_session): remove tracequery_path * hash.cxx (find_tracequery_hash, find_typequery_hash): return strings * tapsets.cxx (dwarf_cast_expanding_visitor::filter_special_modules): get the hashed path from the return value instead of a parameter (tracepoint_builder::init_dw): ditto, and don't stuff it in session
* Remove -O[0123s] gcc optimization flags for gcc pass 4 speedups again.Mark Wielaard2009-07-141-1/+0
| | | | | | | | | | | | | 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].
* Add -O[0123s] gcc optimization flags for gcc pass 4 speedup.Mark Wielaard2009-07-111-0/+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].
* Add a function to hash typequery modulesJosh Stone2009-04-201-0/+20
|
* PR10019: --skip-badvars to suppress run-time memory errors tooFrank Ch. Eigler2009-04-011-0/+1
| | | | | | | | * NEWS: Note this change. * hash.cxx (find_script_hash): Add s.skip_badvars into hash. * translate.cxx (translate_pass): Emit STP_SKIP_BADVARS. * runtime/loc2c-runtime.h (DEREF_FAULT, STORE_DEREF_FAULT): Provide dummy implementation if STP_SKIP_BADVARS.
* Skip the git-rev in the hash for now (from a5e8d632)Josh Stone2009-03-261-1/+4
| | | | | | It may be potentially expensive to fork-exec a git call to get the HEAD revision, and it's not clear whether it's even needed. We can always throw this back on if we find a meaningful usage scenario.
* Add the kernel tree's git revision to the hashJosh Stone2009-03-251-0/+4
| | | | | To better support kernel developers who work out of a single source tree, this adds the git HEAD revision to our caching hash.
* Add more file stats to the hashJosh Stone2009-03-251-14/+24
| | | | | | | | | | For kernel developers, it may be common practice to reuse the same kernel build tree for several kernel variants. Our previous hashing only considered the release version, architecture, and build path, which may all remain constant for such a developer. This change adds the file size and mtime of several kernel version files to the hash, so it should be a bit more robust against collisions.
* Cache the tracepoint query resultsJosh Stone2009-03-201-0/+18
| | | | | | | To use tracepoints, we build a "tracequery" module that compiles debuginfo for all available tracepoints in the user's kernel. That's a bit of a cumbersome step to do during pass-2 though. This change adds tracequery caching so we only need to compile it once.
* Clean up the autoconf cachingJosh Stone2009-02-071-1/+2
| | | | | | | | | | | | | | | | | 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-55/+99
| | | | | | | | | | 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
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+2
|
* PR5892: rename new -B /PATH to -r /PATH; merge functionalityFrank Ch. Eigler2008-12-031-0/+1
|
* buildrun/caching warning cleanupFrank Ch. Eigler2008-11-291-3/+4
|
* Merge commit 'origin/master' into pr4225Frank Ch. Eigler2008-08-281-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'origin/master': PR5686: correct regression in semok/optimize.stp trailing whitespace removal, as approved by emacs fix global-var array index rendering fix NEWS to refer to simpler context.stp tapset functions in auto-printing blurb Document written but unread global variable automatic display. 2nd try initial Make _get_sock_addr return correct address in kernel before 2.6.16. Automatically print written but unread globals Make nodwf test passed when CONFIG_QUOTACTL unset Uses STAPCONF_DPATH_PATH instead of a kernel version check. Simplified "rpm" target a bit. Moved tar archive creation step from "rpm" target to "dist-gzip" target. remove support for "make dist" since git-archive does as well; Examples html files moved into subdir. 2008-08-25 David Smith <dsmith@redhat.com> ChangeLog Entries Robustness improvements for the stap client/server
| * trailing whitespace removal, as approved by emacsFrank Ch. Eigler2008-08-281-3/+3
| | | | | | | | (add-hook 'before-save-hook 'delete-trailing-whitespace)
* | prep find_executable() for use by process() probesFrank Ch. Eigler2008-08-091-9/+7
|/
* ensure module caching does not ignore possibly changing -d MODULE optionsFrank Ch. Eigler2008-07-111-2/+9
|
* PR 4311 - Function boundary tracing without debuginfo: Phase IJim Keniston2008-04-181-0/+15
| | | | | | | | | | | * tapsets.cxx: Major rework of dwflpp, dwarf_query, and related code to make do with elf info if dwarf info is absent, or (in the case of vmlinux) make do with a System.map-style symbol table if even the elf file is absent. * main.cxx: Use getopt_long instead of getopt. Added --kelf, --kmap, --ignore-vmlinux, and --ignore-dwarf. * hash.cxx, session.h, stap.1.in: Added --kelf, --kmap, --ignore-vmlinux, and --ignore-dwarf.
* 2007-08-14 David Smith <dsmith@redhat.com>dsmith2007-08-141-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge from setuid-branch. Changes also by Martin Hunt <hunt@redhat.com>. * Makefile.am: Added staprun_funcs.c and cap.c to staprun_SOURCES. Added -lcap to staprun_LDADD. Removed stp_check reference. Added stapio program. Staprun is now setuid. * Makefile.in: Rebuilt. * configure.ac: Version increase to 0.6 and checks for libcap availability. Removed stp_check reference. * configure: Regenerated. * stp_check.in: Removed. * systemtap.spec.in: Version increase to 0.6-1 and added BuildReq for libcap-devl (and removed sudo requirement). Added %pre script to create new groups. Staprun is now setuid. * NEWS: Added info on new security model. * INTERNALS: Removed sudo reference. * README.security: New file. * main.cxx (main): Make sure module name isn't too long. * hash.cxx: Moved MODULE_NAME_LEN define to hash.h. * hash.h: Moved MODULE_NAME_LEN define here from hash.cxx. * buildrun.cxx (run_pass): No longer runs staprun with "sudo". * stap.1.in: Removed sudo references and added information about the stapdev/stapusr groups. * staprun.8.in: Added information about module detaching and attaching. Removed sudo references and added information about the stapdev/stapusr groups. Removed reference to staprun needing to be run as root. Removed reference to removed '-u USERNAME' option. * .cvsignore: Removed stp_check and added stapio and stap_merge.
* 2007-04-04 Frank Ch. Eigler <fche@elastic.org>fche2007-04-041-0/+2
| | | | | | GCC 4.3 compatibility patches from Debian. * buildrun.cxx, hash.cxx, tapsets.cxx, translate.cxx: #include a few more C++ headers.
* 2007-02-09 Frank Ch. Eigler <fche@elastic.org>fche2007-02-091-1/+2
| | | | | | | | | | | | | | | | PR 3965 * configure.ac: Add --enable-prologue option. * configure, config.in: Regenerated. * session.h (prologue_searching): New field. * main.cxx (main): Parse new "-P" option. Initialize based on autoconf flag. * stap.1.in, NEWS: Document it. * hash.cxx (find_hash): Include it in computation. * tapsets.cxx (query_func_info, query_cu): Respect it. 2007-02-09 Frank Ch. Eigler <fche@elastic.org> * systemtap.base/prologue.*: New test case.
* 2006-12-21 David Smith <dsmith@redhat.com>dsmith2006-12-211-1/+3
| | | | | | * hash.cxx (find_hash): Added two more options into the hash that change the generated C file - '-M' (merge) and '-t' (benchmark timing).
* 2006-12-11 David Smith <dsmith@redhat.com>dsmith2006-12-111-0/+1
| | | | | | * hash.cxx (find_hash): Fixed a caching bug. Bulk mode (relayfs) status should be figured into the hash since it changes the generated C code.
* 2006-10-23 David Smith <dsmith@redhat.com>dsmith2006-10-231-0/+168
* main.cxx (printscript): New function containing code moved from main(). (main): Added code to create cache directory, call function to generate hash, and see if we can use cached source/module. If pass 4 is actually run to produce a new module, we call add_to_cache() to cache the result. * session.h (struct systemtap_session): Added hash/cache session data. * cache.cxx: New file handling adding/getting files from the cache. * cache.h: New header file for cache.cxx. * hash.cxx: New file containing C++ wrapper for routines in mdfour.c and the find_hash function which computes the hash file name for an input script. * hash.h: New header file for hash.cxx. * mdfour.c: New file containing MD4 hash code. * mdfour.h: New header file for mdfour.c. * util.cxx: New file containing several utility functions used by the caching code. * util.h: New header file for util.cxx. * Makefile.am: Added new C/C++ files. * Makefile.in: Regenerated.