blob: faf25cba380d7c52817c74d42f45c1bf8b34ce7b [file] [log] [blame]
Hector Dearman3d8970f2017-10-31 09:27:15 +00001# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15config("ftrace_reader_config") {
16 include_dirs = [ "include" ]
17}
18
19executable("ftrace_reader_unittests") {
20 testonly = true
21 deps += [
22 ":ftrace_reader",
23 "//buildtools:gmock",
24 "//buildtools:gtest",
25 "//buildtools:gtest_main",
Primiano Tucci782374f2017-11-27 16:25:20 +000026 "//protos/ftrace:full",
Hector Dearman3d8970f2017-10-31 09:27:15 +000027 ]
28 sources = [
Hector Dearman0d300332017-11-22 11:05:34 +000029 "src/cpu_reader_unittest.cc",
Hector Dearman2193ff42017-11-08 14:15:19 +000030 "src/format_parser_unittest.cc",
Hector Dearman0d300332017-11-22 11:05:34 +000031 "src/ftrace_controller_unittest.cc",
Hector Dearman2193ff42017-11-08 14:15:19 +000032 "src/ftrace_to_proto_unittest.cc",
Hector Dearman0d300332017-11-22 11:05:34 +000033 "src/proto_translation_table_unittest.cc",
Hector Dearmanbefe55b2017-11-24 19:02:59 +000034 "src/scattered_stream_delegate_for_testing.h",
Hector Dearman3d8970f2017-10-31 09:27:15 +000035 ]
36}
37
Hector Dearman650fb842017-11-06 15:03:41 +000038# These tests require access to a real ftrace implementation and must
39# run with sudo.
40executable("ftrace_reader_integrationtests") {
41 testonly = true
42 deps += [
43 ":ftrace_reader",
Hector Dearmana4cb5642017-11-15 16:35:56 +000044 "//base",
Hector Dearman650fb842017-11-06 15:03:41 +000045 "//buildtools:gmock",
46 "//buildtools:gtest",
47 "//buildtools:gtest_main",
Hector Dearman8d8ccd32017-11-27 16:06:34 +000048 "//buildtools:protobuf_full",
Primiano Tucci782374f2017-11-27 16:25:20 +000049 "//protos/ftrace:full",
Hector Dearman650fb842017-11-06 15:03:41 +000050 ]
51 sources = [
Hector Dearman8d8ccd32017-11-27 16:06:34 +000052 "src/end_to_end_integrationtest.cc",
Hector Dearman0d300332017-11-22 11:05:34 +000053 "src/ftrace_procfs_integrationtest.cc",
Hector Dearman650fb842017-11-06 15:03:41 +000054 ]
55}
56
Hector Dearman3d8970f2017-10-31 09:27:15 +000057executable("ftrace_reader_demo") {
Hector Dearmanbefe55b2017-11-24 19:02:59 +000058 testonly = true
Hector Dearman3d8970f2017-10-31 09:27:15 +000059 sources = [
Hector Dearmanbefe55b2017-11-24 19:02:59 +000060 "src/main.cc",
Hector Dearman3d8970f2017-10-31 09:27:15 +000061 ]
Hector Dearmanbefe55b2017-11-24 19:02:59 +000062 deps += [
63 ":ftrace_reader",
64 "//base",
65 ]
Hector Dearman3d8970f2017-10-31 09:27:15 +000066}
67
68source_set("ftrace_reader") {
Hector Dearman385adde2017-11-14 12:21:42 +000069 all_dependent_configs = [
70 ":ftrace_reader_config",
71 "//buildtools:googletest_prod_config",
72 ]
Primiano Tucci782374f2017-11-27 16:25:20 +000073 deps += [ "//base" ]
Hector Dearman2c650f82017-11-08 10:51:45 +000074 public_deps = [
Primiano Tucci782374f2017-11-27 16:25:20 +000075 "//protos/ftrace:zero",
Hector Dearman2c650f82017-11-08 10:51:45 +000076 ]
Hector Dearman3d8970f2017-10-31 09:27:15 +000077 sources = [
Hector Dearman2193ff42017-11-08 14:15:19 +000078 "include/ftrace_reader/format_parser.h",
Hector Dearman650fb842017-11-06 15:03:41 +000079 "include/ftrace_reader/ftrace_controller.h",
Hector Dearman2193ff42017-11-08 14:15:19 +000080 "include/ftrace_reader/ftrace_to_proto.h",
Hector Dearman0d300332017-11-22 11:05:34 +000081 "src/cpu_reader.cc",
82 "src/cpu_reader.h",
Hector Dearman2193ff42017-11-08 14:15:19 +000083 "src/format_parser.cc",
Hector Dearman650fb842017-11-06 15:03:41 +000084 "src/ftrace_controller.cc",
Hector Dearman0d300332017-11-22 11:05:34 +000085 "src/ftrace_procfs.cc",
86 "src/ftrace_procfs.h",
Hector Dearman2193ff42017-11-08 14:15:19 +000087 "src/ftrace_to_proto.cc",
Hector Dearman0d300332017-11-22 11:05:34 +000088 "src/proto_translation_table.cc",
89 "src/proto_translation_table.h",
Hector Dearman3d8970f2017-10-31 09:27:15 +000090 ]
91}