Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8e22661 authored by Muhammad Qureshi's avatar Muhammad Qureshi
Browse files

Move statsd metadata from statslog to atoms_info

Clients don't need to know about statsd metadata. Extract out metadata
from statslog.h/cpp into atoms_info.h/cpp which is only used by statsd.

Generated atoms_info.h: https://paste.googleplex.com/6303016724463616
Generated atoms_info.cpp: https://paste.googleplex.com/5717940978581504

Test: m -j
Test: old metadata in statslog matches the metadata in
atoms_info
Test: Flashes successfully
Test: adb logcat "*:S statsd:*"

Change-Id: I56ef3cc4ea1fbd2cd0130d4e9576b242efb9f627
parent a9a54dc0
Loading
Loading
Loading
Loading
+58 −0
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ cc_defaults {
        "libprotoutil",
        "libservices",
        "libstatslog",
        "libstatsmetadata",
        "libstatssocket",
        "libsysutils",
        "libtimestats_proto",
@@ -153,6 +154,63 @@ cc_defaults {
    ],
}

// ================
// libstatsmetadata
// ================

genrule {
    name: "atoms_info.h",
    tools: ["stats-log-api-gen"],
    cmd: "$(location stats-log-api-gen) --atomsInfoHeader $(genDir)/atoms_info.h",
    out: [
        "atoms_info.h",
    ],
}

genrule {
    name: "atoms_info.cpp",
    tools: ["stats-log-api-gen"],
    cmd: "$(location stats-log-api-gen) --atomsInfoCpp $(genDir)/atoms_info.cpp",
    out: [
        "atoms_info.cpp",
    ],
}

cc_library_shared {
    name: "libstatsmetadata",
    host_supported: true,
    generated_sources: [
        "atoms_info.cpp",
    ],
    generated_headers: [
        "atoms_info.h",
    ],
    cflags: [
        "-Wall",
        "-Werror",
    ],
    export_generated_headers: [
        "atoms_info.h",
    ],
    shared_libs: [
        "libcutils",
        "libstatslog",
    ],
    target: {
        android: {
            shared_libs: [
                "libutils",
            ],
        },
        host: {
            static_libs: [
                "libutils",
            ],
        },
    },
}


// =========
// statsd
// =========
+1 −1
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@
#include "Log.h"
#include "FieldValue.h"
#include "HashableDimensionKey.h"
#include "atoms_info.h"
#include "math.h"
#include "statslog.h"

namespace android {
namespace os {
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <utils/SystemClock.h>

#include "android-base/stringprintf.h"
#include "atoms_info.h"
#include "external/StatsPullerManager.h"
#include "guardrail/StatsdStats.h"
#include "metrics/CountMetricProducer.h"
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <vector>

#include "PowerStatsPuller.h"
#include "statslog.h"
#include "stats_log_util.h"

using android::hardware::hidl_vec;
+1 −1
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@
#include "Log.h"

#include "StatsPullerManager.h"
#include "atoms_info.h"
#include "puller_util.h"
#include "statslog.h"

namespace android {
namespace os {
Loading