blob: ea8867ab3e521f4649a998f0af0a32a2b4d72d2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// An abstraction for functions used to control execution time profiling.
// All methods are effectively no-ops unless this program is being run through
// a supported tool (currently only Quantify, a companion tool to Purify)
#ifndef BASE_PROFILER_H__
#define BASE_PROFILER_H__
#pragma once
#include "base/basictypes.h"
namespace base {
class Profiler {
public:
// Starts or resumes recording.
static void StartRecording();
// Stops recording until StartRecording is called or the program exits.
static void StopRecording();
// Throw away data collected so far. This can be useful to call before
// your first call to StartRecording, for instance to avoid counting any
// time in application startup.
static void ClearData();
// Flushes all recorded data to disk. No-op until recording is started.
static void Flush();
// Sets the name of the current thread for display in the profiler's UI.
static void SetThreadName(const char *name);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(Profiler);
};
} // namespace base
#endif // BASE_PROFILER_H__
|