* -------------------------------------------------------------------------
* This file is part of the MindStudio project.
* Copyright (c) 2025 Huawei Technologies Co.,Ltd.
*
* MindStudio is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*/
#ifndef PROFILER_SERVER_MEM_SCOPE_COLUMN_H
#define PROFILER_SERVER_MEM_SCOPE_COLUMN_H
#include "CommonRequests.h"
namespace Dic::Module::MemScope {
namespace EventTableColumn {
constexpr std::string_view ID = "ID";
constexpr std::string_view EVENT = "Event";
constexpr std::string_view EVENT_TYPE = "`Event Type`";
constexpr std::string_view NAME = "Name";
constexpr std::string_view TIMESTAMP = "`Timestamp(ns)`";
constexpr std::string_view PROCESS_ID = "`Process Id`";
constexpr std::string_view THREAD_ID = "`Thread Id`";
constexpr std::string_view DEVICE_ID = "`Device Id`";
constexpr std::string_view PTR = "Ptr";
constexpr std::string_view ATTR = "Attr";
constexpr std::string_view CALL_STACK_PYTHON = "`Call Stack(Python)`";
constexpr std::string_view CALL_STACK_C = "`Call Stack(C)`";
inline const std::vector<Dic::Protocol::TableViewColumn> FIELD_FULL_COLUMNS = {
{ID, "id", true, true, false, false},
{EVENT, "event", true, false, true, false},
{EVENT_TYPE, "eventType", true, true, true, false},
{NAME, "name", true, true, true, false},
{TIMESTAMP, "_timestamp", true, true, false, true},
{PROCESS_ID, "processId", true, true, true, false},
{THREAD_ID, "threadId", true, true, true, false},
{DEVICE_ID, "deviceId"}, {PTR, "ptr", true, true, true, false},
{ATTR, "attr", true, false, true, false},
{CALL_STACK_PYTHON, "callStackPython", true, false, true, false},
{CALL_STACK_C, "callStackC", true, false, true, false}
};
inline const std::set<std::string_view> TIMESTAMP_COLUMN_SET = {TIMESTAMP};
}
namespace MemoryAllocationTableColumn {
constexpr std::string_view ID = "id";
constexpr std::string_view TIMESTAMP = "timestamp";
constexpr std::string_view TOTAL_SIZE = "totalSize";
constexpr std::string_view OPTIMIZED = "optimized";
constexpr std::string_view DEVICE_ID = "deviceId";
constexpr std::string_view EVENT_TYPE = "eventType";
constexpr std::string_view FULL_COLUMNS_WITHOUT_ID[] = {TIMESTAMP, TOTAL_SIZE, OPTIMIZED, DEVICE_ID, EVENT_TYPE};
constexpr std::string_view FULL_COLUMNS[] = {ID, TIMESTAMP, TOTAL_SIZE, OPTIMIZED, DEVICE_ID, EVENT_TYPE};
}
namespace MemoryBlockTableColumn {
constexpr std::string_view ID = "id";
constexpr std::string_view DEVICE_ID = "deviceId";
constexpr std::string_view ADDR = "addr";
constexpr std::string_view SIZE = "size";
constexpr std::string_view START_TIMESTAMP = "startTimestamp";
constexpr std::string_view END_TIMESTAMP = "endTimestamp";
constexpr std::string_view EVENT_TYPE = "eventType";
constexpr std::string_view OWNER = "owner";
constexpr std::string_view ATTR = "attr";
constexpr std::string_view PROCESS_ID = "processId";
constexpr std::string_view THREAD_ID = "threadId";
constexpr std::string_view FIRST_ACCESS_TIMESTAMP = "firstAccessTimestamp";
constexpr std::string_view LAST_ACCESS_TIMESTAMP = "lastAccessTimestamp";
constexpr std::string_view MAX_ACCESS_INTERVAL = "maxAccessInterval";
constexpr std::string_view FULL_COLUMNS_WITHOUT_ID[] = {DEVICE_ID, ADDR, SIZE, START_TIMESTAMP, END_TIMESTAMP,
EVENT_TYPE, OWNER, ATTR, PROCESS_ID, THREAD_ID, FIRST_ACCESS_TIMESTAMP, LAST_ACCESS_TIMESTAMP, MAX_ACCESS_INTERVAL};
inline const std::vector<Dic::Protocol::TableViewColumn> FIELD_FULL_COLUMNS = {
{ID, "id", true, true, false, false},
{DEVICE_ID, "deviceId"}, {ADDR, "addr", true, true, true, false},
{SIZE, "size", true, true, false, true},
{START_TIMESTAMP, "_startTimestamp", true, true, false, true},
{END_TIMESTAMP, "_endTimestamp", true, true, false, true},
{EVENT_TYPE, "eventType", false, true, true, false},
{OWNER, "owner", true, true, true, false},
{PROCESS_ID, "processId", true, true, true, false},
{THREAD_ID, "threadId", true, true, true, false},
{ATTR, "attr", true, false, true, false},
{FIRST_ACCESS_TIMESTAMP, "_firstAccessTimestamp", true, false, false, true},
{LAST_ACCESS_TIMESTAMP, "_lastAccessTimestamp", true, false, false, true},
{MAX_ACCESS_INTERVAL, "maxAccessInterval", true, false, false, true}};
inline const std::set<std::string_view> TIMESTAMP_COLUMN_SET = {
START_TIMESTAMP, END_TIMESTAMP, FIRST_ACCESS_TIMESTAMP, LAST_ACCESS_TIMESTAMP};
}
namespace PythonTraceTableColumn {
constexpr std::string_view ID = "ROWID";
constexpr std::string_view FUNC_INFO = "FuncInfo";
constexpr std::string_view START_TIME = "`StartTime(ns)`";
constexpr std::string_view END_TIME = "`EndTime(ns)`";
constexpr std::string_view THREAD_ID = "`Thread Id`";
constexpr std::string_view PROCESS_ID = "`Process Id`";
constexpr std::string_view DEPTH = "Depth";
}
}
#endif