diff --git a/src/builder.h b/src/builder.h index f6913cd1..27d5a06f 100644 --- a/src/builder.h +++ b/src/builder.h @@ -49,24 +49,10 @@ class Builder { // Adds a string to the profile string table if not already present. // Returns a unique integer id for this string. int64_t StringId(absl::string_view str); - [[deprecated("Use absl::string_view instead.")]] ABSL_REFACTOR_INLINE int64_t - StringId(const char* str) { - return StringId(absl::NullSafeStringView(str)); + [[deprecated("Use StringId instead.")]] ABSL_REFACTOR_INLINE int64_t + StringIdForMigration(absl::string_view str) { + return StringId(str); } -#if ABSL_HAVE_ATTRIBUTE(enable_if) - [[deprecated("Use absl::string_view instead.")]] ABSL_REFACTOR_INLINE int64_t - StringId(const char* str) __attribute__((enable_if(str != nullptr, ""))) { - return StringIdForMigration(str); - } -#endif - // This overload is only for migration. It allows us to avoid - // `absl::NullSafeStringView` for strings we can statically prove are not - // null. - // - // This will be marked for inlining once all callers of - // `StringId(const char*)` are migrated. Before then, we may run into inlining - // cycles or less-than-readable inlining. - int64_t StringIdForMigration(absl::string_view str) { return StringId(str); } // Adds a function with these attributes to the profile function // table, if not already present. Returns a unique integer id for diff --git a/src/perf_data_handler_test.cc b/src/perf_data_handler_test.cc index ddb9f65e..37a9dde5 100644 --- a/src/perf_data_handler_test.cc +++ b/src/perf_data_handler_test.cc @@ -170,8 +170,7 @@ class TestPerfDataHandler : public PerfDataHandler { private: // Ensure necessary information contained in the BranchStackEntry is also // present in the resulting profile. - inline void CheckBranchEquality(BranchStackEntry expected, - BranchStackPair actual) { + void CheckBranchEquality(BranchStackEntry expected, BranchStackPair actual) { EXPECT_EQ(expected.from_ip(), actual.from.ip); EXPECT_EQ(expected.to_ip(), actual.to.ip); EXPECT_EQ(expected.mispredicted(), actual.mispredicted); diff --git a/src/quipper/BUILD b/src/quipper/BUILD index f76d54b8..3cdde04d 100644 --- a/src/quipper/BUILD +++ b/src/quipper/BUILD @@ -242,15 +242,20 @@ cc_library( hdrs = ["address_context.h"], visibility = ["//src:__subpackages__"], deps = [ + ":compat", ":kernel", - ":perf_data_cc_proto", ], ) cc_library( name = "address_mapper", srcs = ["address_mapper.cc"], - hdrs = ["address_mapper.h"], + hdrs = [ + "address_mapper.h", + "compat/check.h", + "compat/non_cros/detail/check.h", + ], + includes = ["compat/non_cros"], deps = [ ":base", ], @@ -365,8 +370,8 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":binary_data_utils", + ":compat", ":kernel", - ":perf_data_cc_proto", ":base", ], ) diff --git a/src/quipper/address_context.cc b/src/quipper/address_context.cc index 1bb9531f..d8865013 100644 --- a/src/quipper/address_context.cc +++ b/src/quipper/address_context.cc @@ -1,7 +1,7 @@ #include "address_context.h" +#include "compat/proto.h" #include "kernel/perf_event.h" -#include "src/quipper/perf_data.pb.h" namespace quipper { diff --git a/src/quipper/address_context.h b/src/quipper/address_context.h index dafb1931..411436e9 100644 --- a/src/quipper/address_context.h +++ b/src/quipper/address_context.h @@ -1,8 +1,8 @@ #ifndef PERF_DATA_CONVERTER_SRC_QUIPPER_ADDRESS_CONTEXT_H_ #define PERF_DATA_CONVERTER_SRC_QUIPPER_ADDRESS_CONTEXT_H_ +#include "compat/proto.h" #include "kernel/perf_event.h" -#include "src/quipper/perf_data.pb.h" namespace quipper { diff --git a/src/quipper/address_mapper.h b/src/quipper/address_mapper.h index ec4b6891..0958685e 100644 --- a/src/quipper/address_mapper.h +++ b/src/quipper/address_mapper.h @@ -11,7 +11,7 @@ #include #include -#include "base/logging.h" +#include "compat/check.h" namespace quipper { diff --git a/src/quipper/compat/check.h b/src/quipper/compat/check.h new file mode 100644 index 00000000..b5f93ec5 --- /dev/null +++ b/src/quipper/compat/check.h @@ -0,0 +1,10 @@ +// Copyright 2026 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMIUMOS_WIDE_PROFILING_COMPAT_CHECK_H_ +#define CHROMIUMOS_WIDE_PROFILING_COMPAT_CHECK_H_ + +#include "detail/check.h" + +#endif // CHROMIUMOS_WIDE_PROFILING_COMPAT_CHECK_H_ diff --git a/src/quipper/compat/cros/detail/check.h b/src/quipper/compat/cros/detail/check.h new file mode 100644 index 00000000..7ffe6caf --- /dev/null +++ b/src/quipper/compat/cros/detail/check.h @@ -0,0 +1,10 @@ +// Copyright 2026 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMIUMOS_WIDE_PROFILING_COMPAT_CROS_DETAIL_CHECK_H_ +#define CHROMIUMOS_WIDE_PROFILING_COMPAT_CROS_DETAIL_CHECK_H_ + +#include "base/check.h" + +#endif // CHROMIUMOS_WIDE_PROFILING_COMPAT_CROS_DETAIL_CHECK_H_ diff --git a/src/quipper/compat/non_cros/detail/check.h b/src/quipper/compat/non_cros/detail/check.h new file mode 100644 index 00000000..a6a0568d --- /dev/null +++ b/src/quipper/compat/non_cros/detail/check.h @@ -0,0 +1,10 @@ +// Copyright 2026 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMIUMOS_WIDE_PROFILING_COMPAT_EXT_DETAIL_CHECK_H_ +#define CHROMIUMOS_WIDE_PROFILING_COMPAT_EXT_DETAIL_CHECK_H_ + +#include "base/logging.h" + +#endif // CHROMIUMOS_WIDE_PROFILING_COMPAT_EXT_DETAIL_CHECK_H_ diff --git a/src/quipper/compat/proto.h b/src/quipper/compat/proto.h index 118bf913..c2227048 100644 --- a/src/quipper/compat/proto.h +++ b/src/quipper/compat/proto.h @@ -5,7 +5,7 @@ #ifndef CHROMIUMOS_WIDE_PROFILING_COMPAT_PROTO_H_ #define CHROMIUMOS_WIDE_PROFILING_COMPAT_PROTO_H_ -#include "src/quipper/perf_data.pb.h" +#include "perf_data.pb.h" #include "perf_parser_options.pb.h" #include "perf_stat.pb.h" #include "google/protobuf//arena.h" diff --git a/src/quipper/perf_data_utils.cc b/src/quipper/perf_data_utils.cc index 1a54767c..0e3a2a93 100644 --- a/src/quipper/perf_data_utils.cc +++ b/src/quipper/perf_data_utils.cc @@ -11,9 +11,9 @@ #include #include "base/logging.h" +#include "compat/proto.h" #include "kernel/perf_event.h" #include "kernel/perf_internals.h" -#include "src/quipper/perf_data.pb.h" namespace quipper {