| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#pragma once |
| 18 |
|
| 19 |
#include <string> |
| 20 |
|
| 21 |
#include "JankTracker.h" |
| 22 |
#include "utils/Macros.h" |
| 23 |
#include <stats_pull_atom_callback.h> |
| 24 |
|
| 25 |
namespace android { |
| 26 |
namespace uirenderer { |
| 27 |
namespace protos { |
| 28 |
class GraphicsStatsProto; |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
class GraphicsStatsService { |
| 39 |
public: |
| 40 |
class Dump; |
| 41 |
enum class DumpType { |
| 42 |
Text, |
| 43 |
Protobuf, |
| 44 |
ProtobufStatsd, |
| 45 |
}; |
| 46 |
|
| 47 |
static void saveBuffer(const std::string& path, const std::string& package, int64_t versionCode, |
| 48 |
int64_t startTime, int64_t endTime, const ProfileData* data); |
| 49 |
|
| 50 |
static Dump* createDump(int outFd, DumpType type); |
| 51 |
static void addToDump(Dump* dump, const std::string& path, const std::string& package, |
| 52 |
int64_t versionCode, int64_t startTime, int64_t endTime, |
| 53 |
const ProfileData* data); |
| 54 |
static void addToDump(Dump* dump, const std::string& path); |
| 55 |
static void finishDump(Dump* dump); |
| 56 |
static void finishDumpInMemory(Dump* dump, AStatsEventList* data, bool lastFullDay); |
| 57 |
|
| 58 |
|
| 59 |
static bool parseFromFile(const std::string& path, protos::GraphicsStatsProto* output); |
| 60 |
}; |
| 61 |
|
| 62 |
} |
| 63 |
} |