chromium/third_party/perfetto/src/trace_processor/sorter/trace_sorter_unittest.cc

/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "src/trace_processor/sorter/trace_sorter.h"

#include <map>
#include <random>
#include <vector>

#include "perfetto/trace_processor/basic_types.h"
#include "perfetto/trace_processor/trace_blob.h"
#include "perfetto/trace_processor/trace_blob_view.h"
#include "src/trace_processor/importers/common/parser_types.h"
#include "src/trace_processor/importers/proto/packet_sequence_state_generation.h"
#include "src/trace_processor/importers/proto/proto_trace_parser_impl.h"
#include "src/trace_processor/types/trace_processor_context.h"
#include "test/gtest_and_gmock.h"

namespace perfetto {
namespace trace_processor {
namespace {

_;
InSequence;
Invoke;
MockFunction;
NiceMock;

constexpr std::optional<MachineId> kNullMachineId =;

class MockTraceParser : public ProtoTraceParserImpl {};

class MockTraceStorage : public TraceStorage {};

class TraceSorterTest : public ::testing::Test {};

TEST_F(TraceSorterTest, TestFtrace) {}

TEST_F(TraceSorterTest, TestTracePacket) {}

TEST_F(TraceSorterTest, Ordering) {}

TEST_F(TraceSorterTest, IncrementalExtraction) {}

// Simulate a producer bug where the third packet is emitted
// out of order. Verify that we track the stats correctly.
TEST_F(TraceSorterTest, OutOfOrder) {}

// Simulates a random stream of ftrace events happening on random CPUs.
// Tests that the output of the TraceSorter matches the timestamp order
// (% events happening at the same time on different CPUs).
TEST_F(TraceSorterTest, MultiQueueSorting) {}

// An generalized version of MultiQueueSorting with multiple machines.
TEST_F(TraceSorterTest, MultiMachineSorting) {}

}  // namespace
}  // namespace trace_processor
}  // namespace perfetto