diff options
author | Yao Chen <yaochen@google.com> | 2018-04-18 13:45:48 -0700 |
---|---|---|
committer | Yao Chen <yaochen@google.com> | 2018-04-20 14:52:01 -0700 |
commit | f7bc6ab7fa21f849250d0f5ee2849f9e49a8d436 (patch) | |
tree | 3d751dab478cd4792facae3762ada90308b70cb1 /tools/stats_log_api_gen/main.cpp | |
parent | 46e58e1b4086aa0e3eb62f9cdae0eefaea08943f (diff) |
Allow StatsLog to directly write to statsd's socket.
+ Reuse the log_event_list from liblog. StatsLog's binary format remains unchanged
+ Copied socket write code from liblog, including the retry logic.
+ Added build flags to control the StatsLog channel (logd, statsd, or both for debugging)
Bug: 78239479
Test: locally tested and saw logs being written to statsd
Change-Id: I7b1f0069ead00bbf3c29e4bd5b7f363a7ce26abe
Diffstat (limited to 'tools/stats_log_api_gen/main.cpp')
-rw-r--r-- | tools/stats_log_api_gen/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/stats_log_api_gen/main.cpp b/tools/stats_log_api_gen/main.cpp index 4146e02cdd34..638549d395b3 100644 --- a/tools/stats_log_api_gen/main.cpp +++ b/tools/stats_log_api_gen/main.cpp @@ -104,7 +104,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms, fprintf(out, "#include <mutex>\n"); fprintf(out, "#include <chrono>\n"); fprintf(out, "#include <thread>\n"); - fprintf(out, "#include <log/log_event_list.h>\n"); + fprintf(out, "#include <stats_event_list.h>\n"); fprintf(out, "#include <log/log.h>\n"); fprintf(out, "#include <statslog.h>\n"); fprintf(out, "#include <utils/SystemClock.h>\n"); @@ -242,7 +242,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms, fprintf(out, "{\n"); argIndex = 1; - fprintf(out, " android_log_event_list event(kStatsEventTag);\n"); + fprintf(out, " stats_event_list event(kStatsEventTag);\n"); fprintf(out, " event << android::elapsedRealtimeNano();\n\n"); fprintf(out, " event << code;\n\n"); for (vector<java_type_t>::const_iterator arg = signature->begin(); @@ -375,7 +375,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms, fprintf(out, "{\n"); argIndex = 1; - fprintf(out, " android_log_event_list event(kStatsEventTag);\n"); + fprintf(out, " stats_event_list event(kStatsEventTag);\n"); fprintf(out, " event << android::elapsedRealtimeNano();\n\n"); fprintf(out, " event << code;\n\n"); for (vector<java_type_t>::const_iterator arg = signature->begin(); |