/*
 * Copyright (C) 2019 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.
 */

syntax = "proto2";

package perfetto.protos;

message Utsname {
  optional string sysname = 1;
  optional string version = 2;
  optional string release = 3;
  optional string machine = 4;
}

// Next id: 17
message SystemInfo {
  optional Utsname utsname = 1;
  optional string android_build_fingerprint = 2;

  // The manufacturer of the product/hardware.
  // Source : "ro.product.manufacturer"
  // Introduced after Android W in Nov 2024 and is not supported on older
  // versions.
  optional string android_device_manufacturer = 14;

  // The SoC model from which trace is collected
  optional string android_soc_model = 9;

  // The guest SoC model from which trace is collected in case of VMs
  optional string android_guest_soc_model = 13;

  // The hardware reversion from android device
  optional string android_hardware_revision = 10;

  // The storage component from android_device. This field has been introduced
  // after Android W in Aug 2024 and is not supported on older versions.
  optional string android_storage_model = 11;

  // The RAM component information from android device. This field has been
  // introduced after Android W in Aug 2024 and is not supported on older
  // versions.
  optional string android_ram_model = 12;

  // The serial console information from android device.
  optional string android_serial_console = 15;

  // The version of traced (the same returned by `traced --version`).
  // This is a human readable string with and its format varies depending on
  // the build system and the repo (standalone vs AOSP).
  // This is intended for human debugging only.
  optional string tracing_service_version = 4;

  // The Android SDK vesion (e.g. 21 for L, 31 for S etc).
  // Introduced in Android T.
  optional uint64 android_sdk_version = 5;

  // Kernel page size - sysconf(_SC_PAGESIZE).
  optional uint32 page_size = 6;

  // Number of cpus - sysconf(_SC_NPROCESSORS_CONF).
  // Might be different to the number of online cpus.
  // Introduced in perfetto v44.
  optional uint32 num_cpus = 8;

  // The timezone offset from UTC, as per strftime("%z"), in minutes.
  // Introduced in v38 / Android V.
  optional int32 timezone_off_mins = 7;

  // Ticks per second - sysconf(_SC_CLK_TCK).
  // Not serialised as of perfetto v44.
  optional int64 hz = 3;

  // The size of the system RAM in bytes.
  //
  // On Linux/Android: sysinfo.totalram * sysinfo.mem_unit.
  // Other POSIX (e.g. Mac): sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE).
  //
  // Introduced in perfetto v54 / Android 26Q1+.
  optional uint64 system_ram_bytes = 16;
}
