148f512ceSopenharmony_ci/*
248f512ceSopenharmony_ci * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
348f512ceSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
448f512ceSopenharmony_ci * you may not use this file except in compliance with the License.
548f512ceSopenharmony_ci * You may obtain a copy of the License at
648f512ceSopenharmony_ci *
748f512ceSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
848f512ceSopenharmony_ci *
948f512ceSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1048f512ceSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1148f512ceSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1248f512ceSopenharmony_ci * See the License for the specific language governing permissions and
1348f512ceSopenharmony_ci * limitations under the License.
1448f512ceSopenharmony_ci */
1548f512ceSopenharmony_ci#ifndef HIPERF_PERF_RECORD_FORMAT_H
1648f512ceSopenharmony_ci#define HIPERF_PERF_RECORD_FORMAT_H
1748f512ceSopenharmony_ci
1848f512ceSopenharmony_ci#include <string>
1948f512ceSopenharmony_ci#include <linux/types.h>
2048f512ceSopenharmony_ci
2148f512ceSopenharmony_ci#include "utilities.h"
2248f512ceSopenharmony_ci
2348f512ceSopenharmony_cinamespace OHOS {
2448f512ceSopenharmony_cinamespace Developtools {
2548f512ceSopenharmony_cinamespace HiPerf {
2648f512ceSopenharmony_ci// description from https://man7.org/linux/man-pages/man2/perf_event_open.2.html
2748f512ceSopenharmony_ci
2848f512ceSopenharmony_ci#define SAMPLE_ID_ALL 0
2948f512ceSopenharmony_ci#define PERF_SAMPLE_SERVER_PID (1U << 31)
3048f512ceSopenharmony_ci
3148f512ceSopenharmony_cistruct sample_id {
3248f512ceSopenharmony_ci    u32 pid = 0;
3348f512ceSopenharmony_ci    u32 tid = 0;       /* if PERF_SAMPLE_TID set */
3448f512ceSopenharmony_ci    u64 time = 0;      /* if PERF_SAMPLE_TIME set */
3548f512ceSopenharmony_ci    u64 id = 0;        /* if PERF_SAMPLE_ID set */
3648f512ceSopenharmony_ci    u64 stream_id = 0; /* if PERF_SAMPLE_STREAM_ID set  */
3748f512ceSopenharmony_ci    u32 cpu = 0;
3848f512ceSopenharmony_ci    u32 res = 0;  /* if PERF_SAMPLE_CPU set */
3948f512ceSopenharmony_ci    u64 id2 = 0;       /* if PERF_SAMPLE_IDENTIFIER set */
4048f512ceSopenharmony_ci};
4148f512ceSopenharmony_ci
4248f512ceSopenharmony_ci// If PERF_FORMAT_GROUP was not specified
4348f512ceSopenharmony_cistruct read_format {
4448f512ceSopenharmony_ci    __u64 value = 0;        /* The value of the event */
4548f512ceSopenharmony_ci    __u64 timeEnabled = 0; /* if PERF_FORMAT_TOTAL_TIME_ENABLED */
4648f512ceSopenharmony_ci    __u64 timeRunning = 0; /* if PERF_FORMAT_TOTAL_TIME_RUNNING */
4748f512ceSopenharmony_ci    __u64 id = 0;           /* if PERF_FORMAT_ID */
4848f512ceSopenharmony_ci};
4948f512ceSopenharmony_ci
5048f512ceSopenharmony_cistruct PerfRecordAuxtraceData {
5148f512ceSopenharmony_ci    u64 size = 0;
5248f512ceSopenharmony_ci    u64 offset = 0;
5348f512ceSopenharmony_ci    u64 reference = 0;
5448f512ceSopenharmony_ci    u32 idx = 0;
5548f512ceSopenharmony_ci    u32 tid = 0;
5648f512ceSopenharmony_ci    u32 cpu = 0;
5748f512ceSopenharmony_ci    u32 reserved__ = 0;
5848f512ceSopenharmony_ci};
5948f512ceSopenharmony_ci
6048f512ceSopenharmony_ci/*
6148f512ceSopenharmony_ci    The MMAP events record the PROT_EXEC mappings so that
6248f512ceSopenharmony_ci    we can correlate user-space IPs to code.  They have
6348f512ceSopenharmony_ci    the following structure:
6448f512ceSopenharmony_ci        pid     is the process ID.
6548f512ceSopenharmony_ci        tid     is the thread ID.
6648f512ceSopenharmony_ci        addr    is the address of the allocated memory.
6748f512ceSopenharmony_ci        len     is the length of the allocated memory.
6848f512ceSopenharmony_ci        pgoff   is the page offset of the allocated memory.
6948f512ceSopenharmony_ci        filename
7048f512ceSopenharmony_ci            is a string describing the backing of
7148f512ceSopenharmony_ci            the allocated memory.
7248f512ceSopenharmony_ci*/
7348f512ceSopenharmony_cistruct PerfRecordMmapData {
7448f512ceSopenharmony_ci    u32 pid = 0;
7548f512ceSopenharmony_ci    u32 tid = 0;
7648f512ceSopenharmony_ci    u64 addr = 0;
7748f512ceSopenharmony_ci    u64 len = 0;
7848f512ceSopenharmony_ci    u64 pgoff = 0;
7948f512ceSopenharmony_ci    char filename[KILO] = {0};
8048f512ceSopenharmony_ci#if SAMPLE_ID_ALL
8148f512ceSopenharmony_ci    struct sample_id sample_id;
8248f512ceSopenharmony_ci#endif
8348f512ceSopenharmony_ci};
8448f512ceSopenharmony_ci
8548f512ceSopenharmony_ci/*
8648f512ceSopenharmony_ci    This record includes extended information on mmap(2)
8748f512ceSopenharmony_ci    calls returning executable mappings.  The format is
8848f512ceSopenharmony_ci    similar to that of the PERF_RECORD_MMAP record, but
8948f512ceSopenharmony_ci    includes extra values that allow uniquely identifying
9048f512ceSopenharmony_ci    shared mappings.
9148f512ceSopenharmony_ci
9248f512ceSopenharmony_ci    pid    is the process ID.
9348f512ceSopenharmony_ci    tid    is the thread ID.
9448f512ceSopenharmony_ci    addr   is the address of the allocated memory.
9548f512ceSopenharmony_ci    len    is the length of the allocated memory.
9648f512ceSopenharmony_ci    pgoff  is the page offset of the allocated memory.
9748f512ceSopenharmony_ci    maj    is the major ID of the underlying device.
9848f512ceSopenharmony_ci    min    is the minor ID of the underlying device.
9948f512ceSopenharmony_ci    ino    is the inode number.
10048f512ceSopenharmony_ci    ino_generation
10148f512ceSopenharmony_ci            is the inode generation.
10248f512ceSopenharmony_ci    prot   is the protection information.
10348f512ceSopenharmony_ci    flags  is the flags information.
10448f512ceSopenharmony_ci    filename
10548f512ceSopenharmony_ci            is a string describing the backing of the
10648f512ceSopenharmony_ci            allocated memory.
10748f512ceSopenharmony_ci*/
10848f512ceSopenharmony_cistruct PerfRecordMmap2Data {
10948f512ceSopenharmony_ci    u32 pid = 0;
11048f512ceSopenharmony_ci    u32 tid = 0;
11148f512ceSopenharmony_ci    u64 addr = 0;
11248f512ceSopenharmony_ci    u64 len = 0;
11348f512ceSopenharmony_ci    u64 pgoff = 0;
11448f512ceSopenharmony_ci    u32 maj = 0;
11548f512ceSopenharmony_ci    u32 min = 0;
11648f512ceSopenharmony_ci    u64 ino = 0;
11748f512ceSopenharmony_ci    u64 ino_generation = 0;
11848f512ceSopenharmony_ci    u32 prot = 0;
11948f512ceSopenharmony_ci    u32 flags = 0;
12048f512ceSopenharmony_ci    char filename[KILO] = {0};
12148f512ceSopenharmony_ci#if SAMPLE_ID_ALL
12248f512ceSopenharmony_ci    struct sample_id sample_id;
12348f512ceSopenharmony_ci#endif
12448f512ceSopenharmony_ci};
12548f512ceSopenharmony_ci
12648f512ceSopenharmony_ci/*
12748f512ceSopenharmony_ci    This record indicates when events are lost.
12848f512ceSopenharmony_ci    id     is the unique event ID for the samples that  were lost.
12948f512ceSopenharmony_ci    lost   is the number of events that were lost.
13048f512ceSopenharmony_ci*/
13148f512ceSopenharmony_cistruct PerfRecordLostData {
13248f512ceSopenharmony_ci    u64 id = 0;
13348f512ceSopenharmony_ci    u64 lost = 0;
13448f512ceSopenharmony_ci#if SAMPLE_ID_ALL
13548f512ceSopenharmony_ci    struct sample_id sample_id;
13648f512ceSopenharmony_ci#endif
13748f512ceSopenharmony_ci};
13848f512ceSopenharmony_ci
13948f512ceSopenharmony_ci/*
14048f512ceSopenharmony_ci    This record indicates a change in the process name.
14148f512ceSopenharmony_ci    pid    is the process ID.
14248f512ceSopenharmony_ci    tid    is the thread ID.
14348f512ceSopenharmony_ci    comm   is a string containing the new name of the process.
14448f512ceSopenharmony_ci*/
14548f512ceSopenharmony_cistruct PerfRecordCommData {
14648f512ceSopenharmony_ci    u32 pid = 0;
14748f512ceSopenharmony_ci    u32 tid = 0;
14848f512ceSopenharmony_ci    char comm[KILO] = {0};
14948f512ceSopenharmony_ci#if SAMPLE_ID_ALL
15048f512ceSopenharmony_ci    struct sample_id sample_id;
15148f512ceSopenharmony_ci#endif
15248f512ceSopenharmony_ci};
15348f512ceSopenharmony_ci
15448f512ceSopenharmony_cistruct PerfBranchEntry {
15548f512ceSopenharmony_ci    u64 from = 0;
15648f512ceSopenharmony_ci    u64 to = 0;
15748f512ceSopenharmony_ci    u64 flags = 0;
15848f512ceSopenharmony_ci};
15948f512ceSopenharmony_ci
16048f512ceSopenharmony_ci// This record indicates a sample.
16148f512ceSopenharmony_cistruct PerfRecordSampleData {
16248f512ceSopenharmony_ci    u64 sample_id = 0; /* if PERF_SAMPLE_IDENTIFIER */
16348f512ceSopenharmony_ci    u64 ip = 0;        /* if PERF_SAMPLE_IP */
16448f512ceSopenharmony_ci    u32 pid = 0;
16548f512ceSopenharmony_ci    u32 tid = 0;  /* if PERF_SAMPLE_TID */
16648f512ceSopenharmony_ci    u64 time = 0;      /* if PERF_SAMPLE_TIME */
16748f512ceSopenharmony_ci    u64 addr = 0;      /* if PERF_SAMPLE_ADDR */
16848f512ceSopenharmony_ci    u64 id = 0;        /* if PERF_SAMPLE_ID */
16948f512ceSopenharmony_ci    u64 stream_id = 0; /* if PERF_SAMPLE_STREAM_ID */
17048f512ceSopenharmony_ci    u32 cpu = 0;
17148f512ceSopenharmony_ci    u32 res = 0;  /* if PERF_SAMPLE_CPU */
17248f512ceSopenharmony_ci    u64 period = 0;    /* if PERF_SAMPLE_PERIOD */
17348f512ceSopenharmony_ci    struct read_format v;
17448f512ceSopenharmony_ci    /* if PERF_SAMPLE_READ */
17548f512ceSopenharmony_ci    u64 nr = 0;                        /* if PERF_SAMPLE_CALLCHAIN */
17648f512ceSopenharmony_ci    u64 *ips = nullptr;                /* if PERF_SAMPLE_CALLCHAIN */
17748f512ceSopenharmony_ci    u32 raw_size = 0;                  /* if PERF_SAMPLE_RAW */
17848f512ceSopenharmony_ci    u8 *raw_data = nullptr;                  /* if PERF_SAMPLE_RAW */
17948f512ceSopenharmony_ci    u64 bnr = 0;                       /* if PERF_SAMPLE_BRANCH_STACK */
18048f512ceSopenharmony_ci    struct PerfBranchEntry *lbr = nullptr; /* if PERF_SAMPLE_BRANCH_STACK */
18148f512ceSopenharmony_ci    u64 user_abi = 0;                  /* if PERF_SAMPLE_REGS_USER */
18248f512ceSopenharmony_ci    u64 reg_mask = 0;
18348f512ceSopenharmony_ci    u64 reg_nr = 0;
18448f512ceSopenharmony_ci    u64 *user_regs = nullptr;   /* if PERF_SAMPLE_REGS_USER */
18548f512ceSopenharmony_ci    u64 stack_size = 0;   /* if PERF_SAMPLE_STACK_USER */
18648f512ceSopenharmony_ci    u8 *stack_data = nullptr;   /* if PERF_SAMPLE_STACK_USER */
18748f512ceSopenharmony_ci    u64 dyn_size = 0;     /* if PERF_SAMPLE_STACK_USER && stack_size != 0 */
18848f512ceSopenharmony_ci    u64 weight = 0;       /* if PERF_SAMPLE_WEIGHT */
18948f512ceSopenharmony_ci    u64 data_src = 0;     /* if PERF_SAMPLE_DATA_SRC */
19048f512ceSopenharmony_ci    u64 transaction = 0;  /* if PERF_SAMPLE_TRANSACTION */
19148f512ceSopenharmony_ci    u64 intr_abi = 0;     /* if PERF_SAMPLE_REGS_INTR */
19248f512ceSopenharmony_ci    u64 intr_regs[0]; /* if PERF_SAMPLE_REGS_INTR */
19348f512ceSopenharmony_ci    u64 phys_addr = 0;    /* if PERF_SAMPLE_PHYS_ADDR */
19448f512ceSopenharmony_ci    u64 cgroup = 0;       /* if PERF_SAMPLE_CGROUP */
19548f512ceSopenharmony_ci    u64 server_nr = 0;    /* if PERF_SAMPLE_SERVER_PID */
19648f512ceSopenharmony_ci    u64 *server_pids = 0; /* if PERF_SAMPLE_SERVER_PID */
19748f512ceSopenharmony_ci};
19848f512ceSopenharmony_ci
19948f512ceSopenharmony_ci/*
20048f512ceSopenharmony_ci    This record indicates a process exit event.
20148f512ceSopenharmony_ci*/
20248f512ceSopenharmony_cistruct PerfRecordExitData {
20348f512ceSopenharmony_ci    u32 pid = 0;
20448f512ceSopenharmony_ci    u32 ppid = 0;
20548f512ceSopenharmony_ci    u32 tid = 0;
20648f512ceSopenharmony_ci    u32 ptid = 0;
20748f512ceSopenharmony_ci    u64 time = 0;
20848f512ceSopenharmony_ci#if SAMPLE_ID_ALL
20948f512ceSopenharmony_ci    struct sample_id sample_id;
21048f512ceSopenharmony_ci#endif
21148f512ceSopenharmony_ci};
21248f512ceSopenharmony_ci
21348f512ceSopenharmony_ci/*
21448f512ceSopenharmony_ci    This record indicates a throttle/unthrottle event.
21548f512ceSopenharmony_ci*/
21648f512ceSopenharmony_cistruct PerfRecordThrottleData {
21748f512ceSopenharmony_ci    u64 time = 0;
21848f512ceSopenharmony_ci    u64 id = 0;
21948f512ceSopenharmony_ci    u64 stream_id = 0;
22048f512ceSopenharmony_ci#if SAMPLE_ID_ALL
22148f512ceSopenharmony_ci    struct sample_id sample_id;
22248f512ceSopenharmony_ci#endif
22348f512ceSopenharmony_ci};
22448f512ceSopenharmony_ci
22548f512ceSopenharmony_ci/*
22648f512ceSopenharmony_ci    This record indicates a fork event.
22748f512ceSopenharmony_ci*/
22848f512ceSopenharmony_cistruct PerfRecordForkData {
22948f512ceSopenharmony_ci    u32 pid = 0;
23048f512ceSopenharmony_ci    u32 ppid = 0;
23148f512ceSopenharmony_ci    u32 tid = 0;
23248f512ceSopenharmony_ci    u32 ptid = 0;
23348f512ceSopenharmony_ci    u64 time = 0;
23448f512ceSopenharmony_ci#if SAMPLE_ID_ALL
23548f512ceSopenharmony_ci    struct sample_id sample_id;
23648f512ceSopenharmony_ci#endif
23748f512ceSopenharmony_ci};
23848f512ceSopenharmony_ci
23948f512ceSopenharmony_ci/*
24048f512ceSopenharmony_ci    When using hardware sampling (such as Intel PEBS) this
24148f512ceSopenharmony_ci    record indicates some number of samples that may have
24248f512ceSopenharmony_ci    been lost.
24348f512ceSopenharmony_ci*/
24448f512ceSopenharmony_cistruct PerfRecordLostSamplesData {
24548f512ceSopenharmony_ci    u64 lost = 0;
24648f512ceSopenharmony_ci#if SAMPLE_ID_ALL
24748f512ceSopenharmony_ci    struct sample_id sample_id;
24848f512ceSopenharmony_ci#endif
24948f512ceSopenharmony_ci};
25048f512ceSopenharmony_ci
25148f512ceSopenharmony_ci/*
25248f512ceSopenharmony_ci    This record indicates which process has initiated an
25348f512ceSopenharmony_ci    instruction trace event, allowing tools to properly
25448f512ceSopenharmony_ci    correlate the instruction addresses in the AUX buffer
25548f512ceSopenharmony_ci    with the proper executable.
25648f512ceSopenharmony_ci
25748f512ceSopenharmony_ci    pid    process ID of the thread starting an
25848f512ceSopenharmony_ci            instruction trace.
25948f512ceSopenharmony_ci    tid    thread ID of the thread starting an instruction
26048f512ceSopenharmony_ci            trace.
26148f512ceSopenharmony_ci*/
26248f512ceSopenharmony_cistruct PerfRecordItraceStartData {
26348f512ceSopenharmony_ci    u32 pid = 0;
26448f512ceSopenharmony_ci    u32 tid = 0;
26548f512ceSopenharmony_ci};
26648f512ceSopenharmony_ci
26748f512ceSopenharmony_ci/*
26848f512ceSopenharmony_ci    This record reports that new data is available in the
26948f512ceSopenharmony_ci    separate AUX buffer region.
27048f512ceSopenharmony_ci
27148f512ceSopenharmony_ci    aux_offset
27248f512ceSopenharmony_ci            offset in the AUX mmap region where the new
27348f512ceSopenharmony_ci            data begins.
27448f512ceSopenharmony_ci    aux_size
27548f512ceSopenharmony_ci            size of the data made available.
27648f512ceSopenharmony_ci    flags  describes the AUX update.
27748f512ceSopenharmony_ci            PERF_AUX_FLAG_TRUNCATED
27848f512ceSopenharmony_ci                if set, then the data returned was
27948f512ceSopenharmony_ci                truncated to fit the available buffer
28048f512ceSopenharmony_ci                size.
28148f512ceSopenharmony_ci
28248f512ceSopenharmony_ci            PERF_AUX_FLAG_OVERWRITE
28348f512ceSopenharmony_ci                if set, then the data returned has
28448f512ceSopenharmony_ci                overwritten previous data.
28548f512ceSopenharmony_ci*/
28648f512ceSopenharmony_cistruct PerfRecordAuxData {
28748f512ceSopenharmony_ci    u64 aux_offset = 0;
28848f512ceSopenharmony_ci    u64 aux_size = 0;
28948f512ceSopenharmony_ci    u64 flags = 0;
29048f512ceSopenharmony_ci    struct sample_id sample_id;
29148f512ceSopenharmony_ci};
29248f512ceSopenharmony_ci
29348f512ceSopenharmony_ci/*
29448f512ceSopenharmony_ci    This record indicates a read event.
29548f512ceSopenharmony_ci*/
29648f512ceSopenharmony_cistruct PerfRecordReadData {
29748f512ceSopenharmony_ci    u32 pid = 0;
29848f512ceSopenharmony_ci    u32 tid = 0;
29948f512ceSopenharmony_ci    read_format values;
30048f512ceSopenharmony_ci#if SAMPLE_ID_ALL
30148f512ceSopenharmony_ci    struct sample_id sample_id;
30248f512ceSopenharmony_ci#endif
30348f512ceSopenharmony_ci};
30448f512ceSopenharmony_ci
30548f512ceSopenharmony_ci/*
30648f512ceSopenharmony_ci    This record indicates a context switch has happened.
30748f512ceSopenharmony_ci    The PERF_RECORD_MISC_SWITCH_OUT bit in the misc field
30848f512ceSopenharmony_ci    indicates whether it was a context switch into or away
30948f512ceSopenharmony_ci    from the current process.
31048f512ceSopenharmony_ci*/
31148f512ceSopenharmony_cistruct PerfRecordSwitchData {
31248f512ceSopenharmony_ci#if SAMPLE_ID_ALL
31348f512ceSopenharmony_ci    struct sample_id sample_id;
31448f512ceSopenharmony_ci#endif
31548f512ceSopenharmony_ci};
31648f512ceSopenharmony_ci
31748f512ceSopenharmony_ci/*
31848f512ceSopenharmony_ci    As with PERF_RECORD_SWITCH this record indicates a
31948f512ceSopenharmony_ci    context switch has happened, but it only occurs when
32048f512ceSopenharmony_ci    sampling in CPU-wide mode and provides additional
32148f512ceSopenharmony_ci    information on the process being switched to/from.
32248f512ceSopenharmony_ci    The PERF_RECORD_MISC_SWITCH_OUT bit in the misc field
32348f512ceSopenharmony_ci    indicates whether it was a context switch into or away
32448f512ceSopenharmony_ci    from the current process.
32548f512ceSopenharmony_ci
32648f512ceSopenharmony_ci    next_prev_pid
32748f512ceSopenharmony_ci            The process ID of the previous (if switching
32848f512ceSopenharmony_ci            in) or next (if switching out) process on the
32948f512ceSopenharmony_ci            CPU.
33048f512ceSopenharmony_ci
33148f512ceSopenharmony_ci    next_prev_tid
33248f512ceSopenharmony_ci            The thread ID of the previous (if switching in)
33348f512ceSopenharmony_ci            or next (if switching out) thread on the CPU.
33448f512ceSopenharmony_ci*/
33548f512ceSopenharmony_cistruct PerfRecordSwitchCpuWideData {
33648f512ceSopenharmony_ci    u32 next_prev_pid = 0;
33748f512ceSopenharmony_ci    u32 next_prev_tid = 0;
33848f512ceSopenharmony_ci#if SAMPLE_ID_ALL
33948f512ceSopenharmony_ci    struct sample_id sample_id;
34048f512ceSopenharmony_ci#endif
34148f512ceSopenharmony_ci};
34248f512ceSopenharmony_ci
34348f512ceSopenharmony_ci/*
34448f512ceSopenharmony_ci    This record includes various namespace information of
34548f512ceSopenharmony_ci    a process.
34648f512ceSopenharmony_ci
34748f512ceSopenharmony_ci    pid    is the process ID
34848f512ceSopenharmony_ci    tid    is the thread ID
34948f512ceSopenharmony_ci
35048f512ceSopenharmony_ci    nr_namespace
35148f512ceSopenharmony_ci            is the number of namespaces in this record
35248f512ceSopenharmony_ci
35348f512ceSopenharmony_ci    Each namespace has dev and inode fields and is
35448f512ceSopenharmony_ci    recorded in the fixed position like below:
35548f512ceSopenharmony_ci
35648f512ceSopenharmony_ci    NET_NS_INDEX=0
35748f512ceSopenharmony_ci            Network namespace
35848f512ceSopenharmony_ci    UTS_NS_INDEX=1
35948f512ceSopenharmony_ci            UTS namespace
36048f512ceSopenharmony_ci    IPC_NS_INDEX=2
36148f512ceSopenharmony_ci            IPC namespace
36248f512ceSopenharmony_ci    PID_NS_INDEX=3
36348f512ceSopenharmony_ci            PID namespace
36448f512ceSopenharmony_ci    USER_NS_INDEX=4
36548f512ceSopenharmony_ci            User namespace
36648f512ceSopenharmony_ci    MNT_NS_INDEX=5
36748f512ceSopenharmony_ci            Mount namespace
36848f512ceSopenharmony_ci    CGROUP_NS_INDEX=6
36948f512ceSopenharmony_ci            Cgroup namespace
37048f512ceSopenharmony_ci*/
37148f512ceSopenharmony_cistruct PerfRecordNamespacesData {
37248f512ceSopenharmony_ci    u32 pid = 0;
37348f512ceSopenharmony_ci    u32 tid = 0;
37448f512ceSopenharmony_ci    u64 nr_namespaces = 0;
37548f512ceSopenharmony_ci    struct name_space {
37648f512ceSopenharmony_ci        u64 dev = 0;
37748f512ceSopenharmony_ci        u64 inode = 0;
37848f512ceSopenharmony_ci    } namespaces[0];
37948f512ceSopenharmony_ci#if SAMPLE_ID_ALL
38048f512ceSopenharmony_ci    struct sample_id sample_id;
38148f512ceSopenharmony_ci#endif
38248f512ceSopenharmony_ci};
38348f512ceSopenharmony_ci} // namespace HiPerf
38448f512ceSopenharmony_ci} // namespace Developtools
38548f512ceSopenharmony_ci} // namespace OHOS
38648f512ceSopenharmony_ci#endif // HIPERF_PERF_RECORD_FORMAT_H
387