Merge "Statsd: Enable host_supported for libstatslog" am: 0d7970f4e9
am: 46efaea281
Change-Id: I4c746e8acad23ef07d51fafb977f53db467c44fb
This commit is contained in:
@@ -96,6 +96,7 @@ genrule {
|
|||||||
|
|
||||||
cc_library_shared {
|
cc_library_shared {
|
||||||
name: "libstatslog",
|
name: "libstatslog",
|
||||||
|
host_supported: true,
|
||||||
generated_sources: ["statslog.cpp"],
|
generated_sources: ["statslog.cpp"],
|
||||||
generated_headers: ["statslog.h"],
|
generated_headers: ["statslog.h"],
|
||||||
cflags: [
|
cflags: [
|
||||||
@@ -105,8 +106,19 @@ cc_library_shared {
|
|||||||
export_generated_headers: ["statslog.h"],
|
export_generated_headers: ["statslog.h"],
|
||||||
shared_libs: [
|
shared_libs: [
|
||||||
"liblog",
|
"liblog",
|
||||||
"libutils",
|
|
||||||
"libcutils",
|
"libcutils",
|
||||||
],
|
],
|
||||||
static_libs: ["libstatssocket"],
|
static_libs: ["libstatssocket"],
|
||||||
|
target: {
|
||||||
|
android: {
|
||||||
|
shared_libs: [
|
||||||
|
"libutils",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
host: {
|
||||||
|
static_libs: [
|
||||||
|
"libutils",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,9 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
|
|||||||
fprintf(out, "#include <mutex>\n");
|
fprintf(out, "#include <mutex>\n");
|
||||||
fprintf(out, "#include <chrono>\n");
|
fprintf(out, "#include <chrono>\n");
|
||||||
fprintf(out, "#include <thread>\n");
|
fprintf(out, "#include <thread>\n");
|
||||||
|
fprintf(out, "#ifdef __ANDROID__\n");
|
||||||
fprintf(out, "#include <cutils/properties.h>\n");
|
fprintf(out, "#include <cutils/properties.h>\n");
|
||||||
|
fprintf(out, "#endif\n");
|
||||||
fprintf(out, "#include <stats_event_list.h>\n");
|
fprintf(out, "#include <stats_event_list.h>\n");
|
||||||
fprintf(out, "#include <log/log.h>\n");
|
fprintf(out, "#include <log/log.h>\n");
|
||||||
fprintf(out, "#include <statslog.h>\n");
|
fprintf(out, "#include <statslog.h>\n");
|
||||||
@@ -119,7 +121,11 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
|
|||||||
fprintf(out, "namespace util {\n");
|
fprintf(out, "namespace util {\n");
|
||||||
fprintf(out, "// the single event tag id for all stats logs\n");
|
fprintf(out, "// the single event tag id for all stats logs\n");
|
||||||
fprintf(out, "const static int kStatsEventTag = 1937006964;\n");
|
fprintf(out, "const static int kStatsEventTag = 1937006964;\n");
|
||||||
|
fprintf(out, "#ifdef __ANDROID__\n");
|
||||||
fprintf(out, "const static bool kStatsdEnabled = property_get_bool(\"ro.statsd.enable\", true);\n");
|
fprintf(out, "const static bool kStatsdEnabled = property_get_bool(\"ro.statsd.enable\", true);\n");
|
||||||
|
fprintf(out, "#else\n");
|
||||||
|
fprintf(out, "const static bool kStatsdEnabled = false;\n");
|
||||||
|
fprintf(out, "#endif\n");
|
||||||
|
|
||||||
std::set<string> kTruncatingAtomNames = {"mobile_radio_power_state_changed",
|
std::set<string> kTruncatingAtomNames = {"mobile_radio_power_state_changed",
|
||||||
"audio_state_changed",
|
"audio_state_changed",
|
||||||
|
|||||||
Reference in New Issue
Block a user