2016-05-25 10:04:04 +08:00
|
|
|
//===-- working_set.h -------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of EfficiencySanitizer, a family of performance tuners.
|
|
|
|
//
|
|
|
|
// Header for working-set-specific code.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef WORKING_SET_H
|
|
|
|
#define WORKING_SET_H
|
|
|
|
|
|
|
|
#include "interception/interception.h"
|
|
|
|
#include "sanitizer_common/sanitizer_internal_defs.h"
|
|
|
|
|
|
|
|
namespace __esan {
|
|
|
|
|
|
|
|
void initializeWorkingSet();
|
[sanitizer][esan] Add internal_sigaction_syscall
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
2016-06-14 23:15:38 +08:00
|
|
|
void initializeShadowWorkingSet();
|
2016-05-25 10:04:04 +08:00
|
|
|
int finalizeWorkingSet();
|
2016-07-09 12:13:25 +08:00
|
|
|
void reportWorkingSet();
|
2016-07-19 13:06:48 +08:00
|
|
|
unsigned int getSampleCountWorkingSet();
|
2016-05-25 10:04:04 +08:00
|
|
|
void processRangeAccessWorkingSet(uptr PC, uptr Addr, SIZE_T Size,
|
|
|
|
bool IsWrite);
|
|
|
|
|
2016-05-31 21:21:03 +08:00
|
|
|
// Platform-dependent.
|
|
|
|
void registerMemoryFaultHandler();
|
|
|
|
bool processWorkingSetSignal(int SigNum, void (*Handler)(int),
|
|
|
|
void (**Result)(int));
|
|
|
|
bool processWorkingSetSigaction(int SigNum, const void *Act, void *OldAct);
|
2016-07-07 05:04:48 +08:00
|
|
|
bool processWorkingSetSigprocmask(int How, void *Set, void *OldSet);
|
2016-05-31 21:21:03 +08:00
|
|
|
|
2016-05-25 10:04:04 +08:00
|
|
|
} // namespace __esan
|
|
|
|
|
|
|
|
#endif // WORKING_SET_H
|