chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc

// Copyright 2017 The Crashpad Authors
//
// 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 "snapshot/linux/system_snapshot_linux.h"

#include <stddef.h>
#include <sys/types.h>
#include <sys/utsname.h>

#include <algorithm>
#include <string_view>

#include "base/check_op.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "snapshot/cpu_context.h"
#include "snapshot/posix/timezone.h"
#include "util/file/file_io.h"
#include "util/numeric/in_range_cast.h"
#include "util/string/split_string.h"

#if BUILDFLAG(IS_ANDROID)
#include <sys/system_properties.h>
#endif

namespace crashpad {
namespace internal {

namespace {

bool ReadCPUsOnline(uint32_t* first_cpu, uint8_t* cpu_count) {}

bool ReadFreqFile(const std::string& filename, uint64_t* hz) {}

#if BUILDFLAG(IS_ANDROID)
bool ReadProperty(const char* property, std::string* value) {
  char value_buffer[PROP_VALUE_MAX];
  int length = __system_property_get(property, value_buffer);
  if (length <= 0) {
    LOG(ERROR) << "Couldn't read property " << property;
    return false;
  }
  *value = value_buffer;
  return true;
}
#endif  // BUILDFLAG(IS_ANDROID)

}  // namespace

SystemSnapshotLinux::SystemSnapshotLinux()
    :{}

SystemSnapshotLinux::~SystemSnapshotLinux() {}

void SystemSnapshotLinux::Initialize(ProcessReaderLinux* process_reader,
                                     const timeval* snapshot_time) {}

CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const {}

uint32_t SystemSnapshotLinux::CPURevision() const {}

uint8_t SystemSnapshotLinux::CPUCount() const {}

std::string SystemSnapshotLinux::CPUVendor() const {}

void SystemSnapshotLinux::CPUFrequency(uint64_t* current_hz,
                                       uint64_t* max_hz) const {}

uint32_t SystemSnapshotLinux::CPUX86Signature() const {}

uint64_t SystemSnapshotLinux::CPUX86Features() const {}

uint64_t SystemSnapshotLinux::CPUX86ExtendedFeatures() const {}

uint32_t SystemSnapshotLinux::CPUX86Leaf7Features() const {}

bool SystemSnapshotLinux::CPUX86SupportsDAZ() const {}

SystemSnapshot::OperatingSystem SystemSnapshotLinux::GetOperatingSystem()
    const {}

bool SystemSnapshotLinux::OSServer() const {}

void SystemSnapshotLinux::OSVersion(int* major,
                                    int* minor,
                                    int* bugfix,
                                    std::string* build) const {}

std::string SystemSnapshotLinux::OSVersionFull() const {}

std::string SystemSnapshotLinux::MachineDescription() const {}

bool SystemSnapshotLinux::NXEnabled() const {}

void SystemSnapshotLinux::TimeZone(DaylightSavingTimeStatus* dst_status,
                                   int* standard_offset_seconds,
                                   int* daylight_offset_seconds,
                                   std::string* standard_name,
                                   std::string* daylight_name) const {}

void SystemSnapshotLinux::ReadKernelVersion(const std::string& version_string) {}

}  // namespace internal
}  // namespace crashpad