blob: 926b1479e4873302c1dcd96802663969809f0281 [file] [log] [blame]
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/trace_event/trace_id_helper.h"
#include "base/atomic_sequence_num.h"
#include "base/rand_util.h"
namespace base::trace_event {
uint64_t GetNextGlobalTraceId() {
static const uint64_t kPerProcessRandomValue = base::RandUint64();
static base::AtomicSequenceNumber counter;
return kPerProcessRandomValue ^ static_cast<uint64_t>(counter.GetNext());
}
} // namespace base::trace_event