tools/profiler/LulDwarfSummariser.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef LulDwarfSummariser_h
     8 #define LulDwarfSummariser_h
    10 #include "LulMainInt.h"
    12 namespace lul {
    14 class Summariser
    15 {
    16 public:
    17   Summariser(SecMap* aSecMap, uintptr_t aTextBias, void(*aLog)(const char*));
    19   void Entry(uintptr_t aAddress, uintptr_t aLength);
    20   void End();
    21   void Rule(uintptr_t aAddress,
    22             int aNewReg, int aOldReg, intptr_t aOffset, bool aDeref);
    24 private:
    25   // The SecMap in which we park the finished summaries (RuleSets).
    26   SecMap* mSecMap;
    28   // Running state for the current summary (RuleSet) under construction.
    29   RuleSet mCurrRules;
    31   // The start of the address range to which the RuleSet under
    32   // construction applies.
    33   uintptr_t mCurrAddr;
    35   // The highest address, plus one, for which the RuleSet under
    36   // construction could possibly apply.  If there are no further
    37   // incoming events then mCurrRules will eventually be emitted
    38   // as-is, for the range mCurrAddr.. mMax1Addr - 1, if that is
    39   // nonempty.
    40   uintptr_t mMax1Addr;
    42   // The bias value (to add to the SVMAs, to get AVMAs) to be used
    43   // when adding entries into mSecMap.
    44   uintptr_t mTextBias;
    46   // A logging sink, for debugging.
    47   void (*mLog)(const char* aFmt);
    48 };
    50 } // namespace lul
    52 #endif // LulDwarfSummariser_h

mercurial