Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkDebugfTracer Class Reference

#include <SkDebugfTracer.h>

Inheritance diagram for SkDebugfTracer:
SkEventTracer

Public Member Functions

 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
 
const uint8_t * getCategoryGroupEnabled (const char *name) override
 
const char * getCategoryGroupName (const uint8_t *categoryEnabledFlag) override
 
void newTracingSection (const char *name) override
 
- Public Member Functions inherited from SkEventTracer
virtual ~SkEventTracer ()=default
 
virtual SkEventTracer::Handle addTraceEvent (char phase, const uint8_t *categoryEnabledFlag, const char *name, uint64_t id, int32_t numArgs, const char **argNames, const uint8_t *argTypes, const uint64_t *argValues, uint8_t flags)=0
 

Additional Inherited Members

- Public Types inherited from SkEventTracer
enum  CategoryGroupEnabledFlags { kEnabledForRecording_CategoryGroupEnabledFlags = 1 << 0 , kEnabledForMonitoring_CategoryGroupEnabledFlags = 1 << 1 , kEnabledForEventCallback_CategoryGroupEnabledFlags = 1 << 2 }
 
typedef uint64_t Handle
 
- Static Public Member Functions inherited from SkEventTracer
static bool SetInstance (SkEventTracer *, bool leakTracer=false)
 
static SkEventTracerGetInstance ()
 
- Protected Member Functions inherited from SkEventTracer
 SkEventTracer ()=default
 
 SkEventTracer (const SkEventTracer &)=delete
 
SkEventTraceroperator= (const SkEventTracer &)=delete
 

Detailed Description

A SkEventTracer implementation that logs events using SkDebugf.

Definition at line 18 of file SkDebugfTracer.h.

Constructor & Destructor Documentation

◆ SkDebugfTracer()

SkDebugfTracer::SkDebugfTracer ( )
inline

Definition at line 20 of file SkDebugfTracer.h.

20{}

Member Function Documentation

◆ addTraceEvent()

SkEventTracer::Handle SkDebugfTracer::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

Definition at line 13 of file SkDebugfTracer.cpp.

21 {
23 for (int i = 0; i < numArgs; ++i) {
24 if (i > 0) {
25 args.append(", ");
26 } else {
27 args.append(" ");
28 }
29
30 uint64_t value = argValues[i];
31 switch (argTypes[i]) {
33 args.appendf("%s=%s", argNames[i], value ? "true" : "false");
34 break;
36 args.appendf("%s=%" PRIu64, argNames[i], value);
37 break;
39 args.appendf("%s=%" PRIi64, argNames[i], static_cast<int64_t>(value));
40 break;
42 args.appendf("%s=%g", argNames[i], sk_bit_cast<double>(value));
43 break;
45 args.appendf("%s=0x%p", argNames[i], skia_private::TraceValueAsPointer(value));
46 break;
49 static constexpr size_t kMaxLen = 20;
51 size_t truncAt = string.size();
52 size_t newLineAt = SkStrFind(string.c_str(), "\n");
53 if (newLineAt > 0) {
54 truncAt = newLineAt;
55 }
56 truncAt = std::min(truncAt, kMaxLen);
57 if (truncAt < string.size()) {
58 string.resize(truncAt);
59 string.append("...");
60 }
61 args.appendf("%s=\"%s\"", argNames[i], string.c_str());
62 break;
63 }
64 default:
65 args.appendf("%s=<unknown type>", argNames[i]);
66 break;
67 }
68 }
69 bool open = (phase == TRACE_EVENT_PHASE_COMPLETE);
70 if (open) {
71 const char* category = this->getCategoryGroupName(categoryEnabledFlag);
72 SkDebugf("[% 2d]%s <%s> %s%s #%d {\n", (int)fIndent.size(), fIndent.c_str(), category, name,
73 args.c_str(), fCnt);
74 fIndent.append(" ");
75 } else {
76 SkDebugf("%s%s #%d\n", name, args.c_str(), fCnt);
77 }
78 ++fCnt;
79 return 0;
80}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static int SkStrFind(const char string[], const char substring[])
Definition SkString.h:41
#define TRACE_VALUE_TYPE_STRING
#define TRACE_VALUE_TYPE_BOOL
#define TRACE_VALUE_TYPE_POINTER
#define TRACE_VALUE_TYPE_COPY_STRING
#define TRACE_VALUE_TYPE_INT
#define TRACE_VALUE_TYPE_UINT
#define TRACE_VALUE_TYPE_DOUBLE
#define TRACE_EVENT_PHASE_COMPLETE
const char * getCategoryGroupName(const uint8_t *categoryEnabledFlag) override
size_t size() const
Definition SkString.h:131
void append(const char text[])
Definition SkString.h:203
const char * c_str() const
Definition SkString.h:133
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint8_t value
const char * name
Definition fuchsia.cc:50
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259
static const void * TraceValueAsPointer(uint64_t value)
static const char * TraceValueAsString(uint64_t value)

◆ getCategoryGroupEnabled()

const uint8_t * SkDebugfTracer::getCategoryGroupEnabled ( const char *  name)
inlineoverridevirtual

Implements SkEventTracer.

Definition at line 36 of file SkDebugfTracer.h.

36 {
37 return fCategories.getCategoryGroupEnabled(name);
38 }
uint8_t * getCategoryGroupEnabled(const char *name)

◆ getCategoryGroupName()

const char * SkDebugfTracer::getCategoryGroupName ( const uint8_t *  categoryEnabledFlag)
inlineoverridevirtual

Implements SkEventTracer.

Definition at line 40 of file SkDebugfTracer.h.

40 {
41 return fCategories.getCategoryGroupName(categoryEnabledFlag);
42 }
const char * getCategoryGroupName(const uint8_t *categoryEnabledFlag)

◆ newTracingSection()

void SkDebugfTracer::newTracingSection ( const char *  name)
overridevirtual

Reimplemented from SkEventTracer.

Definition at line 89 of file SkDebugfTracer.cpp.

89 {
90 SkDebugf("\n\n- - - New tracing section: %s - - -\n", name);
91}

◆ updateTraceEventDuration()

void SkDebugfTracer::updateTraceEventDuration ( const uint8_t *  categoryEnabledFlag,
const char *  name,
SkEventTracer::Handle  handle 
)
overridevirtual

Implements SkEventTracer.

Definition at line 82 of file SkDebugfTracer.cpp.

84 {
85 fIndent.resize(fIndent.size() - 1);
86 SkDebugf("[% 2d]%s } %s\n", (int)fIndent.size(), fIndent.c_str(), name);
87}
void resize(size_t len)
Definition SkString.cpp:374

The documentation for this class was generated from the following files: