tools/profiler/SyncProfile.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/profiler/SyncProfile.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef __SYNCPROFILE_H
    1.11 +#define __SYNCPROFILE_H
    1.12 +
    1.13 +#include "ProfileEntry.h"
    1.14 +
    1.15 +struct LinkedUWTBuffer;
    1.16 +
    1.17 +class SyncProfile : public ThreadProfile
    1.18 +{
    1.19 +public:
    1.20 +  SyncProfile(const char* aName, int aEntrySize, PseudoStack *aStack,
    1.21 +              Thread::tid_t aThreadId, bool aIsMainThread);
    1.22 +  ~SyncProfile();
    1.23 +
    1.24 +  bool SetUWTBuffer(LinkedUWTBuffer* aBuff);
    1.25 +  LinkedUWTBuffer* GetUWTBuffer() { return mUtb; }
    1.26 +
    1.27 +  virtual void EndUnwind();
    1.28 +  virtual SyncProfile* AsSyncProfile() { return this; }
    1.29 +
    1.30 +private:
    1.31 +  friend class ProfilerBacktrace;
    1.32 +
    1.33 +  enum OwnerState
    1.34 +  {
    1.35 +    REFERENCED,       // ProfilerBacktrace has a pointer to this but doesn't own
    1.36 +    OWNED,            // ProfilerBacktrace is responsible for destroying this
    1.37 +    OWNER_DESTROYING, // ProfilerBacktrace owns this and is destroying
    1.38 +    ORPHANED          // No owner, we must destroy ourselves
    1.39 +  };
    1.40 +
    1.41 +  bool ShouldDestroy();
    1.42 +
    1.43 +  OwnerState        mOwnerState;
    1.44 +  LinkedUWTBuffer*  mUtb;
    1.45 +};
    1.46 +
    1.47 +#endif // __SYNCPROFILE_H
    1.48 +

mercurial