blob: 6837de37963d82994dec13246b914b6899bb6c6d [file] [log] [blame]
# Copyright (C) 2017 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.
source_set("test_support") {
testonly = true
deps = [
"../../gn:default_deps",
"../protozero",
]
sources = [
"test/scattered_stream_delegate_for_testing.cc",
"test/scattered_stream_delegate_for_testing.h",
]
}
source_set("ftrace_reader_unittests") {
testonly = true
deps = [
":ftrace_reader",
":test_support",
"../../gn:default_deps",
"../../gn:gtest_deps",
"../../protos/ftrace:lite",
]
sources = [
"cpu_reader_unittest.cc",
"event_info_unittest.cc",
"format_parser_unittest.cc",
"ftrace_controller_unittest.cc",
"ftrace_to_proto_unittest.cc",
"proto_translation_table_unittest.cc",
]
}
# These tests require access to a real ftrace implementation and must
# run with sudo.
executable("ftrace_reader_integrationtests") {
testonly = true
deps = [
":ftrace_reader",
":test_support",
"../../gn:default_deps",
"../../gn:gtest_deps",
"../../protos/ftrace:full",
"../base",
]
sources = [
"end_to_end_integrationtest.cc",
"ftrace_procfs_integrationtest.cc",
]
}
executable("ftrace_reader_demo") {
testonly = true
sources = [
"main.cc",
]
deps = [
":ftrace_reader",
":test_support",
"../../gn:default_deps",
"../../gn:gtest_prod_config",
"../base",
]
}
source_set("ftrace_reader") {
public_deps = [
"../../include/perfetto/ftrace_reader",
"../../protos/ftrace:zero",
]
deps = [
"../../gn:default_deps",
"../../gn:gtest_prod_config",
"../base",
"../protozero",
]
sources = [
"cpu_reader.cc",
"cpu_reader.h",
"event_info.cc",
"event_info.h",
"format_parser.cc",
"ftrace_controller.cc",
"ftrace_procfs.cc",
"ftrace_procfs.h",
"ftrace_to_proto.cc",
"proto_translation_table.cc",
"proto_translation_table.h",
]
}