/* -*- Mode: C++; tab-width: 8; 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/. */
/** * A mechanism for interacting with operating system-provided * debugging/profiling tools such as Microsoft EWT/Windows Performance Toolkit.
*/
protected: /** * The system GUID associated to this probe. See the documentation * of |ProbeManager::Make| for more details.
*/ const GUID mGUID;
/** * The name of this probe. See the documentation * of |ProbeManager::Make| for more details.
*/ const nsCString mName;
/** * The ProbeManager managing this probe. * * Note: This is a weak reference to avoid a useless cycle.
*/ class ProbeManager* mManager;
};
/** * A manager for a group of probes. * * You can have several managers in one application, provided that they all * have distinct IDs and names. However, having more than 2 is considered a bad * practice.
*/ class ProbeManager { public:
NS_INLINE_DECL_REFCOUNTING(ProbeManager)
/** * Create a new probe manager. * * This constructor should be called from the main thread. * * @param aApplicationUID The unique ID of the probe. Under Windows, this * unique ID must have been previously registered using an external tool. * See MyCategory on http://msdn.microsoft.com/en-us/library/aa364100.aspx * @param aApplicationName A name for the probe. Currently used only for * logging purposes. In the future, may be attached to the data sent to the * operating system. * * Note: If two ProbeManagers are constructed with the same uid and/or name, * behavior is unspecified.
*/
ProbeManager(const nsCID& aApplicationUID, const nsACString& aApplicationName);
/** * Acquire a probe. * * Note: Only probes acquired before the call to SetReady are taken into * account * Note: Can be called only from the main thread. * * @param aEventUID The unique ID of the probe. Under Windows, this unique * ID must have been previously registered using an external tool. * See MyCategory on http://msdn.microsoft.com/en-us/library/aa364100.aspx * @param aEventName A name for the probe. Currently used only for logging * purposes. In the * future, may be attached to the data sent to the operating system. * @return Either |null| in case of error or a valid |Probe*|. * * Note: If this method is called twice with the same uid and/or name, * behavior is undefined.
*/
already_AddRefed<Probe> GetProbe(const nsCID& aEventUID, const nsACString& aEventName);
/** * Start/stop the measuring session. * * This method should be called from the main thread. * * Note that starting an already started probe manager has no effect, * nor does stopping an already stopped probe manager.
*/
nsresult StartSession();
nsresult StopSession();
/** * @return true If measures are currently on, i.e. if triggering probes is any * is useful. You do not have to check this before triggering a probe, unless * this can avoid complex computations.
*/ bool IsActive();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.