summaryrefslogtreecommitdiff
path: root/tools/stats_log_api_gen/main.cpp
diff options
context:
space:
mode:
authorTej Singh <singhtejinder@google.com>2019-06-05 18:10:12 -0700
committerTej Singh <singhtejinder@google.com>2019-06-05 18:10:12 -0700
commit29ac6014295bb8904a00a32016e8698cbc6cb716 (patch)
tree5c7a511bb566309849ff034230fcf25a31c11d3d /tools/stats_log_api_gen/main.cpp
parent2aa255a74656e448b28b1f258d25bed18f2d6396 (diff)
Blacklist truncated atoms instead of whitelistnig
We used a whitelist to determine which atoms should have their timestamps truncated to the nearest 5 minutes. This changes the logic to a blacklist so that we can get fine grained timestamps from vendor and mainline atoms. Also reserves a range for atoms that need to be truncated in the future. Bug: 134574701 Test: inspected generated statslog.cpp file to make sure it had the correct blacklist Test: testdrive on ScreenStateChanged to ensure timestamps are preserved when they should be Test: testdrive on CallStateChanged to ensure timestamps are truncated when they should be. Change-Id: Id3468542c830cdf41395a94c77f7df0b46cd11b7
Diffstat (limited to 'tools/stats_log_api_gen/main.cpp')
-rw-r--r--tools/stats_log_api_gen/main.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/tools/stats_log_api_gen/main.cpp b/tools/stats_log_api_gen/main.cpp
index 1aad4be5d66f..f62fef076f48 100644
--- a/tools/stats_log_api_gen/main.cpp
+++ b/tools/stats_log_api_gen/main.cpp
@@ -131,14 +131,10 @@ static void write_atoms_info_cpp(FILE *out, const Atoms &atoms) {
"mobile_bytes_transfer"};
fprintf(out,
"const std::set<int> "
- "AtomsInfo::kNotTruncatingTimestampAtomWhiteList = {\n");
- for (set<AtomDecl>::const_iterator atom = atoms.decls.begin();
- atom != atoms.decls.end(); atom++) {
- if (kTruncatingAtomNames.find(atom->name) ==
- kTruncatingAtomNames.end()) {
- string constant = make_constant_name(atom->name);
- fprintf(out, " %s,\n", constant.c_str());
- }
+ "AtomsInfo::kTruncatingTimestampAtomBlackList = {\n");
+ for (set<string>::const_iterator blacklistedAtom = kTruncatingAtomNames.begin();
+ blacklistedAtom != kTruncatingAtomNames.end(); blacklistedAtom++) {
+ fprintf(out, " %s,\n", make_constant_name(*blacklistedAtom).c_str());
}
fprintf(out, "};\n");
fprintf(out, "\n");
@@ -840,7 +836,7 @@ write_stats_log_header(FILE* out, const Atoms& atoms, const AtomDecl &attributio
fprintf(out, "struct AtomsInfo {\n");
fprintf(out,
" const static std::set<int> "
- "kNotTruncatingTimestampAtomWhiteList;\n");
+ "kTruncatingTimestampAtomBlackList;\n");
fprintf(out, " const static std::map<int, int> kAtomsWithUidField;\n");
fprintf(out,
" const static std::set<int> kAtomsWithAttributionChain;\n");