chromium/third_party/perfetto/src/trace_processor/trace_database_integrationtest.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 <cstdint>
#include <cstdio>
#include <cstring>
#include <memory>
#include <random>
#include <string>
#include <utility>
#include <vector>

#include "perfetto/base/build_config.h"
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/scoped_file.h"
#include "perfetto/ext/base/string_utils.h"
#include "perfetto/trace_processor/basic_types.h"
#include "perfetto/trace_processor/iterator.h"
#include "perfetto/trace_processor/status.h"
#include "perfetto/trace_processor/trace_blob.h"
#include "perfetto/trace_processor/trace_blob_view.h"
#include "perfetto/trace_processor/trace_processor.h"
#include "protos/perfetto/common/descriptor.pbzero.h"
#include "protos/perfetto/trace_processor/trace_processor.pbzero.h"

#include "src/base/test/status_matchers.h"
#include "src/base/test/utils.h"
#include "test/gtest_and_gmock.h"

namespace perfetto::trace_processor {
namespace {

HasSubstr;

constexpr size_t kMaxChunkSize =;

TEST(TraceProcessorCustomConfigTest, SkipInternalMetricsMatchingMountPath) {}

TEST(TraceProcessorCustomConfigTest, EmptyStringSkipsAllMetrics) {}

TEST(TraceProcessorCustomConfigTest, HandlesMalformedMountPath) {}

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

TEST_F(TraceProcessorIntegrationTest, AndroidSchedAndPs) {}

TEST_F(TraceProcessorIntegrationTest, TraceBounds) {}

// Tests that the duration of the last slice is accounted in the computation
// of the trace boundaries. Linux ftraces tend to hide this problem because
// after the last sched_switch there's always a "wake" event which causes the
// raw table to fix the bounds.
TEST_F(TraceProcessorIntegrationTest, TraceBoundsUserspaceOnly) {}

TEST_F(TraceProcessorIntegrationTest, Hash) {}

#if !PERFETTO_BUILDFLAG(PERFETTO_LLVM_DEMANGLE) && \
    !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
#define MAYBE_Demangle
#else
#define MAYBE_Demangle
#endif
TEST_F(TraceProcessorIntegrationTest, MAYBE_Demangle) {}

#if !PERFETTO_BUILDFLAG(PERFETTO_LLVM_DEMANGLE)
#define MAYBE_DemangleRust
#else
#define MAYBE_DemangleRust
#endif
TEST_F(TraceProcessorIntegrationTest, MAYBE_DemangleRust) {}

#if PERFETTO_BUILDFLAG(PERFETTO_TP_JSON)
TEST_F(TraceProcessorIntegrationTest, Sfgate) {}

TEST_F(TraceProcessorIntegrationTest, UnsortedTrace) {}

TEST_F(TraceProcessorIntegrationTest, SerializeMetricDescriptors) {}

TEST_F(TraceProcessorIntegrationTest, ComputeMetricsFormattedExtension) {}

TEST_F(TraceProcessorIntegrationTest, ComputeMetricsFormattedNoExtension) {}

// TODO(hjd): Add trace to test_data.
TEST_F(TraceProcessorIntegrationTest, DISABLED_AndroidBuildTrace) {}

TEST_F(TraceProcessorIntegrationTest, DISABLED_Clusterfuzz14357) {}
#endif  // PERFETTO_BUILDFLAG(PERFETTO_TP_JSON)

TEST_F(TraceProcessorIntegrationTest, Clusterfuzz14730) {}

TEST_F(TraceProcessorIntegrationTest, Clusterfuzz14753) {}

TEST_F(TraceProcessorIntegrationTest, Clusterfuzz14762) {}

TEST_F(TraceProcessorIntegrationTest, Clusterfuzz14767) {}

TEST_F(TraceProcessorIntegrationTest, Clusterfuzz14799) {}

TEST_F(TraceProcessorIntegrationTest, Clusterfuzz15252) {}

TEST_F(TraceProcessorIntegrationTest, Clusterfuzz17805) {}

// Failing on DCHECKs during import because the traces aren't really valid.
#if PERFETTO_DCHECK_IS_ON()
#define MAYBE_Clusterfuzz20215
#define MAYBE_Clusterfuzz20292
#define MAYBE_Clusterfuzz21178
#define MAYBE_Clusterfuzz21890
#define MAYBE_Clusterfuzz23053
#define MAYBE_Clusterfuzz28338
#define MAYBE_Clusterfuzz28766
#else  // PERFETTO_DCHECK_IS_ON()
#define MAYBE_Clusterfuzz20215
#define MAYBE_Clusterfuzz20292
#define MAYBE_Clusterfuzz21178
#define MAYBE_Clusterfuzz21890
#define MAYBE_Clusterfuzz23053
#define MAYBE_Clusterfuzz28338
#define MAYBE_Clusterfuzz28766
#endif  // PERFETTO_DCHECK_IS_ON()

TEST_F(TraceProcessorIntegrationTest, MAYBE_Clusterfuzz20215) {}

TEST_F(TraceProcessorIntegrationTest, MAYBE_Clusterfuzz20292) {}

TEST_F(TraceProcessorIntegrationTest, MAYBE_Clusterfuzz21178) {}

TEST_F(TraceProcessorIntegrationTest, MAYBE_Clusterfuzz21890) {}

TEST_F(TraceProcessorIntegrationTest, MAYBE_Clusterfuzz23053) {}

TEST_F(TraceProcessorIntegrationTest, MAYBE_Clusterfuzz28338) {}

TEST_F(TraceProcessorIntegrationTest, MAYBE_Clusterfuzz28766) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesInvariant) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesPerfettoSql) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesStandardSqlite) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesModules) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesSpanJoin) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesWithClause) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesIndex) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesTraceBounds) {}

TEST_F(TraceProcessorIntegrationTest, RestoreInitialTablesDependents) {}

TEST_F(TraceProcessorIntegrationTest, RestoreDependentFunction) {}

TEST_F(TraceProcessorIntegrationTest, RestoreDependentTableFunction) {}

// This test checks that a ninja trace is tokenized properly even if read in
// small chunks of 1KB each. The values used in the test have been cross-checked
// with opening the same trace with ninjatracing + chrome://tracing.
TEST_F(TraceProcessorIntegrationTest, NinjaLog) {}

/*
 * This trace does not have a uuid. The uuid will be generated from the first
 * 4096 bytes, which will be read in one chunk.
 */
TEST_F(TraceProcessorIntegrationTest, TraceWithoutUuidReadInOneChunk) {}

/*
 * This trace does not have a uuid. The uuid will be generated from the first
 * 4096 bytes, which will be read in multiple chunks.
 */
TEST_F(TraceProcessorIntegrationTest, TraceWithoutUuidReadInMultipleChuncks) {}

/*
 * This trace has a uuid. It will not be overriden by the hash of the first 4096
 * bytes.
 */
TEST_F(TraceProcessorIntegrationTest, TraceWithUuidReadInParts) {}

TEST_F(TraceProcessorIntegrationTest, ErrorMessageExecuteQuery) {}

TEST_F(TraceProcessorIntegrationTest, ErrorMessageMetricFile) {}

TEST_F(TraceProcessorIntegrationTest, ErrorMessageModule) {}

TEST_F(TraceProcessorIntegrationTest, FunctionRegistrationError) {}

TEST_F(TraceProcessorIntegrationTest, CreateTableDuplicateNames) {}

TEST_F(TraceProcessorIntegrationTest, InvalidTrace) {}

TEST_F(TraceProcessorIntegrationTest, NoNotifyEndOfFileCalled) {}

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