2013-06-14 11:01:02 -07:00
|
|
|
/* 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 "GeckoProfiler.h"
|
2013-09-12 07:47:37 -07:00
|
|
|
#include "ProfilerIOInterposeObserver.h"
|
2013-06-14 11:01:02 -07:00
|
|
|
|
|
|
|
using namespace mozilla;
|
|
|
|
|
2013-09-12 07:47:37 -07:00
|
|
|
void ProfilerIOInterposeObserver::Observe(Observation& aObservation)
|
2013-06-14 11:01:02 -07:00
|
|
|
{
|
2013-09-12 07:47:37 -07:00
|
|
|
// TODO: The profile might want to take notice of non-main-thread IO, as
|
|
|
|
// well as noting what files or references causes the IO.
|
|
|
|
if (NS_IsMainThread()) {
|
|
|
|
const char* ops[] = {"none", "read", "write", "invalid", "fsync"};
|
|
|
|
PROFILER_MARKER(ops[aObservation.ObservedOperation()]);
|
2013-06-14 11:01:02 -07:00
|
|
|
}
|
|
|
|
}
|