Merge "Remove kAtomsWithAttributionChain from atoms_info" into rvc-dev am: 9a89a81625 am: 29e6e92135
Change-Id: I6762a0ca526b4551828fe2355e1c59fab369ce95
This commit is contained in:
@@ -139,8 +139,7 @@ void StatsLogProcessor::onPeriodicAlarmFired(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void StatsLogProcessor::mapIsolatedUidToHostUidIfNecessaryLocked(LogEvent* event) const {
|
void StatsLogProcessor::mapIsolatedUidToHostUidIfNecessaryLocked(LogEvent* event) const {
|
||||||
if (android::util::AtomsInfo::kAtomsWithAttributionChain.find(event->GetTagId()) !=
|
if (event->getAttributionChainIndex() != -1) {
|
||||||
android::util::AtomsInfo::kAtomsWithAttributionChain.end()) {
|
|
||||||
for (auto& value : *(event->getMutableValues())) {
|
for (auto& value : *(event->getMutableValues())) {
|
||||||
if (value.mField.getPosAtDepth(0) > kAttributionField) {
|
if (value.mField.getPosAtDepth(0) > kAttributionField) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
11
cmds/statsd/src/external/puller_util.cpp
vendored
11
cmds/statsd/src/external/puller_util.cpp
vendored
@@ -49,11 +49,9 @@ using namespace std;
|
|||||||
*/
|
*/
|
||||||
void mapAndMergeIsolatedUidsToHostUid(vector<shared_ptr<LogEvent>>& data, const sp<UidMap>& uidMap,
|
void mapAndMergeIsolatedUidsToHostUid(vector<shared_ptr<LogEvent>>& data, const sp<UidMap>& uidMap,
|
||||||
int tagId, const vector<int>& additiveFieldsVec) {
|
int tagId, const vector<int>& additiveFieldsVec) {
|
||||||
bool hasAttributionChain = (android::util::AtomsInfo::kAtomsWithAttributionChain.find(tagId) !=
|
// Check the first LogEvent for attribution chain or a uid field as either all atoms with this
|
||||||
android::util::AtomsInfo::kAtomsWithAttributionChain.end());
|
// tagId have them or none of them do.
|
||||||
// To check if any LogEvent has a uid field, we can just check the first
|
const bool hasAttributionChain = data[0]->getAttributionChainIndex() != -1;
|
||||||
// LogEvent because all atoms with this tagId should have the uid
|
|
||||||
// annotation.
|
|
||||||
bool hasUidField = (data[0]->getUidFieldIndex() != -1);
|
bool hasUidField = (data[0]->getUidFieldIndex() != -1);
|
||||||
|
|
||||||
if (!hasAttributionChain && !hasUidField) {
|
if (!hasAttributionChain && !hasUidField) {
|
||||||
@@ -67,8 +65,7 @@ void mapAndMergeIsolatedUidsToHostUid(vector<shared_ptr<LogEvent>>& data, const
|
|||||||
ALOGE("Wrong atom. Expecting %d, got %d", tagId, event->GetTagId());
|
ALOGE("Wrong atom. Expecting %d, got %d", tagId, event->GetTagId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (android::util::AtomsInfo::kAtomsWithAttributionChain.find(tagId) !=
|
if (event->getAttributionChainIndex() != -1) {
|
||||||
android::util::AtomsInfo::kAtomsWithAttributionChain.end()) {
|
|
||||||
for (auto& value : *(event->getMutableValues())) {
|
for (auto& value : *(event->getMutableValues())) {
|
||||||
if (value.mField.getPosAtDepth(0) > kAttributionField) {
|
if (value.mField.getPosAtDepth(0) > kAttributionField) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ namespace stats_log_api_gen {
|
|||||||
|
|
||||||
static void write_atoms_info_header_body(FILE* out, const Atoms& atoms) {
|
static void write_atoms_info_header_body(FILE* out, const Atoms& atoms) {
|
||||||
fprintf(out, "struct AtomsInfo {\n");
|
fprintf(out, "struct AtomsInfo {\n");
|
||||||
fprintf(out, " const static std::set<int> kAtomsWithAttributionChain;\n");
|
|
||||||
fprintf(out, " const static std::set<int> kWhitelistedAtoms;\n");
|
fprintf(out, " const static std::set<int> kWhitelistedAtoms;\n");
|
||||||
fprintf(out, "};\n");
|
fprintf(out, "};\n");
|
||||||
fprintf(out, "const static int kMaxPushedAtomId = %d;\n\n", atoms.maxPushedAtomId);
|
fprintf(out, "const static int kMaxPushedAtomId = %d;\n\n", atoms.maxPushedAtomId);
|
||||||
@@ -35,22 +34,6 @@ static void write_atoms_info_header_body(FILE* out, const Atoms& atoms) {
|
|||||||
|
|
||||||
static void write_atoms_info_cpp_body(FILE* out, const Atoms& atoms) {
|
static void write_atoms_info_cpp_body(FILE* out, const Atoms& atoms) {
|
||||||
|
|
||||||
fprintf(out, "const std::set<int> AtomsInfo::kAtomsWithAttributionChain = {\n");
|
|
||||||
for (AtomDeclSet::const_iterator atomIt = atoms.decls.begin(); atomIt != atoms.decls.end();
|
|
||||||
atomIt++) {
|
|
||||||
for (vector<AtomField>::const_iterator field = (*atomIt)->fields.begin();
|
|
||||||
field != (*atomIt)->fields.end(); field++) {
|
|
||||||
if (field->javaType == JAVA_TYPE_ATTRIBUTION_CHAIN) {
|
|
||||||
const string constant = make_constant_name((*atomIt)->name);
|
|
||||||
fprintf(out, " %d, // %s\n", (*atomIt)->code, constant.c_str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(out, "};\n");
|
|
||||||
fprintf(out, "\n");
|
|
||||||
|
|
||||||
fprintf(out, "const std::set<int> AtomsInfo::kWhitelistedAtoms = {\n");
|
fprintf(out, "const std::set<int> AtomsInfo::kWhitelistedAtoms = {\n");
|
||||||
for (AtomDeclSet::const_iterator atomIt = atoms.decls.begin(); atomIt != atoms.decls.end();
|
for (AtomDeclSet::const_iterator atomIt = atoms.decls.begin(); atomIt != atoms.decls.end();
|
||||||
atomIt++) {
|
atomIt++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user