From 85de2d2b080e0416c14664208081faf6dff57b8f Mon Sep 17 00:00:00 2001 From: jbassett Date: Wed, 13 May 2026 23:23:46 +0000 Subject: [PATCH 1/4] Remove deprecated StringId overloads PiperOrigin-RevId: 915117713 --- src/builder.h | 20 +++----------------- src/quipper/address_context.cc | 2 +- src/quipper/address_context.h | 2 +- src/quipper/compat/proto.h | 2 +- src/quipper/perf_data_utils.cc | 2 +- 5 files changed, 7 insertions(+), 21 deletions(-) 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/quipper/address_context.cc b/src/quipper/address_context.cc index 1bb9531f..89c01a0e 100644 --- a/src/quipper/address_context.cc +++ b/src/quipper/address_context.cc @@ -1,7 +1,7 @@ #include "address_context.h" #include "kernel/perf_event.h" -#include "src/quipper/perf_data.pb.h" +#include "perf_data.pb.h" namespace quipper { diff --git a/src/quipper/address_context.h b/src/quipper/address_context.h index dafb1931..8961f551 100644 --- a/src/quipper/address_context.h +++ b/src/quipper/address_context.h @@ -2,7 +2,7 @@ #define PERF_DATA_CONVERTER_SRC_QUIPPER_ADDRESS_CONTEXT_H_ #include "kernel/perf_event.h" -#include "src/quipper/perf_data.pb.h" +#include "perf_data.pb.h" namespace quipper { 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..7266a60b 100644 --- a/src/quipper/perf_data_utils.cc +++ b/src/quipper/perf_data_utils.cc @@ -13,7 +13,7 @@ #include "base/logging.h" #include "kernel/perf_event.h" #include "kernel/perf_internals.h" -#include "src/quipper/perf_data.pb.h" +#include "perf_data.pb.h" namespace quipper { From 270e2186d6649df8bc80dfef3c14e9ee84ec870e Mon Sep 17 00:00:00 2001 From: Googler Date: Fri, 29 May 2026 06:49:27 +0000 Subject: [PATCH 2/4] Automated Code Change PiperOrigin-RevId: 923209899 --- src/perf_data_handler_test.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); From 08463a760205204d09f9c9215fa8a81ca3caafa7 Mon Sep 17 00:00:00 2001 From: gmx Date: Thu, 4 Jun 2026 20:02:20 +0000 Subject: [PATCH 3/4] Use the "compat/proto.h" header instead of directly including perf_data.pb.h. Add ":compat" to the BUILD dependencies for the impacted targets. Adjust include path for the "perf_data.pb.h" header. PiperOrigin-RevId: 926843185 --- src/quipper/BUILD | 4 ++-- src/quipper/address_context.cc | 2 +- src/quipper/address_context.h | 2 +- src/quipper/perf_data_utils.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/quipper/BUILD b/src/quipper/BUILD index f76d54b8..98161aef 100644 --- a/src/quipper/BUILD +++ b/src/quipper/BUILD @@ -242,8 +242,8 @@ cc_library( hdrs = ["address_context.h"], visibility = ["//src:__subpackages__"], deps = [ + ":compat", ":kernel", - ":perf_data_cc_proto", ], ) @@ -365,8 +365,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 89c01a0e..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 "perf_data.pb.h" namespace quipper { diff --git a/src/quipper/address_context.h b/src/quipper/address_context.h index 8961f551..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 "perf_data.pb.h" namespace quipper { diff --git a/src/quipper/perf_data_utils.cc b/src/quipper/perf_data_utils.cc index 7266a60b..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 "perf_data.pb.h" namespace quipper { From d99e5cea76354536f364277d23a1fd8230eb3eef Mon Sep 17 00:00:00 2001 From: gmx Date: Thu, 4 Jun 2026 20:51:01 +0000 Subject: [PATCH 4/4] Include the correct header for the CHECK() macro. ChromeOS defines it in "base/check.h" while other systems define it in "base/logging.h". PiperOrigin-RevId: 926868910 --- src/quipper/BUILD | 7 ++++++- src/quipper/address_mapper.h | 2 +- src/quipper/compat/check.h | 10 ++++++++++ src/quipper/compat/cros/detail/check.h | 10 ++++++++++ src/quipper/compat/non_cros/detail/check.h | 10 ++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/quipper/compat/check.h create mode 100644 src/quipper/compat/cros/detail/check.h create mode 100644 src/quipper/compat/non_cros/detail/check.h diff --git a/src/quipper/BUILD b/src/quipper/BUILD index 98161aef..3cdde04d 100644 --- a/src/quipper/BUILD +++ b/src/quipper/BUILD @@ -250,7 +250,12 @@ cc_library( 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", ], 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_