David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 17 | #pragma once |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 18 | |
Joe Onorato | c4dfae5 | 2017-10-17 23:38:21 -0700 | [diff] [blame] | 19 | #include "logd/LogEvent.h" |
| 20 | |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 21 | #include <log/log_read.h> |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 22 | #include <log/logprint.h> |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 23 | #include <set> |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 24 | #include <string> |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 25 | #include <unordered_map> |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 26 | #include <vector> |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 27 | #include "frameworks/base/cmds/statsd/src/stats_log_common.pb.h" |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 28 | #include "frameworks/base/cmds/statsd/src/statsd_config.pb.h" |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 29 | #include "packages/UidMap.h" |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 30 | #include "stats_util.h" |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 31 | |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 32 | namespace android { |
| 33 | namespace os { |
| 34 | namespace statsd { |
| 35 | |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 36 | enum MatchingState { |
| 37 | kNotComputed = -1, |
| 38 | kNotMatched = 0, |
| 39 | kMatched = 1, |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 40 | }; |
| 41 | |
Yao Chen | caf339d | 2017-10-06 16:01:10 -0700 | [diff] [blame] | 42 | bool combinationMatch(const std::vector<int>& children, const LogicalOperation& operation, |
| 43 | const std::vector<MatchingState>& matcherResults); |
| 44 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 45 | bool matchesSimple(const UidMap& uidMap, |
| 46 | const SimpleAtomMatcher& simpleMatcher, const LogEvent& wrapper); |
| 47 | |
Yao Chen | 44cf27c | 2017-09-14 22:32:50 -0700 | [diff] [blame] | 48 | } // namespace statsd |
| 49 | } // namespace os |
| 50 | } // namespace android |