V1/V2 API Library Separation
V1 library will be supported as librocprofiler64.so and V2 will be supported as librocprofiler64v2.so and headers will be rocprofiler.h for V1 and v2/rocprofiler.h for v2
Change-Id: Ibe5bdbf2f79f0175342c648e917ae77918186604
[ROCm/rocprofiler commit: 9e62e066fe]
Este cometimento está contido em:
cometido por
Ammar Elwazir
ascendente
6b53186f13
cometimento
7647f6988f
@@ -20,7 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
#define ROCP_INTERNAL_BUILD
|
||||
#include "activity.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
#ifndef _SRC_CORE_ACTIVITY_H
|
||||
#define _SRC_CORE_ACTIVITY_H
|
||||
|
||||
#define ROCPROFILER_V1
|
||||
|
||||
#ifdef ROCP_INTERNAL_BUILD
|
||||
#include "inc/rocprofiler.h"
|
||||
#else
|
||||
#include <rocprofiler/rocprofiler.h>
|
||||
#endif
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ THE SOFTWARE.
|
||||
#ifndef SRC_CORE_CONTEXT_H_
|
||||
#define SRC_CORE_CONTEXT_H_
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <hsa/hsa_ext_amd.h>
|
||||
|
||||
@@ -23,7 +23,7 @@ THE SOFTWARE.
|
||||
#ifndef SRC_CORE_CONTEXT_POOL_H_
|
||||
#define SRC_CORE_CONTEXT_POOL_H_
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef SRC_CORE_COUNTERS_PERFMON_H
|
||||
#define SRC_CORE_COUNTERS_PERFMON_H
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "mmio.h"
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef SRC_CORE_HSA_PACKETS_PACKETS_GENERATOR_H_
|
||||
#define SRC_CORE_HSA_PACKETS_PACKETS_GENERATOR_H_
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <hsa/hsa_api_trace.h>
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
|
||||
#include "rocprofiler.h"
|
||||
#include "src/api/rocmtool.h"
|
||||
#include "src/core/hsa/packets/packets_generator.h"
|
||||
#include "src/core/hsa/hsa_support.h"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef SRC_CORE_HSA_QUEUES_QUEUE_H_
|
||||
#define SRC_CORE_HSA_QUEUES_QUEUE_H_
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <hsa/hsa_api_trace.h>
|
||||
|
||||
@@ -33,7 +33,7 @@ SOFTWARE.
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "util/exception.h"
|
||||
#include "util/hsa_rsrc_factory.h"
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ THE SOFTWARE.
|
||||
#include "core/proxy_queue.h"
|
||||
#include "core/tracker.h"
|
||||
#include "core/types.h"
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "util/hsa_rsrc_factory.h"
|
||||
|
||||
namespace rocprofiler {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#ifndef SRC_CORE_MEMORY_GENERIC_BUFFER_H_
|
||||
#define SRC_CORE_MEMORY_GENERIC_BUFFER_H_
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <bitset>
|
||||
#include <cassert>
|
||||
|
||||
@@ -23,7 +23,7 @@ THE SOFTWARE.
|
||||
#ifndef SRC_CORE_PROFILE_H_
|
||||
#define SRC_CORE_PROFILE_H_
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <vector>
|
||||
|
||||
@@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#include <hsa/hsa.h>
|
||||
#include <string.h>
|
||||
@@ -39,8 +39,6 @@ THE SOFTWARE.
|
||||
#include "util/exception.h"
|
||||
#include "util/hsa_rsrc_factory.h"
|
||||
#include "util/logger.h"
|
||||
#include "src/core/hsa/hsa_support.h"
|
||||
#include "src/utils/helper.h"
|
||||
|
||||
#define PUBLIC_API __attribute__((visibility("default")))
|
||||
#define CONSTRUCTOR_API __attribute__((constructor))
|
||||
@@ -380,9 +378,6 @@ std::atomic<util::Logger*> util::Logger::instance_{};
|
||||
|
||||
CONTEXT_INSTANTIATE();
|
||||
|
||||
static bool started{false};
|
||||
// #include "src/core/hsa/hsa_support.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Public library methods
|
||||
//
|
||||
@@ -398,11 +393,6 @@ ROCPROFILER_EXPORT extern const uint32_t HSA_AMD_TOOL_PRIORITY = 25;
|
||||
PUBLIC_API bool OnLoad(HsaApiTable* table, uint64_t runtime_version, uint64_t failed_tool_count,
|
||||
const char* const* failed_tool_names) {
|
||||
ONLOAD_TRACE_BEG();
|
||||
if (started) rocmtools::fatal("HSA Tool started already!");
|
||||
started = true;
|
||||
if (!getenv("ROCP_TOOL_LIB") && !getenv("ROCP_HSA_INTERCEPT")) {
|
||||
rocmtools::hsa_support::Initialize(table);
|
||||
} else {
|
||||
rocprofiler::SaveHsaApi(table);
|
||||
rocprofiler::ProxyQueue::InitFactory();
|
||||
|
||||
@@ -469,20 +459,14 @@ PUBLIC_API bool OnLoad(HsaApiTable* table, uint64_t runtime_version, uint64_t fa
|
||||
ONLOAD_TRACE("end intercept_mode(" << std::hex << intercept_env_value << ")"
|
||||
<< " intercept_mode_mask(" << std::hex << intercept_mode_mask
|
||||
<< ")" << std::dec);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// HSA-runtime tool on-unload method
|
||||
PUBLIC_API void OnUnload() {
|
||||
ONLOAD_TRACE_BEG();
|
||||
if (!started) rocmtools::fatal("HSA Tool hasn't started yet!");
|
||||
if (!getenv("ROCP_TOOL_LIB") && !getenv("ROCP_HSA_INTERCEPT")) {
|
||||
rocmtools::hsa_support::Finalize();
|
||||
} else {
|
||||
rocprofiler::UnloadTool();
|
||||
rocprofiler::RestoreHsaApi();
|
||||
}
|
||||
ONLOAD_TRACE_END();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
namespace rocmtools {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef SRC_CORE_SESSION_DEVICE_PROFILING_H_
|
||||
#define SRC_CORE_SESSION_DEVICE_PROFILING_H_
|
||||
|
||||
#include <rocprofiler.h>
|
||||
#include "rocprofiler.h"
|
||||
#include "src/core/hsa/packets/packets_generator.h"
|
||||
#include <mutex>
|
||||
// #include "src/core/counters/rdc/rdc_metrics.h"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
#define ASSERTM(exp, msg) assert(((void)msg, exp))
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "src/core/counters/basic/basic_counter.h"
|
||||
#include "src/core/counters/metrics/eval_metrics.h"
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "src/core/memory/generic_buffer.h"
|
||||
#include "src/core/session/filter.h"
|
||||
#include "profiler/profiler.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "hsa/hsa_ext_amd.h"
|
||||
#include "src/core/hsa/packets/packets_generator.h"
|
||||
#include "src/utils/exception.h"
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
|
||||
|
||||
namespace rocmtools {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "hip_ostream_ops.h"
|
||||
#include "hsa_ostream_ops.h"
|
||||
#include "hsa_prof_str.h"
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "src/core/memory/generic_buffer.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "src/roctracer.h"
|
||||
|
||||
typedef bool is_filtered_domain_t;
|
||||
|
||||
@@ -33,7 +33,7 @@ THE SOFTWARE.
|
||||
#include <mutex>
|
||||
|
||||
#include "util/hsa_rsrc_factory.h"
|
||||
#include "inc/rocprofiler.h"
|
||||
#include "rocprofiler.h"
|
||||
#include "util/exception.h"
|
||||
#include "util/logger.h"
|
||||
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador