/* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SRC_TRACE_PROCESSOR_IMPORTERS_SYSTRACE_SYSTRACE_PARSER_H_ #define SRC_TRACE_PROCESSOR_IMPORTERS_SYSTRACE_SYSTRACE_PARSER_H_ #include <ostream> #include "src/trace_processor/types/trace_processor_context.h" #include "perfetto/base/logging.h" #include "perfetto/ext/base/string_utils.h" #include "perfetto/ext/base/string_view.h" #include "src/trace_processor/storage/trace_storage.h" namespace perfetto { namespace trace_processor { namespace systrace_utils { // Visible for unittesting. enum class SystraceParseResult { … }; // Visible for unittesting. struct SystraceTracePoint { … }; // We have to handle trace_marker events of a few different types: // 1. some random text // 2. B|1636|pokeUserActivity // 3. E|1636 // 4. C|1636|wq:monitor|0 // 5. S|1636|frame_capture|123 // 6. F|1636|frame_capture|456 // 7. C|3209|TransfersBytesPendingOnDisk-value|0|Blob // 8. I|4820|instant // 9. N|1938|track_name|instant_name // 10. G|1339|track_name|slice_name|789 // 11. H|6890|track_name|slice_name|135 // 12. H|6890|track_name|135 // Counters emitted by chromium can have a further "category group" appended // ("Blob" in the example below). We ignore the category group. inline SystraceParseResult ParseSystraceTracePoint( base::StringView str_untrimmed, SystraceTracePoint* out) { … } // Visible for unittesting. inline bool operator==(const SystraceTracePoint& x, const SystraceTracePoint& y) { … } } // namespace systrace_utils class SystraceParser : public Destructible { … }; } // namespace trace_processor } // namespace perfetto #endif // SRC_TRACE_PROCESSOR_IMPORTERS_SYSTRACE_SYSTRACE_PARSER_H_