From 10d4f2602796af4dbeb33fb26059adfccb5ab823 Mon Sep 17 00:00:00 2001 From: Junyi Ye <294572668@qq.com> Date: Tue, 14 May 2024 15:09:28 +0800 Subject: [PATCH] Move interface. --- include/pmu.h | 8 -------- pmu/pmu_event_list.cpp | 20 ++++++++++++++------ pmu/pmu_event_list.h | 20 ++++++++++++++++++++ pmu/pmu_list.cpp | 1 + 4 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 pmu/pmu_event_list.h diff --git a/include/pmu.h b/include/pmu.h index f2cb590..aa9a723 100644 --- a/include/pmu.h +++ b/include/pmu.h @@ -139,14 +139,6 @@ int PmuOpen(enum PmuTaskType collectType, struct PmuAttr *attr); */ const char** PmuEventList(enum PmuEventType eventType, unsigned *numEvt); -/** - * @brief - * Free eventList pointer. - * @param eventList event list - * @param numEvt length of event list - */ -void PmuEventListFree(); - /** * @brief * Enable counting or sampling of task . diff --git a/pmu/pmu_event_list.cpp b/pmu/pmu_event_list.cpp index 5be2d87..849ec9a 100644 --- a/pmu/pmu_event_list.cpp +++ b/pmu/pmu_event_list.cpp @@ -1,9 +1,17 @@ -/** - * @copyright Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved. - * @brief - * @version 24.0 - * @date 2024-04-18 - */ +/****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved. + * gala-gopher licensed under the 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. + * Author: Mr.Ye + * Create: 2024-04-03 + * Description: definitions of interfaces of querying and freeing pmu event list + ******************************************************************************/ #include #include #include diff --git a/pmu/pmu_event_list.h b/pmu/pmu_event_list.h new file mode 100644 index 0000000..82832df --- /dev/null +++ b/pmu/pmu_event_list.h @@ -0,0 +1,20 @@ +/****************************************************************************** + * Copyright (c) Huawei Technologies Co., Ltd. 2024. All rights reserved. + * gala-gopher licensed under the 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. + * Author: Mr.Ye + * Create: 2024-04-03 + * Description: declaration of interface of freeing pmu event list + ******************************************************************************/ +#ifndef PMU_EVENT_LIST_H +#define PMU_EVENT_LIST_H + +void PmuEventListFree(); + +#endif // PMU_EVENT_LIST_H diff --git a/pmu/pmu_list.cpp b/pmu/pmu_list.cpp index 0d1c0a7..e79b854 100644 --- a/pmu/pmu_list.cpp +++ b/pmu/pmu_list.cpp @@ -23,6 +23,7 @@ #include "pcerr.h" #include "util_time.h" #include "log.h" +#include "pmu_event_list.h" #include "pmu_list.h" #include "common.h" -- Gitee