summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/esan/working_set.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove esan.Nico Weber2019-03-111-279/+0
| | | | | | | | | | | It hasn't seen active development in years, and it hasn't reached a state where it was useful. Remove the code until someone is interested in working on it again. Differential Revision: https://reviews.llvm.org/D59133 llvm-svn: 355862
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Refactor MemoryMappingLayout::Next to use a single struct instead of output ↵Francis Ricci2017-07-111-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | parameters. NFC. Summary: This is the first in a series of patches to refactor sanitizer_procmaps to allow MachO section information to be exposed on darwin. In addition, grouping all segment information in a single struct is cleaner than passing it through a large set of output parameters, and avoids the need for annotations of NULL parameters for unneeded information. The filename string is optional and must be managed and supplied by the calling function. This is to allow the MemoryMappedSegment struct to be stored on the stack without causing overly large stack sizes. Reviewers: alekseyshl, kubamracek, glider Subscribers: emaste, llvm-commits Differential Revision: https://reviews.llvm.org/D35135 llvm-svn: 307688
* [esan|wset] Fix flaky sampling testsDerek Bruening2016-07-191-0/+5
| | | | | | | Adds a new esan public interface routine __esan_get_sample_count() and uses it to ensure that tests of sampling receive the minimum number of samples. llvm-svn: 275948
* [esan] Add __esan_report for mid-run dataDerek Bruening2016-07-091-5/+21
| | | | | | | | | | | | | | | | | | | | | Summary: Adds a new public interface routine __esan_report() which can be used to request profiling results prior to abnormal termination (e.g., for a server process killed by its parent where the normal exit does not allow for normal result reporting). Implements this for the working-set tool. The cache frag tool is left unimplemented as it requires missing iteration capabilities. Adds a new test. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D22098 llvm-svn: 274964
* [sanitizer][esan] Add internal_sigaction_syscallDerek Bruening2016-06-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 llvm-svn: 272676
* Revert r272591, http://lab.llvm.org:8011/builders/clang-x64-ninja-win7 has ↵Nico Weber2016-06-141-4/+1
| | | | | | been broken since this landed. llvm-svn: 272659
* [sanitizer][esan] Add internal_sigaction_syscallDerek Bruening2016-06-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 llvm-svn: 272591
* Revert "[sanitizer][esan] Add internal_sigaction_syscall"Derek Bruening2016-06-131-4/+1
| | | | | | | | This reverts commit r272553. The iOS build fails to link. llvm-svn: 272557
* [sanitizer][esan] Add internal_sigaction_syscallDerek Bruening2016-06-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: Adds a version of sigaction that uses a raw system call, to avoid circular dependencies and support calling sigaction prior to setting up interceptors. The new sigaction relies on an assembly sigreturn routine for its restorer, which is Linux x86_64-only for now. Uses the new sigaction to initialize the working set tool's shadow fault handler prior to libc interceptor being set up. This is required to support instrumentation invoked during interceptor setup, which happens with an instrumented tcmalloc or other allocator compiled with esan. Adds a test that emulates an instrumented allocator. Reviewers: aizatsky Subscribers: vitalybuka, tberghammer, zhaoqin, danalbert, kcc, srhines, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D21083 llvm-svn: 272553
* [esan|wset] Add 8-level working set snapshot accumulationDerek Bruening2016-06-031-12/+85
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds a new option -snapshot_step controlling the frequency distribution for an 8-level series of samples using each bit of each shadow byte. Implements accumulation from each level to the next higher level at the specified frequency. Adds storage of the 8 series of samples using CircularBuffer instances. Fixes an error in the circular buffer data structure where a static object's destructor will be called too early. Prints the results out at the end in a simple manner to give us something to start with. Updates the workingset-samples test to test the new feature. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20833 llvm-svn: 271683
* [esan] Add sideline itimer supportDerek Bruening2016-06-031-0/+23
| | | | | | | | | | | | | | | | | | | | | Summary: Adds support for creating a separate thread for performing "sideline" actions on a periodic basis via an itimer. A new class SidelineThread implements this feature, exposing a sampling callback to the caller. Adds initial usage of sideline sampling to the working set tool. For now it simply prints the usage at each snapshot at verbosity level 1. Adds a test of this behavior. Adds a new option -record_snapshots to control whether we sample and a new option -sample_freq to control the periodicity of the sampling. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20751 llvm-svn: 271682
* [esan|wset] Iterate all memory to compute the total working setDerek Bruening2016-05-311-5/+73
| | | | | | | | | | | | | | | | | | | | | Summary: Adds iteration of all application memory in an efficient manner using shadow faults. Shadow memory starts out inaccessible and we mark it writable one page at a time on each fault when the instrumentation touches it. This allows iteration over just the mapped shadow memory, saving significant time. Adds a process-end iteration and pretty-printing of the final result. Adds a new test and updates the existing tests. Reviewers: aizatsky, filcab Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20578 llvm-svn: 271277
* [esan] Intercept and chain signal handlersDerek Bruening2016-05-311-0/+1
| | | | | | | | | | | | | | | | | | Summary: In preparation for fault-based shadow memory iteration, we add support for our own signal handler by adding app signal handler interception as well as chaining for SIGSEGV. This is done in a simple manner: we do not honor the app's alternate stack nor any sigaction flags for SIGSEGV. Adds a new test of transparency in app signal handling. Reviewers: aizatsky Subscribers: filcab, kubabrecka, vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D20577 llvm-svn: 271272
* Add working set base runtime libraryDerek Bruening2016-05-251-0/+90
Summary: Adds the base runtime library for the working set tool. Adds slowpath code for updating the shadow memory. To be added in the future: + Scan memory and report the total size. + Take samples for intermediate values. Reviewers: aizatsky Subscribers: kubabrecka, vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D20485 llvm-svn: 270650
OpenPOWER on IntegriCloud