Line data Source code
1 : /** 2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd. 3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of 4 : * CANN Open Software License Agreement Version 2.0 (the "License"). 5 : * Please refer to the License for details. You may not use this file except in compliance with the License. 6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 8 : * See LICENSE in the root of the software repository for the full text of the License. 9 : */ 10 : 11 : #include "acl_rt_impl.h" 12 : 13 : #include "runtime/rts/rts_dfx.h" 14 : 15 : #include "common/log_inner.h" 16 : #include "common/error_codes_inner.h" 17 : #include "common/prof_reporter.h" 18 : #include "common/resource_statistics.h" 19 : 20 4 : aclError aclrtProfTraceImpl(void *userdata, int32_t length, aclrtStream stream) 21 : { 22 8 : ACL_PROFILING_REG(acl::AclProfType::AclrtProfTrace); 23 4 : ACL_LOG_INFO("start to execute AclrtProfTrace, length is [%d]", length); 24 4 : ACL_REQUIRES_NOT_NULL_WITH_INNER_REPORT(userdata); 25 3 : const auto rtErr = rtsProfTrace(userdata, length, stream); 26 3 : if (rtErr != RT_ERROR_NONE) { 27 1 : ACL_LOG_CALL_ERROR("call rtsProfTrace failed, runtime result = %d", rtErr); 28 1 : return ACL_GET_ERRCODE_RTS(rtErr); 29 : } 30 2 : return ACL_SUCCESS; 31 : }