Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions src/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/perf_data_handler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 8 additions & 3 deletions src/quipper/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand Down Expand Up @@ -365,8 +370,8 @@ cc_library(
visibility = ["//visibility:public"],
deps = [
":binary_data_utils",
":compat",
":kernel",
":perf_data_cc_proto",
":base",
],
)
Expand Down
2 changes: 1 addition & 1 deletion src/quipper/address_context.cc
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion src/quipper/address_context.h
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion src/quipper/address_mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <list>
#include <map>

#include "base/logging.h"
#include "compat/check.h"

namespace quipper {

Expand Down
10 changes: 10 additions & 0 deletions src/quipper/compat/check.h
Original file line number Diff line number Diff line change
@@ -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_
10 changes: 10 additions & 0 deletions src/quipper/compat/cros/detail/check.h
Original file line number Diff line number Diff line change
@@ -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_
10 changes: 10 additions & 0 deletions src/quipper/compat/non_cros/detail/check.h
Original file line number Diff line number Diff line change
@@ -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_
2 changes: 1 addition & 1 deletion src/quipper/compat/proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/quipper/perf_data_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <string>

#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 {

Expand Down
Loading