Coverage for /Syzygy/simulate/simulator.h

CoverageLines executed / instrumented / missingexe / inst / missLanguageGroup
0.0%0035.C++source

Line-by-line coverage:

   1    :  // Copyright 2012 Google Inc. All Rights Reserved.
   2    :  //
   3    :  // Licensed under the Apache License, Version 2.0 (the "License");
   4    :  // you may not use this file except in compliance with the License.
   5    :  // You may obtain a copy of the License at
   6    :  //
   7    :  //     http://www.apache.org/licenses/LICENSE-2.0
   8    :  //
   9    :  // Unless required by applicable law or agreed to in writing, software
  10    :  // distributed under the License is distributed on an "AS IS" BASIS,
  11    :  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12    :  // See the License for the specific language governing permissions and
  13    :  // limitations under the License.
  14    :  //
  15    :  // This defines the virtual simulator class, which analyzes trace files from
  16    :  // the execution of an instrumented dll, and calls the respective events
  17    :  // from a subclass of SimulatorEventHandler.
  18    :  
  19    :  #ifndef SYZYGY_SIMULATE_SIMULATOR_H_
  20    :  #define SYZYGY_SIMULATE_SIMULATOR_H_
  21    :  
  22    :  #include "syzygy/playback/playback.h"
  23    :  #include "syzygy/simulate/simulation_event_handler.h"
  24    :  #include "syzygy/trace/parse/parser.h"
  25    :  
  26  m :  namespace simulate {
  27    :  
  28    :  // This class consumes a set of call-trace logs and reports the number of
  29    :  // pagefaults on them.
  30  m :  class Simulator : public trace::parser::ParseEventHandlerImpl {
  31  m :   public:
  32  m :    typedef playback::Playback Playback;
  33  m :    typedef Playback::TraceFileList TraceFileList;
  34    :  
  35    :    // Construct a new Simulator instance.
  36    :    // @param module_path The path of the module dll.
  37    :    // @param instrumented_path The path of the instrumented dll.
  38    :    // @param trace_files A list of trace files to analyze.
  39    :    // @param simulation The simulation where the events will be fed.
  40  m :    Simulator(const base::FilePath& module_path,
  41  m :              const base::FilePath& instrumented_path,
  42  m :              const TraceFileList& trace_files,
  43  m :              SimulationEventHandler* simulation);
  44    :  
  45    :    // Decomposes the image, parses the trace files and captures
  46    :    // the pagefaults on them.
  47    :    // @returns true on success, false on failure.
  48  m :    bool ParseTraceFiles();
  49    :  
  50  m :   protected:
  51  m :    typedef block_graph::BlockGraph BlockGraph;
  52  m :    typedef pe::PEFile PEFile;
  53  m :    typedef pe::ImageLayout ImageLayout;
  54  m :    typedef trace::parser::Parser Parser;
  55    :  
  56    :    // @name ParseEventHandler overrides.
  57    :    // @{
  58  m :    virtual void OnProcessStarted(
  59  m :        base::Time time, DWORD process_id,
  60  m :        const TraceSystemInfo* data) OVERRIDE;
  61  m :    virtual void OnFunctionEntry(
  62  m :        base::Time time, DWORD process_id, DWORD thread_id,
  63  m :        const TraceEnterExitEventData* data) OVERRIDE;
  64  m :    virtual void OnBatchFunctionEntry(
  65  m :        base::Time time, DWORD process_id, DWORD thread_id,
  66  m :        const TraceBatchEnterData* data) OVERRIDE;
  67    :    // @}
  68    :  
  69    :    // The input files.
  70  m :    base::FilePath module_path_;
  71  m :    base::FilePath instrumented_path_;
  72  m :    TraceFileList trace_files_;
  73    :  
  74    :    // The PE file and Image layout to be passed to playback_.
  75  m :    BlockGraph block_graph_;
  76  m :    PEFile pe_file_;
  77  m :    ImageLayout image_layout_;
  78    :  
  79    :    // A Playback, which would decompose the given image and call the On...
  80    :    // functions on this Simulator.
  81  m :    scoped_ptr<Playback> playback_;
  82    :  
  83    :    // The call-trace log file parser. This can be preset to a custom parser
  84    :    // prior to calling Simulator.
  85  m :    scoped_ptr<Parser> parser_;
  86    :  
  87    :    // A pointer to a simulation, that is to be used.
  88  m :    SimulationEventHandler* simulation_;
  89  m :  };
  90    :  
  91  m :  } // namespace simulate
  92    :  
  93    :  #endif  // SYZYGY_SIMULATE_SIMULATOR_H_

Coverage information generated Thu Jul 04 09:34:53 2013.