summaryrefslogtreecommitdiff
path: root/absl/strings/internal
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-04-20 07:17:48 -0700
committerGravatar Dino Radaković <dinor@google.com>2021-04-20 08:45:46 -0700
commit1ae9b71c474628d60eb251a3f62967fe64151bb2 (patch)
treecb4fb71be788b327f78bd0d2fc8ec7b4f2a022c5 /absl/strings/internal
parent732c6540c19610d2653ce73c09eb6cb66da15f42 (diff)
Export of internal Abseil changes
-- ac1df60490c9583e475e22de7adfc40023196fbf by Martijn Vels <mvels@google.com>: Change Cord constructor(string_view) to explicit make_tree and Cordz tracking This CL changes the ctor to use an easier to maintain model where Cord code explicitly invokes Cordz update or new / tree logic, which avoids the ambiguity of the 'branched' InlineRep::set_tree code. This removes the need to equip InlineRep with 'MethodIdentifier' or other necessary call info, and also is a cleaner model: InlineRep is carrying too much code now that should plainly sit in Cord, especially with all internal abstractions having moved to InlineData. See child CL(s) for desired state PiperOrigin-RevId: 369433619 -- b665af7f586e6c679a8b27d4f78d5a1d2b596058 by Abseil Team <absl-team@google.com>: Rename the 'Compare' template type to 'LessThan', as the passed-in function is expected to act like operator<. It is worth avoiding confusion with std::compare, which returns an int (-1/0/1), as due to implicit casting this can lead to hard-to-spot bugs. PiperOrigin-RevId: 369391118 -- c3c775269cad0f4982ec63f3616dd78bb9e52dca by Martijn Vels <mvels@google.com>: Integrate CordzUpdateTracker into CordzInfo PiperOrigin-RevId: 369348824 -- 771d81ed357496c117179e1daec76eba5155932d by Martijn Vels <mvels@google.com>: Replace mutex() with Lock() / Unlock() function Mini design future tracking of CordzInfo sampled cords: CordzInfo holds a CordRep* reference without a reference count. Cord is responsible for synchronizing updates for sampled cords such that the CordRep* contained in CordzInfo is at all times valid. This is done by scoping Lock() and Unlock() calls around the code modifying the code of a sampled cord. For example (using the future CL CordzUpdateScope()): CordzInfo* cordz_info = get_cordz_info(); CordzUpdateScope scope(cordz_info, CordzUpdateTracker::kRemovePrefix); CordRep* rep = RemovePrefixImpl(root); set_tree(rep); if (cordz_info) { cordz_info->SetCordRep(rep); } On CordzInfo::Unlock(), if the internal rep is null, the cord is no longer sampled, and CordzInfo will be deleted. Thus any update resulting in the Cord being inlined will automatically no longer be sampled. PiperOrigin-RevId: 369338802 -- 5563c12df04a1e965a03b50bdd032739c55c0706 by Martijn Vels <mvels@google.com>: Add UpdateTracker to CordzStatistics PiperOrigin-RevId: 369318178 -- 6b4d8463722a3e55a3e8f6cb3741a41055e7f83e by Martijn Vels <mvels@google.com>: Add kClear, kConstructor* and kUnknown values and fix typo PiperOrigin-RevId: 369297163 -- 041adcbc929789d6d53371a8236840fc350e1eeb by Derek Mauro <dmauro@google.com>: Switch from malloc to operator new in pool_urbg.cc so it can only fail by throwing/aborting PiperOrigin-RevId: 369274087 -- 5d97a5f43e3f2d02d0a5bbe586d93b5751812981 by Benjamin Barenblat <bbaren@google.com>: Correct Thumb function bound computation in the symbolizer On 32-bit ARM, all functions are aligned to multiples of two bytes, and the lowest-order bit in a function’s address is ignored by the CPU when computing branch targets. That bit is still present in instructions and ELF symbol tables, though; it’s repurposed to indicate whether the function contains ARM or Thumb code. If the symbolizer doesn’t ignore that bit, it will believe Thumb functions have boundaries that are off by one byte, so instruct the symbolizer to null out the lowest-order bit after retrieving it from the symbol table. PiperOrigin-RevId: 369254082 -- 462bb307c6cc332c1e2c3adb5f0cad51804bf937 by Derek Mauro <dmauro@google.com>: Add a check for malloc failure in pool_urbg.cc GitHub #940 PiperOrigin-RevId: 369238100 GitOrigin-RevId: ac1df60490c9583e475e22de7adfc40023196fbf Change-Id: Ic6ec91c62cd3a0031f6a75a43a83da959ece2d25
Diffstat (limited to 'absl/strings/internal')
-rw-r--r--absl/strings/internal/cordz_info.cc78
-rw-r--r--absl/strings/internal/cordz_info.h67
-rw-r--r--absl/strings/internal/cordz_info_test.cc76
-rw-r--r--absl/strings/internal/cordz_statistics.h12
-rw-r--r--absl/strings/internal/cordz_update_tracker.h22
-rw-r--r--absl/strings/internal/cordz_update_tracker_test.cc25
6 files changed, 220 insertions, 60 deletions
diff --git a/absl/strings/internal/cordz_info.cc b/absl/strings/internal/cordz_info.cc
index 4dec63d5..6540d134 100644
--- a/absl/strings/internal/cordz_info.cc
+++ b/absl/strings/internal/cordz_info.cc
@@ -19,6 +19,7 @@
#include "absl/strings/internal/cord_internal.h"
#include "absl/strings/internal/cordz_handle.h"
#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
#include "absl/synchronization/mutex.h"
#include "absl/types/span.h"
@@ -44,18 +45,15 @@ CordzInfo* CordzInfo::Next(const CordzSnapshot& snapshot) const {
return ci_next_unsafe();
}
-CordzInfo* CordzInfo::TrackCord(CordRep* rep, const CordzInfo* src) {
- CordzInfo* ci = new CordzInfo(rep);
- if (src) {
- ci->parent_stack_depth_ = src->stack_depth_;
- memcpy(ci->parent_stack_, src->stack_, sizeof(void*) * src->stack_depth_);
- }
+CordzInfo* CordzInfo::TrackCord(CordRep* rep, const CordzInfo* src,
+ MethodIdentifier method) {
+ CordzInfo* ci = new CordzInfo(rep, src, method);
ci->Track();
return ci;
}
-CordzInfo* CordzInfo::TrackCord(CordRep* rep) {
- return TrackCord(rep, nullptr);
+CordzInfo* CordzInfo::TrackCord(CordRep* rep, MethodIdentifier method) {
+ return TrackCord(rep, nullptr, method);
}
void CordzInfo::UntrackCord(CordzInfo* cordz_info) {
@@ -66,12 +64,35 @@ void CordzInfo::UntrackCord(CordzInfo* cordz_info) {
}
}
-CordzInfo::CordzInfo(CordRep* rep)
+CordzInfo::MethodIdentifier CordzInfo::GetParentMethod(const CordzInfo* src) {
+ if (src == nullptr) return MethodIdentifier::kUnknown;
+ return src->parent_method_ != MethodIdentifier::kUnknown ? src->parent_method_
+ : src->method_;
+}
+
+int CordzInfo::FillParentStack(const CordzInfo* src, void** stack) {
+ assert(stack);
+ if (src == nullptr) return 0;
+ if (src->parent_stack_depth_) {
+ memcpy(stack, src->parent_stack_, src->parent_stack_depth_ * sizeof(void*));
+ return src->parent_stack_depth_;
+ }
+ memcpy(stack, src->stack_, src->stack_depth_ * sizeof(void*));
+ return src->stack_depth_;
+}
+
+CordzInfo::CordzInfo(CordRep* rep, const CordzInfo* src,
+ MethodIdentifier method)
: rep_(rep),
stack_depth_(absl::GetStackTrace(stack_, /*max_depth=*/kMaxStackDepth,
/*skip_count=*/1)),
- parent_stack_depth_(0),
- create_time_(absl::Now()) {}
+ parent_stack_depth_(FillParentStack(src, parent_stack_)),
+ method_(method),
+ parent_method_(GetParentMethod(src)),
+ create_time_(absl::Now()),
+ size_(rep->length) {
+ update_tracker_.LossyAdd(method);
+}
CordzInfo::~CordzInfo() {
// `rep_` is potentially kept alive if CordzInfo is included
@@ -96,7 +117,7 @@ void CordzInfo::Untrack() {
{
// TODO(b/117940323): change this to assuming ownership instead once all
// Cord logic is properly keeping `rep_` in sync with the Cord root rep.
- absl::MutexLock lock(&mutex());
+ absl::MutexLock lock(&mutex_);
rep_ = nullptr;
}
@@ -120,9 +141,31 @@ void CordzInfo::Untrack() {
}
}
+void CordzInfo::Lock(MethodIdentifier method)
+ ABSL_EXCLUSIVE_LOCK_FUNCTION(mutex_) {
+ mutex_.Lock();
+ update_tracker_.LossyAdd(method);
+ assert(rep_);
+}
+
+void CordzInfo::Unlock() ABSL_UNLOCK_FUNCTION(mutex_) {
+ bool tracked = rep_ != nullptr;
+ if (rep_) {
+ size_.store(rep_->length);
+ }
+ mutex_.Unlock();
+ if (!tracked) {
+ Untrack();
+ CordzHandle::Delete(this);
+ }
+}
+
void CordzInfo::SetCordRep(CordRep* rep) {
- mutex().AssertHeld();
+ mutex_.AssertHeld();
rep_ = rep;
+ if (rep) {
+ size_.store(rep->length);
+ }
}
absl::Span<void* const> CordzInfo::GetStack() const {
@@ -133,6 +176,15 @@ absl::Span<void* const> CordzInfo::GetParentStack() const {
return absl::MakeConstSpan(parent_stack_, parent_stack_depth_);
}
+CordzStatistics CordzInfo::GetCordzStatistics() const {
+ CordzStatistics stats;
+ stats.method = method_;
+ stats.parent_method = parent_method_;
+ stats.update_tracker = update_tracker_;
+ stats.size = size_.load(std::memory_order_relaxed);
+ return stats;
+}
+
} // namespace cord_internal
ABSL_NAMESPACE_END
} // namespace absl
diff --git a/absl/strings/internal/cordz_info.h b/absl/strings/internal/cordz_info.h
index c1090a1c..5345be75 100644
--- a/absl/strings/internal/cordz_info.h
+++ b/absl/strings/internal/cordz_info.h
@@ -24,6 +24,7 @@
#include "absl/strings/internal/cord_internal.h"
#include "absl/strings/internal/cordz_handle.h"
#include "absl/strings/internal/cordz_statistics.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
#include "absl/synchronization/mutex.h"
#include "absl/types/span.h"
@@ -42,13 +43,20 @@ namespace cord_internal {
// the destructor of a CordzSampleToken object.
class CordzInfo : public CordzHandle {
public:
+ using MethodIdentifier = CordzUpdateTracker::MethodIdentifier;
+
// All profiled Cords should be accompanied by a call to TrackCord.
// TrackCord creates a CordzInfo instance which tracks important metrics of
// the sampled cord. CordzInfo instances are placed in a global list which is
// used to discover and snapshot all actively tracked cords.
// Callers are responsible for calling UntrackCord() before the tracked Cord
// instance is deleted, or to stop tracking the sampled Cord.
- static CordzInfo* TrackCord(CordRep* rep);
+ // Callers are also responsible for guarding changes to `rep` through the
+ // Lock() and Unlock() calls, and calling SetCordRep() if the root of the
+ // sampled cord changes before the old root has been unreffed and/or deleted.
+ // `method` identifies the Cord method which initiated the cord to be sampled.
+ static CordzInfo* TrackCord(
+ CordRep* rep, MethodIdentifier method = MethodIdentifier::kUnknown);
// Stops tracking changes for a sampled cord, and deletes the provided info.
// This function must be called before the sampled cord instance is deleted,
@@ -58,10 +66,12 @@ class CordzInfo : public CordzHandle {
static void UntrackCord(CordzInfo* cordz_info);
// Identical to TrackCord(), except that this function fills the
- // 'parent_stack' property of the returned CordzInfo instance from the
- // provided `src` instance if `src` is not null.
+ // `parent_stack` and `parent_method` properties of the returned CordzInfo
+ // instance from the provided `src` instance if `src` is not null.
// This function should be used for sampling 'copy constructed' cords.
- static CordzInfo* TrackCord(CordRep* rep, const CordzInfo* src);
+ static CordzInfo* TrackCord(
+ CordRep* rep, const CordzInfo* src,
+ MethodIdentifier method = MethodIdentifier::kUnknown);
CordzInfo() = delete;
CordzInfo(const CordzInfo&) = delete;
@@ -73,17 +83,20 @@ class CordzInfo : public CordzHandle {
// Retrieves the next oldest existing CordzInfo older than 'this' instance.
CordzInfo* Next(const CordzSnapshot& snapshot) const;
- // Returns a reference to the mutex guarding the `rep` property of this
- // instance. CordzInfo instances hold a weak reference to the rep pointer of
- // sampled cords, and rely on Cord logic to update the rep pointer when the
- // underlying root tree or ring of the cord changes.
- absl::Mutex& mutex() const { return mutex_; }
+ // Locks this instance for the update identified by `method`.
+ // Increases the count for `method` in `update_tracker`.
+ void Lock(MethodIdentifier method) ABSL_EXCLUSIVE_LOCK_FUNCTION(mutex_);
+
+ // Unlocks this instance. If the contained `rep` has been set to null
+ // indicating the Cord has been cleared or is otherwise no longer sampled,
+ // then this method will delete this CordzInfo instance.
+ void Unlock() ABSL_UNLOCK_FUNCTION(mutex_);
// Updates the `rep' property of this instance. This methods is invoked by
// Cord logic each time the root node of a sampled Cord changes, and before
// the old root reference count is deleted. This guarantees that collection
// code can always safely take a reference on the tracked cord.
- // Requires `mutex()` to be held.
+ // Requires a lock to be held through the `Lock()` method.
// TODO(b/117940323): annotate with ABSL_EXCLUSIVE_LOCKS_REQUIRED once all
// Cord code is in a state where this can be proven true by the compiler.
void SetCordRep(CordRep* rep);
@@ -106,15 +119,10 @@ class CordzInfo : public CordzHandle {
// from, or being assigned the value of an existing (sampled) cord.
absl::Span<void* const> GetParentStack() const;
- // Retrieve the CordzStatistics associated with this Cord. The statistics are
- // only updated when a Cord goes through a mutation, such as an Append or
- // RemovePrefix. The refcounts can change due to external events, so the
- // reported refcount stats might be incorrect.
- CordzStatistics GetCordzStatistics() const {
- CordzStatistics stats;
- stats.size = size_.load(std::memory_order_relaxed);
- return stats;
- }
+ // Retrieves the CordzStatistics associated with this Cord. The statistics
+ // are only updated when a Cord goes through a mutation, such as an Append
+ // or RemovePrefix.
+ CordzStatistics GetCordzStatistics() const;
// Records size metric for this CordzInfo instance.
void RecordMetrics(int64_t size) {
@@ -124,9 +132,21 @@ class CordzInfo : public CordzHandle {
private:
static constexpr int kMaxStackDepth = 64;
- explicit CordzInfo(CordRep* tree);
+ explicit CordzInfo(CordRep* rep, const CordzInfo* src,
+ MethodIdentifier method);
~CordzInfo() override;
+ // Returns the parent method from `src`, which is either `parent_method_` or
+ // `method_` depending on `parent_method_` being kUnknown.
+ // Returns kUnknown if `src` is null.
+ static MethodIdentifier GetParentMethod(const CordzInfo* src);
+
+ // Fills the provided stack from `src`, copying either `parent_stack_` or
+ // `stack_` depending on `parent_stack_` being empty, returning the size of
+ // the parent stack.
+ // Returns 0 if `src` is null.
+ static int FillParentStack(const CordzInfo* src, void** stack);
+
void Track();
void Untrack();
@@ -149,12 +169,15 @@ class CordzInfo : public CordzHandle {
std::atomic<CordzInfo*> ci_next_ ABSL_GUARDED_BY(ci_mutex_){nullptr};
mutable absl::Mutex mutex_;
- CordRep* rep_ ABSL_GUARDED_BY(mutex());
+ CordRep* rep_ ABSL_GUARDED_BY(mutex_);
void* stack_[kMaxStackDepth];
void* parent_stack_[kMaxStackDepth];
const int stack_depth_;
- int parent_stack_depth_;
+ const int parent_stack_depth_;
+ const MethodIdentifier method_;
+ const MethodIdentifier parent_method_;
+ CordzUpdateTracker update_tracker_;
const absl::Time create_time_;
// Last recorded size for the cord.
diff --git a/absl/strings/internal/cordz_info_test.cc b/absl/strings/internal/cordz_info_test.cc
index be20e4a4..66acf9b6 100644
--- a/absl/strings/internal/cordz_info_test.cc
+++ b/absl/strings/internal/cordz_info_test.cc
@@ -23,6 +23,7 @@
#include "absl/debugging/symbolize.h"
#include "absl/strings/internal/cord_rep_flat.h"
#include "absl/strings/internal/cordz_handle.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
@@ -47,6 +48,12 @@ struct TestCordRep {
~TestCordRep() { CordRepFlat::Delete(rep); }
};
+// Used test values
+auto constexpr kUnknownMethod = CordzUpdateTracker::kUnknown;
+auto constexpr kTrackCordMethod = CordzUpdateTracker::kConstructorString;
+auto constexpr kChildMethod = CordzUpdateTracker::kConstructorCord;
+auto constexpr kUpdateMethod = CordzUpdateTracker::kAppendString;
+
// Local less verbose helper
std::vector<const CordzHandle*> DeleteQueue() {
return CordzHandle::DiagnosticsGetDeleteQueue();
@@ -90,15 +97,27 @@ TEST(CordzInfoTest, SetCordRep) {
CordzInfo* info = CordzInfo::TrackCord(rep.rep);
TestCordRep rep2;
- {
- absl::MutexLock lock(&info->mutex());
- info->SetCordRep(rep2.rep);
- }
+ info->Lock(CordzUpdateTracker::kAppendCord);
+ info->SetCordRep(rep2.rep);
+ info->Unlock();
EXPECT_THAT(info->GetCordRepForTesting(), Eq(rep2.rep));
CordzInfo::UntrackCord(info);
}
+TEST(CordzInfoTest, SetCordRepNullUntracksCordOnUnlock) {
+ TestCordRep rep;
+ CordzInfo* info = CordzInfo::TrackCord(rep.rep);
+
+ info->Lock(CordzUpdateTracker::kAppendString);
+ info->SetCordRep(nullptr);
+ EXPECT_THAT(info->GetCordRepForTesting(), Eq(nullptr));
+ EXPECT_THAT(CordzInfo::Head(CordzSnapshot()), Eq(info));
+
+ info->Unlock();
+ EXPECT_THAT(CordzInfo::Head(CordzSnapshot()), Eq(nullptr));
+}
+
#if GTEST_HAS_DEATH_TEST
TEST(CordzInfoTest, SetCordRepRequiresMutex) {
@@ -191,13 +210,41 @@ TEST(CordzInfoTest, StackV2) {
// Local helper functions to get different stacks for child and parent.
CordzInfo* TrackChildCord(CordRep* rep, const CordzInfo* parent) {
- return CordzInfo::TrackCord(rep, parent);
+ return CordzInfo::TrackCord(rep, parent, kChildMethod);
}
CordzInfo* TrackParentCord(CordRep* rep) {
- return CordzInfo::TrackCord(rep);
+ return CordzInfo::TrackCord(rep, kTrackCordMethod);
}
-TEST(CordzInfoTest, ParentStackV2) {
+TEST(CordzInfoTest, GetStatistics) {
+ TestCordRep rep;
+ CordzInfo* info = TrackParentCord(rep.rep);
+
+ CordzStatistics statistics = info->GetCordzStatistics();
+ EXPECT_THAT(statistics.size, Eq(rep.rep->length));
+ EXPECT_THAT(statistics.method, Eq(kTrackCordMethod));
+ EXPECT_THAT(statistics.parent_method, Eq(kUnknownMethod));
+ EXPECT_THAT(statistics.update_tracker.Value(kTrackCordMethod), Eq(1));
+
+ CordzInfo::UntrackCord(info);
+}
+
+TEST(CordzInfoTest, LockCountsMethod) {
+ TestCordRep rep;
+ CordzInfo* info = TrackParentCord(rep.rep);
+
+ info->Lock(kUpdateMethod);
+ info->Unlock();
+ info->Lock(kUpdateMethod);
+ info->Unlock();
+
+ CordzStatistics statistics = info->GetCordzStatistics();
+ EXPECT_THAT(statistics.update_tracker.Value(kUpdateMethod), Eq(2));
+
+ CordzInfo::UntrackCord(info);
+}
+
+TEST(CordzInfoTest, FromParent) {
TestCordRep rep;
CordzInfo* info_parent = TrackParentCord(rep.rep);
CordzInfo* info_child = TrackChildCord(rep.rep, info_parent);
@@ -206,18 +253,29 @@ TEST(CordzInfoTest, ParentStackV2) {
std::string parent_stack = FormatStack(info_child->GetParentStack());
EXPECT_THAT(stack, Eq(parent_stack));
+ CordzStatistics statistics = info_child->GetCordzStatistics();
+ EXPECT_THAT(statistics.size, Eq(rep.rep->length));
+ EXPECT_THAT(statistics.method, Eq(kChildMethod));
+ EXPECT_THAT(statistics.parent_method, Eq(kTrackCordMethod));
+ EXPECT_THAT(statistics.update_tracker.Value(kChildMethod), Eq(1));
+
CordzInfo::UntrackCord(info_parent);
CordzInfo::UntrackCord(info_child);
}
-TEST(CordzInfoTest, ParentStackEmpty) {
+TEST(CordzInfoTest, FromParentNullptr) {
TestCordRep rep;
CordzInfo* info = TrackChildCord(rep.rep, nullptr);
EXPECT_TRUE(info->GetParentStack().empty());
+ CordzStatistics statistics = info->GetCordzStatistics();
+ EXPECT_THAT(statistics.size, Eq(rep.rep->length));
+ EXPECT_THAT(statistics.method, Eq(kChildMethod));
+ EXPECT_THAT(statistics.parent_method, Eq(kUnknownMethod));
+ EXPECT_THAT(statistics.update_tracker.Value(kChildMethod), Eq(1));
CordzInfo::UntrackCord(info);
}
-TEST(CordzInfoTest, CordzStatisticsV2) {
+TEST(CordzInfoTest, RecordMetrics) {
TestCordRep rep;
CordzInfo* info = TrackParentCord(rep.rep);
diff --git a/absl/strings/internal/cordz_statistics.h b/absl/strings/internal/cordz_statistics.h
index ce7c39aa..6e335c0b 100644
--- a/absl/strings/internal/cordz_statistics.h
+++ b/absl/strings/internal/cordz_statistics.h
@@ -18,6 +18,7 @@
#include <cstdint>
#include "absl/base/config.h"
+#include "absl/strings/internal/cordz_update_tracker.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
@@ -25,6 +26,8 @@ namespace cord_internal {
// CordzStatistics captures some meta information about a Cord's shape.
struct CordzStatistics {
+ using MethodIdentifier = CordzUpdateTracker::MethodIdentifier;
+
// The size of the cord in bytes. This matches the result of Cord::size().
int64_t size = 0;
@@ -46,6 +49,15 @@ struct CordzStatistics {
// For ring buffer Cords, this includes the 'ring buffer' node.
// A value of 0 implies the property has not been recorded.
int64_t node_count = 0;
+
+ // The cord method responsible for sampling the cord.
+ MethodIdentifier method = MethodIdentifier::kUnknown;
+
+ // The cord method responsible for sampling the parent cord if applicable.
+ MethodIdentifier parent_method = MethodIdentifier::kUnknown;
+
+ // Update tracker tracking invocation count per cord method.
+ CordzUpdateTracker update_tracker;
};
} // namespace cord_internal
diff --git a/absl/strings/internal/cordz_update_tracker.h b/absl/strings/internal/cordz_update_tracker.h
index 3c617e93..a090676d 100644
--- a/absl/strings/internal/cordz_update_tracker.h
+++ b/absl/strings/internal/cordz_update_tracker.h
@@ -38,20 +38,24 @@ class CordzUpdateTracker {
public:
// Tracked update methods.
enum MethodIdentifier {
- kAssignString,
- kAssignCord,
- kMoveAssignCord,
- kAppendString,
+ kUnknown,
kAppendCord,
- kMoveAppendCord,
- kPrependString,
- kPrependCord,
- kMovePrependCord,
kAppendExternalMemory,
+ kAppendString,
+ kAssignCord,
+ kAssignString,
+ kClear,
+ kConstructorCord,
+ kConstructorString,
kFlatten,
kGetAppendRegion,
+ kMoveAppendCord,
+ kMoveAssignCord,
+ kMovePrependCord,
+ kPrependCord,
+ kPrependString,
kRemovePrefix,
- kRemoveSuffic,
+ kRemoveSuffix,
kSubCord,
// kNumMethods defines the number of entries: must be the last entry.
diff --git a/absl/strings/internal/cordz_update_tracker_test.cc b/absl/strings/internal/cordz_update_tracker_test.cc
index 45782046..eda662f2 100644
--- a/absl/strings/internal/cordz_update_tracker_test.cc
+++ b/absl/strings/internal/cordz_update_tracker_test.cc
@@ -36,13 +36,24 @@ using Methods = std::array<Method, Method::kNumMethods>;
// Returns an array of all methods defined in `MethodIdentifier`
Methods AllMethods() {
- return Methods{Method::kAssignString, Method::kAssignCord,
- Method::kMoveAssignCord, Method::kAppendString,
- Method::kAppendCord, Method::kMoveAppendCord,
- Method::kPrependString, Method::kPrependCord,
- Method::kMovePrependCord, Method::kAppendExternalMemory,
- Method::kFlatten, Method::kGetAppendRegion,
- Method::kRemovePrefix, Method::kRemoveSuffic,
+ return Methods{Method::kUnknown,
+ Method::kAppendCord,
+ Method::kAppendExternalMemory,
+ Method::kAppendString,
+ Method::kAssignCord,
+ Method::kAssignString,
+ Method::kClear,
+ Method::kConstructorCord,
+ Method::kConstructorString,
+ Method::kFlatten,
+ Method::kGetAppendRegion,
+ Method::kMoveAppendCord,
+ Method::kMoveAssignCord,
+ Method::kMovePrependCord,
+ Method::kPrependCord,
+ Method::kPrependString,
+ Method::kRemovePrefix,
+ Method::kRemoveSuffix,
Method::kSubCord};
}