2017-07-19 14:53:20 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkDebugfTracer_DEFINED
|
|
|
|
#define SkDebugfTracer_DEFINED
|
|
|
|
|
2019-03-20 17:01:47 +00:00
|
|
|
#include "EventTracingPriv.h"
|
2017-07-19 14:53:20 +00:00
|
|
|
#include "SkEventTracer.h"
|
|
|
|
#include "SkString.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A SkEventTracer implementation that logs events using SkDebugf.
|
|
|
|
*/
|
|
|
|
class SkDebugfTracer : public SkEventTracer {
|
|
|
|
public:
|
|
|
|
SkDebugfTracer() {}
|
|
|
|
|
|
|
|
SkEventTracer::Handle addTraceEvent(char phase,
|
|
|
|
const uint8_t* categoryEnabledFlag,
|
|
|
|
const char* name,
|
|
|
|
uint64_t id,
|
|
|
|
int numArgs,
|
|
|
|
const char** argNames,
|
|
|
|
const uint8_t* argTypes,
|
|
|
|
const uint64_t* argValues,
|
|
|
|
uint8_t flags) override;
|
|
|
|
|
|
|
|
void updateTraceEventDuration(const uint8_t* categoryEnabledFlag,
|
|
|
|
const char* name,
|
|
|
|
SkEventTracer::Handle handle) override;
|
|
|
|
|
2017-07-21 15:06:24 +00:00
|
|
|
const uint8_t* getCategoryGroupEnabled(const char* name) override {
|
|
|
|
return fCategories.getCategoryGroupEnabled(name);
|
|
|
|
}
|
2017-07-19 14:53:20 +00:00
|
|
|
|
|
|
|
const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag) override {
|
2017-07-21 15:06:24 +00:00
|
|
|
return fCategories.getCategoryGroupName(categoryEnabledFlag);
|
2017-07-19 14:53:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkString fIndent;
|
|
|
|
int fCnt = 0;
|
2017-07-21 15:06:24 +00:00
|
|
|
SkEventTracingCategories fCategories;
|
2017-07-19 14:53:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|