39 lines · c
1//===-- Procfs.h ---------------------------------------------- -*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "lldb/lldb-types.h"10#include "llvm/Support/Error.h"11#include <vector>12 13namespace lldb_private {14namespace process_linux {15 16/// \return17/// The content of /proc/cpuinfo and cache it if errors didn't happen.18llvm::Expected<llvm::ArrayRef<uint8_t>> GetProcfsCpuInfo();19 20/// \return21/// A list of available logical core ids given the contents of22/// /proc/cpuinfo.23llvm::Expected<std::vector<lldb::cpu_id_t>>24GetAvailableLogicalCoreIDs(llvm::StringRef cpuinfo);25 26/// \return27/// A list with all the logical cores available in the system and cache it28/// if errors didn't happen.29llvm::Expected<llvm::ArrayRef<lldb::cpu_id_t>> GetAvailableLogicalCoreIDs();30 31/// \return32/// The current value of /proc/sys/kernel/yama/ptrace_scope, parsed as an33/// integer, or an error if the proc file cannot be read or has non-integer34/// contents.35llvm::Expected<int> GetPtraceScope();36 37} // namespace process_linux38} // namespace lldb_private39