xref: /aosp_15_r20/external/blktrace/Android.bp (revision 1a3d31e37cc95e9919fd86900a2b6a555f55952c)
1// Copyright 2018 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
15package {
16    default_applicable_licenses: ["external_blktrace_license"],
17}
18
19// Added automatically by a large-scale-change that took the approach of
20// 'apply every license found to every target'. While this makes sure we respect
21// every license restriction, it may not be entirely correct.
22//
23// e.g. GPL in an MIT project might only apply to the contrib/ directory.
24//
25// Please consider splitting the single license below into multiple licenses,
26// taking care not to lose any license_kind information, and overriding the
27// default license using the 'licenses: [...]' property on targets as needed.
28//
29// For unused files, consider creating a 'fileGroup' with "//visibility:private"
30// to attach the license to, and including a comment whether the files may be
31// used in the current project.
32//
33// large-scale-change included anything that looked like it might be a license
34// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
35//
36// Please consider removing redundant or irrelevant files from 'license_text:'.
37// See: http://go/android-license-faq
38license {
39    name: "external_blktrace_license",
40    visibility: [":__subpackages__"],
41    license_kinds: [
42        "SPDX-license-identifier-GPL",
43        "SPDX-license-identifier-GPL-2.0",
44        "SPDX-license-identifier-LGPL",
45        "legacy_unencumbered",
46    ],
47    license_text: [
48        "COPYING",
49        "LICENSE",
50        "NOTICE",
51    ],
52}
53
54cc_defaults {
55    name: "blktrace_defaults",
56    include_dirs: [
57        "external/blktrace",
58        "external/blktrace/btt",
59    ],
60    c_std: "gnu17",
61    cflags: [
62        "-O2",
63        "-g",
64        "-W",
65        "-Wall",
66        "-D_GNU_SOURCE",
67        "-D_LARGEFILE_SOURCE",
68        "-D_FILE_OFFSET_BITS=64",
69        "-Wno-implicit-function-declaration",
70        "-Wno-pointer-arith",
71        "-Wno-unused-function",
72    ],
73}
74
75cc_binary {
76    name: "blkparse",
77    defaults: ["blktrace_defaults"],
78    srcs: [
79        "blkparse.c",
80        "blkparse_fmt.c",
81        "rbtree.c",
82        "act_mask.c",
83        "strverscmp.c",
84    ],
85
86}
87
88cc_binary {
89    name: "blktrace",
90    defaults: ["blktrace_defaults"],
91    srcs: [
92        "blktrace.c",
93        "act_mask.c",
94    ],
95}
96
97cc_binary {
98    name: "verify_blkparse",
99    defaults: ["blktrace_defaults"],
100    srcs: ["verify_blkparse.c"],
101    include_dirs: ["external/blktrace/"],
102}
103
104cc_binary {
105    name: "blkrawverify",
106    defaults: ["blktrace_defaults"],
107    srcs: ["blkrawverify.c"],
108}
109
110cc_binary {
111    name: "blkiomon",
112    defaults: ["blktrace_defaults"],
113    srcs: [
114        "blkiomon.c",
115        "rbtree.c",
116    ],
117}
118
119cc_binary {
120    name: "btt",
121    defaults: ["blktrace_defaults"],
122    srcs: [
123        "btt/args.c",
124        "btt/bt_timeline.c",
125        "btt/devmap.c",
126        "btt/devs.c",
127        "btt/dip_rb.c",
128        "btt/iostat.c",
129        "btt/latency.c",
130        "btt/misc.c",
131        "btt/output.c",
132        "btt/proc.c",
133        "btt/seek.c",
134        "btt/trace.c",
135        "btt/trace_complete.c",
136        "btt/trace_im.c",
137        "btt/trace_issue.c",
138        "btt/trace_queue.c",
139        "btt/trace_remap.c",
140        "btt/trace_requeue.c",
141        "rbtree.c",
142        "btt/mmap.c",
143        "btt/trace_plug.c",
144        "btt/bno_dump.c",
145        "btt/unplug_hist.c",
146        "btt/q2d.c",
147        "btt/aqd.c",
148        "btt/plat.c",
149        "btt/p_live.c",
150        "btt/rstats.c",
151    ],
152}
153