summaryrefslogtreecommitdiffstats
path: root/hash.h
Commit message (Collapse)AuthorAgeFilesLines
* PR11246 cont'd: Separate script/stapconf cachingJosh Stone2010-03-021-1/+2
| | | | | | | | | | | 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.
* PR11282: Keep the md4 state in the hash copy constructorJosh Stone2010-02-161-1/+1
| | | | | | | | We were getting new hash collisions, because the new hash copy constructor was restarting the md4 computation. Everything from get_base_hash was thus lost. * hash.h (hash::hash): Keep the md4 state when copying.
* PR9931: generate log to help diagnosing occasional cache hash collisionsWenji Huang2010-02-031-0/+5
| | | | | | | | | | | | | | | | | 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-1/+3
| | | | | | | | | | | | | | | | | | | | | | 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.
* PR10424: Consider each tracepoint header separatelyJosh Stone2009-07-201-1/+1
| | | | | | | | | | | | | | | | 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.
* Return hash module values directly as stringsJosh Stone2009-07-201-3/+2
| | | | | | | | * 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
* Add a function to hash typequery modulesJosh Stone2009-04-201-0/+2
|
* Add more file stats to the hashJosh Stone2009-03-251-0/+1
| | | | | | | | | | 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/+1
| | | | | | | 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.
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+2
|
* 2007-08-14 David Smith <dsmith@redhat.com>dsmith2007-08-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 2006-10-23 David Smith <dsmith@redhat.com>dsmith2006-10-231-0/+34
* 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.