mirror of
https://gitee.com/openharmony/hiviewdfx_hiview
synced 2024-11-23 09:09:49 +00:00
modify same name file
Signed-off-by: negegne <zhengshunxin@huawei.com>
This commit is contained in:
parent
d7a1605563
commit
42e6c5dc41
@ -16,8 +16,8 @@
|
||||
#ifndef OHOS_HIVIEWDFX_ADAPTER_SERVICE_IDL_INCLUDE_MEMORY_DELEGATE_H
|
||||
#define OHOS_HIVIEWDFX_ADAPTER_SERVICE_IDL_INCLUDE_MEMORY_DELEGATE_H
|
||||
|
||||
#include "client/memory_collector_client.h"
|
||||
#include "collect_result.h"
|
||||
#include "client/memory_collector.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -18,11 +18,11 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "client/trace_collector_client.h"
|
||||
#include "collect_result.h"
|
||||
#include "hiview_service_ability_proxy.h"
|
||||
#include "hiview_remote_service.h"
|
||||
#include "hiview_service_ability_proxy.h"
|
||||
#include "parcel.h"
|
||||
#include "client/trace_collector.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -16,8 +16,8 @@
|
||||
#include "hiview_service_trace_delegate.h"
|
||||
|
||||
#include "hiview_err_code.h"
|
||||
#include "iservice_registry.h"
|
||||
#include "hiview_logger.h"
|
||||
#include "iservice_registry.h"
|
||||
#include "system_ability_definition.h"
|
||||
|
||||
namespace OHOS {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -18,12 +18,12 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "hiview_file_info.h"
|
||||
#include "iremote_broker.h"
|
||||
#include "hiview_service_ipc_interface_code.h"
|
||||
#include "client/memory_collector_client.h"
|
||||
#include "client/trace_collector_client.h"
|
||||
#include "collect_result_pracelable.h"
|
||||
#include "client/trace_collector.h"
|
||||
#include "client/memory_collector.h"
|
||||
#include "hiview_file_info.h"
|
||||
#include "hiview_service_ipc_interface_code.h"
|
||||
#include "iremote_broker.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -27,8 +27,8 @@
|
||||
#include "hiview_logger.h"
|
||||
#include "singleton.h"
|
||||
#include "system_ability.h"
|
||||
#include "client/trace_collector.h"
|
||||
#include "client/memory_collector.h"
|
||||
#include "client/trace_collector_client.h"
|
||||
#include "client/memory_collector_client.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
|
@ -20,8 +20,8 @@
|
||||
|
||||
#include "accesstoken_kit.h"
|
||||
#include "ash_memory_utils.h"
|
||||
#include "client/trace_collector.h"
|
||||
#include "client/memory_collector.h"
|
||||
#include "client/trace_collector_client.h"
|
||||
#include "client/memory_collector_client.h"
|
||||
#include "errors.h"
|
||||
#include "hiview_err_code.h"
|
||||
#include "ipc_skeleton.h"
|
||||
|
@ -137,8 +137,8 @@
|
||||
"header": {
|
||||
"header_base": "//base/hiviewdfx/hiview/interfaces/inner_api/unified_collection",
|
||||
"header_files": [
|
||||
"client/cpu_collector.h",
|
||||
"client/trace_collector.h"
|
||||
"client/cpu_collector_client.h",
|
||||
"client/trace_collector_client.h"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -1,47 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_MEMORY_COLLECTOR_H
|
||||
#define INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_MEMORY_COLLECTOR_H
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "collect_result.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
struct MemoryCaller {
|
||||
int32_t pid;
|
||||
std::string resourceType;
|
||||
int32_t limitValue;
|
||||
bool enabledDebugLog;
|
||||
};
|
||||
|
||||
class MemoryCollector {
|
||||
public:
|
||||
MemoryCollector() = default;
|
||||
virtual ~MemoryCollector() = default;
|
||||
|
||||
public:
|
||||
virtual CollectResult<int32_t> SetAppResourceLimit(UCollectClient::MemoryCaller& memoryCaller) = 0;
|
||||
virtual CollectResult<int32_t> GetGraphicUsage() = 0;
|
||||
static std::shared_ptr<MemoryCollector> Create();
|
||||
}; // MemoryCollector
|
||||
} // UCollectClient
|
||||
} // HiviewDFX
|
||||
} // OHOS
|
||||
#endif // INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_MEMORY_COLLECTOR_H
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_MEMORY_COLLECTOR_H
|
||||
#define INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_MEMORY_COLLECTOR_H
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "collect_result.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
struct MemoryCaller {
|
||||
int32_t pid;
|
||||
std::string resourceType;
|
||||
int32_t limitValue;
|
||||
bool enabledDebugLog;
|
||||
};
|
||||
|
||||
class MemoryCollector {
|
||||
public:
|
||||
MemoryCollector() = default;
|
||||
virtual ~MemoryCollector() = default;
|
||||
|
||||
public:
|
||||
virtual CollectResult<int32_t> SetAppResourceLimit(UCollectClient::MemoryCaller& memoryCaller) = 0;
|
||||
virtual CollectResult<int32_t> GetGraphicUsage() = 0;
|
||||
static std::shared_ptr<MemoryCollector> Create();
|
||||
}; // MemoryCollector
|
||||
} // UCollectClient
|
||||
} // HiviewDFX
|
||||
} // OHOS
|
||||
#endif // INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_MEMORY_COLLECTOR_H
|
@ -31,9 +31,9 @@ ohos_source_set("ucollection_client_source") {
|
||||
public_configs = [ ":ucolletciton_client_source_config" ]
|
||||
|
||||
sources = [
|
||||
"cpu_collector_impl.cpp",
|
||||
"memory_collector_impl.cpp",
|
||||
"trace_collector_impl.cpp",
|
||||
"cpu_collector_client_impl.cpp",
|
||||
"memory_collector_client_impl.cpp",
|
||||
"trace_collector_client_impl.cpp",
|
||||
]
|
||||
|
||||
deps = [
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "cpu_collector.h"
|
||||
#include "cpu_collector_client.h"
|
||||
#include "hiview_service_cpu_delegate.h"
|
||||
|
||||
using namespace OHOS::HiviewDFX::UCollect;
|
@ -1,50 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "memory_collector.h"
|
||||
#include "hiview_service_memory_delegate.h"
|
||||
|
||||
using namespace OHOS::HiviewDFX::UCollect;
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
|
||||
class MemoryCollectorImpl : public MemoryCollector {
|
||||
public:
|
||||
MemoryCollectorImpl() = default;
|
||||
virtual ~MemoryCollectorImpl() = default;
|
||||
public:
|
||||
CollectResult<int32_t> SetAppResourceLimit(UCollectClient::MemoryCaller& memoryCaller) override;
|
||||
CollectResult<int32_t> GetGraphicUsage() override;
|
||||
};
|
||||
|
||||
std::shared_ptr<MemoryCollector> MemoryCollector::Create()
|
||||
{
|
||||
return std::make_shared<MemoryCollectorImpl>();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> MemoryCollectorImpl::SetAppResourceLimit(UCollectClient::MemoryCaller& memoryCaller)
|
||||
{
|
||||
return HiViewServiceMemoryDelegate::SetAppResourceLimit(memoryCaller);
|
||||
}
|
||||
|
||||
CollectResult<int32_t> MemoryCollectorImpl::GetGraphicUsage()
|
||||
{
|
||||
return HiViewServiceMemoryDelegate::GetGraphicUsage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "memory_collector_client.h"
|
||||
#include "hiview_service_memory_delegate.h"
|
||||
|
||||
using namespace OHOS::HiviewDFX::UCollect;
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
|
||||
class MemoryCollectorImpl : public MemoryCollector {
|
||||
public:
|
||||
MemoryCollectorImpl() = default;
|
||||
virtual ~MemoryCollectorImpl() = default;
|
||||
public:
|
||||
CollectResult<int32_t> SetAppResourceLimit(UCollectClient::MemoryCaller& memoryCaller) override;
|
||||
CollectResult<int32_t> GetGraphicUsage() override;
|
||||
};
|
||||
|
||||
std::shared_ptr<MemoryCollector> MemoryCollector::Create()
|
||||
{
|
||||
return std::make_shared<MemoryCollectorImpl>();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> MemoryCollectorImpl::SetAppResourceLimit(UCollectClient::MemoryCaller& memoryCaller)
|
||||
{
|
||||
return HiViewServiceMemoryDelegate::SetAppResourceLimit(memoryCaller);
|
||||
}
|
||||
|
||||
CollectResult<int32_t> MemoryCollectorImpl::GetGraphicUsage()
|
||||
{
|
||||
return HiViewServiceMemoryDelegate::GetGraphicUsage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,86 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "trace_collector.h"
|
||||
|
||||
#include "hiview_service_trace_delegate.h"
|
||||
|
||||
using namespace OHOS::HiviewDFX::UCollect;
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
class TraceCollectorImpl : public TraceCollector {
|
||||
public:
|
||||
TraceCollectorImpl() = default;
|
||||
virtual ~TraceCollectorImpl() = default;
|
||||
|
||||
public:
|
||||
virtual CollectResult<int32_t> OpenSnapshot(const std::vector<std::string>& tagGroups) override;
|
||||
virtual CollectResult<std::vector<std::string>> DumpSnapshot(TraceCaller caller) override;
|
||||
virtual CollectResult<int32_t> OpenRecording(const std::string& tags) override;
|
||||
virtual CollectResult<int32_t> RecordingOn() override;
|
||||
virtual CollectResult<std::vector<std::string>> RecordingOff() override;
|
||||
virtual CollectResult<int32_t> Close() override;
|
||||
virtual CollectResult<int32_t> Recover() override;
|
||||
virtual CollectResult<int32_t> CaptureDurationTrace(AppCaller &appCaller) override;
|
||||
};
|
||||
|
||||
std::shared_ptr<TraceCollector> TraceCollector::Create()
|
||||
{
|
||||
return std::make_shared<TraceCollectorImpl>();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::OpenSnapshot(const std::vector<std::string>& tagGroups)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::OpenSnapshot(tagGroups);
|
||||
}
|
||||
|
||||
CollectResult<std::vector<std::string>> TraceCollectorImpl::DumpSnapshot(TraceCaller caller)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::DumpSnapshot(caller);
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::OpenRecording(const std::string& tags)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::OpenRecording(tags);
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::RecordingOn()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::RecordingOn();
|
||||
}
|
||||
|
||||
CollectResult<std::vector<std::string>> TraceCollectorImpl::RecordingOff()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::RecordingOff();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::Close()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::Close();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::Recover()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::Recover();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::CaptureDurationTrace(AppCaller &appCaller)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::CaptureDurationTrace(appCaller);
|
||||
}
|
||||
} // UCollectClient
|
||||
} // HiViewDFX
|
||||
} // OHOS
|
||||
/*
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "trace_collector_client.h"
|
||||
|
||||
#include "hiview_service_trace_delegate.h"
|
||||
|
||||
using namespace OHOS::HiviewDFX::UCollect;
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
class TraceCollectorImpl : public TraceCollector {
|
||||
public:
|
||||
TraceCollectorImpl() = default;
|
||||
virtual ~TraceCollectorImpl() = default;
|
||||
|
||||
public:
|
||||
virtual CollectResult<int32_t> OpenSnapshot(const std::vector<std::string>& tagGroups) override;
|
||||
virtual CollectResult<std::vector<std::string>> DumpSnapshot(TraceCaller caller) override;
|
||||
virtual CollectResult<int32_t> OpenRecording(const std::string& tags) override;
|
||||
virtual CollectResult<int32_t> RecordingOn() override;
|
||||
virtual CollectResult<std::vector<std::string>> RecordingOff() override;
|
||||
virtual CollectResult<int32_t> Close() override;
|
||||
virtual CollectResult<int32_t> Recover() override;
|
||||
virtual CollectResult<int32_t> CaptureDurationTrace(AppCaller &appCaller) override;
|
||||
};
|
||||
|
||||
std::shared_ptr<TraceCollector> TraceCollector::Create()
|
||||
{
|
||||
return std::make_shared<TraceCollectorImpl>();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::OpenSnapshot(const std::vector<std::string>& tagGroups)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::OpenSnapshot(tagGroups);
|
||||
}
|
||||
|
||||
CollectResult<std::vector<std::string>> TraceCollectorImpl::DumpSnapshot(TraceCaller caller)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::DumpSnapshot(caller);
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::OpenRecording(const std::string& tags)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::OpenRecording(tags);
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::RecordingOn()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::RecordingOn();
|
||||
}
|
||||
|
||||
CollectResult<std::vector<std::string>> TraceCollectorImpl::RecordingOff()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::RecordingOff();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::Close()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::Close();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::Recover()
|
||||
{
|
||||
return HiViewServiceTraceDelegate::Recover();
|
||||
}
|
||||
|
||||
CollectResult<int32_t> TraceCollectorImpl::CaptureDurationTrace(AppCaller &appCaller)
|
||||
{
|
||||
return HiViewServiceTraceDelegate::CaptureDurationTrace(appCaller);
|
||||
}
|
||||
} // UCollectClient
|
||||
} // HiViewDFX
|
||||
} // OHOS
|
@ -1,67 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_TRACE_COLLECTOR_H
|
||||
#define INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_TRACE_COLLECTOR_H
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "collect_result.h"
|
||||
#include "trace_caller.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
constexpr int32_t ACTION_ID_START_TRACE = 1;
|
||||
constexpr int32_t ACTION_ID_DUMP_TRACE = 2;
|
||||
|
||||
struct AppCaller {
|
||||
int32_t actionId; // 1: start trace; 2: dump trace
|
||||
std::string bundleName; // app bundle name
|
||||
std::string bundleVersion; // app bundle version
|
||||
std::string threadName; // app thread name
|
||||
int32_t foreground; // app foreground
|
||||
int32_t uid; // app user id
|
||||
int32_t pid; // app process id
|
||||
int64_t happenTime; // jank happend time, millisecond unit
|
||||
int64_t beginTime; // message handle begin time, millisecond unit
|
||||
int64_t endTime; // message handle end time, millisecond unit
|
||||
bool isBusinessJank = false; // is business jank or not, control output file name
|
||||
};
|
||||
|
||||
class TraceCollector {
|
||||
public:
|
||||
TraceCollector() = default;
|
||||
virtual ~TraceCollector() = default;
|
||||
|
||||
public:
|
||||
virtual CollectResult<int32_t> OpenSnapshot(const std::vector<std::string>& tagGroups) = 0;
|
||||
virtual CollectResult<std::vector<std::string>> DumpSnapshot(
|
||||
UCollect::TraceCaller caller = UCollect::TraceCaller::OTHER) = 0;
|
||||
virtual CollectResult<int32_t> OpenRecording(const std::string& tags) = 0;
|
||||
virtual CollectResult<int32_t> RecordingOn() = 0;
|
||||
virtual CollectResult<std::vector<std::string>> RecordingOff() = 0;
|
||||
virtual CollectResult<int32_t> Close() = 0;
|
||||
virtual CollectResult<int32_t> Recover() = 0;
|
||||
// use for hap main looper
|
||||
virtual CollectResult<int32_t> CaptureDurationTrace(AppCaller &appCaller) = 0;
|
||||
|
||||
static std::shared_ptr<TraceCollector> Create();
|
||||
}; // TraceCollector
|
||||
} // UCollectClient
|
||||
} // HiviewDFX
|
||||
} // OHOS
|
||||
#endif // INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_TRACE_COLLECTOR_H
|
||||
/*
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_TRACE_COLLECTOR_H
|
||||
#define INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_TRACE_COLLECTOR_H
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "collect_result.h"
|
||||
#include "trace_caller.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
namespace UCollectClient {
|
||||
constexpr int32_t ACTION_ID_START_TRACE = 1;
|
||||
constexpr int32_t ACTION_ID_DUMP_TRACE = 2;
|
||||
|
||||
struct AppCaller {
|
||||
int32_t actionId; // 1: start trace; 2: dump trace
|
||||
std::string bundleName; // app bundle name
|
||||
std::string bundleVersion; // app bundle version
|
||||
std::string threadName; // app thread name
|
||||
int32_t foreground; // app foreground
|
||||
int32_t uid; // app user id
|
||||
int32_t pid; // app process id
|
||||
int64_t happenTime; // jank happend time, millisecond unit
|
||||
int64_t beginTime; // message handle begin time, millisecond unit
|
||||
int64_t endTime; // message handle end time, millisecond unit
|
||||
bool isBusinessJank = false; // is business jank or not, control output file name
|
||||
};
|
||||
|
||||
class TraceCollector {
|
||||
public:
|
||||
TraceCollector() = default;
|
||||
virtual ~TraceCollector() = default;
|
||||
|
||||
public:
|
||||
virtual CollectResult<int32_t> OpenSnapshot(const std::vector<std::string>& tagGroups) = 0;
|
||||
virtual CollectResult<std::vector<std::string>> DumpSnapshot(
|
||||
UCollect::TraceCaller caller = UCollect::TraceCaller::OTHER) = 0;
|
||||
virtual CollectResult<int32_t> OpenRecording(const std::string& tags) = 0;
|
||||
virtual CollectResult<int32_t> RecordingOn() = 0;
|
||||
virtual CollectResult<std::vector<std::string>> RecordingOff() = 0;
|
||||
virtual CollectResult<int32_t> Close() = 0;
|
||||
virtual CollectResult<int32_t> Recover() = 0;
|
||||
// use for hap main looper
|
||||
virtual CollectResult<int32_t> CaptureDurationTrace(AppCaller &appCaller) = 0;
|
||||
|
||||
static std::shared_ptr<TraceCollector> Create();
|
||||
}; // TraceCollector
|
||||
} // UCollectClient
|
||||
} // HiviewDFX
|
||||
} // OHOS
|
||||
#endif // INTERFACES_INNER_API_UNIFIED_COLLECTION_CLIENT_TRACE_COLLECTOR_H
|
@ -21,11 +21,11 @@
|
||||
#include <vector>
|
||||
|
||||
#include "audit_log_parser.h"
|
||||
#include "utility/trace_collector.h"
|
||||
#include "client/memory_collector_client.h"
|
||||
#include "client/trace_collector_client.h"
|
||||
#include "utility/cpu_collector.h"
|
||||
#include "client/trace_collector.h"
|
||||
#include "client/memory_collector.h"
|
||||
#include "utility/memory_collector.h"
|
||||
#include "utility/graphic_memory_collector.h"
|
||||
#include "utility/trace_collector.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace HiviewDFX {
|
||||
@ -76,7 +76,7 @@ private:
|
||||
std::unique_ptr<AuditLogParser> parser_ = nullptr;
|
||||
std::shared_ptr<UCollectUtil::TraceCollector> traceCollector_;
|
||||
std::shared_ptr<UCollectUtil::CpuCollector> cpuCollector_;
|
||||
std::shared_ptr<UCollectUtil::MemoryCollector> memoryCollector_;
|
||||
std::shared_ptr<UCollectUtil::GraphicMemoryCollector> graphicMemoryCollector_;
|
||||
};
|
||||
} // namespace HiviewDFX
|
||||
} // namespace OHOS
|
||||
|
@ -14,12 +14,11 @@
|
||||
*/
|
||||
|
||||
#include <climits>
|
||||
#include <gtest/gtest.h>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "cpu_collector.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "cpu_collector_client.h"
|
||||
|
||||
using namespace testing::ext;
|
||||
using namespace OHOS::HiviewDFX;
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "memory_collector.h"
|
||||
#include "memory_collector_client.h"
|
||||
|
||||
using namespace testing::ext;
|
||||
using namespace OHOS::HiviewDFX;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
* Copyright (c) 2023-2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -13,17 +13,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
#include <gtest/gtest.h>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "accesstoken_kit.h"
|
||||
#include "nativetoken_kit.h"
|
||||
#include "token_setproc.h"
|
||||
#include "trace_collector.h"
|
||||
#include "parameter_ex.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <unistd.h>
|
||||
#include <ctime>
|
||||
#include "token_setproc.h"
|
||||
#include "trace_collector_client.h"
|
||||
|
||||
using namespace testing::ext;
|
||||
using namespace OHOS::HiviewDFX;
|
||||
|
Loading…
Reference in New Issue
Block a user