tools/profiler/core/SyncProfile.cpp
author Nicholas Nethercote <nnethercote@mozilla.com>
Mon, 27 Feb 2017 12:31:44 +1100
changeset 394122 16d6cb0afff570c36c5aea1e4b9f59a86abc75a5
parent 394121 63fa61a6e3d12a7d562e5108706b8d0a75dc7e4b
child 394519 6de72f3b7f8abb27024a34faac7fbde24ee6ec8f
permissions -rw-r--r--
Bug 1328378 (part 2) - Remove BeginUnwind() and EndUnwind(). r=mstange. Both of these functions are now trivial and identical in both ThreadInfo and SyncProfile. This patch inlines and removes them.

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "SyncProfile.h"

SyncProfile::SyncProfile(int aThreadId, PseudoStack* aStack)
  : ThreadInfo("SyncProfile", aThreadId, /* isMainThread = */ false, aStack,
               /* stackTop = */ nullptr)
{
  MOZ_COUNT_CTOR(SyncProfile);
  SetProfile(new ProfileBuffer(GET_BACKTRACE_DEFAULT_ENTRIES));
}

SyncProfile::~SyncProfile()
{
  MOZ_COUNT_DTOR(SyncProfile);
}

// SyncProfiles' stacks are deduplicated in the context of the containing
// profile in which the backtrace is as a marker payload.
void
SyncProfile::StreamJSON(SpliceableJSONWriter& aWriter, UniqueStacks& aUniqueStacks)
{
  ThreadInfo::StreamSamplesAndMarkers(aWriter, /* aSinceTime = */ 0, aUniqueStacks);
}