libdd_crashtracker/crash_info/proc_info.rs
1// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
2// SPDX-License-Identifier: Apache-2.0
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
7pub struct ProcInfo {
8 pub pid: u32,
9 #[serde(default, skip_serializing_if = "Option::is_none")]
10 pub tid: Option<u32>,
11}
12
13#[cfg(test)]
14impl super::test_utils::TestInstance for ProcInfo {
15 fn test_instance(seed: u64) -> Self {
16 Self {
17 pid: seed as u32,
18 tid: None,
19 }
20 }
21}