• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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 
17 #ifndef SRC_TRACED_PROBES_FTRACE_TEST_CPU_READER_SUPPORT_H_
18 #define SRC_TRACED_PROBES_FTRACE_TEST_CPU_READER_SUPPORT_H_
19 
20 #include <memory>
21 #include <string>
22 
23 #include "src/traced/probes/ftrace/proto_translation_table.h"
24 
25 namespace perfetto {
26 
27 struct ExamplePage {
28   // The name of the format file set used in the collection of this example
29   // page. Should name a directory under src/traced/probes/ftrace/test/data.
30   const char* name;
31   // The non-zero prefix of xxd'ing the page.
32   const char* data;
33 };
34 
35 // Create a ProtoTranslationTable uing the fomat files in
36 // directory |name|. Caches the table for subsequent lookups.
37 ProtoTranslationTable* GetTable(const std::string& name);
38 
39 // Convert xxd output into binary data.
40 std::unique_ptr<uint8_t[]> PageFromXxd(const std::string& text);
41 
42 }  // namespace perfetto
43 
44 #endif  // SRC_TRACED_PROBES_FTRACE_TEST_CPU_READER_SUPPORT_H_
45