@@ -32,7 +32,7 @@ execute_process ( COMMAND sh -xc "if [ -e ${TEST_DIR}/hsa ] ; then cd ${TEST_DIR
|
||||
file( GLOB UTIL_SRC "${TEST_HSA}/util/*.cpp" )
|
||||
|
||||
## Build test library
|
||||
set ( TEST_LIB "tool" )
|
||||
set ( TEST_LIB "tracer_tool" )
|
||||
set ( TEST_LIB_SRC ${TEST_DIR}/tool/tool.cpp ${UTIL_SRC} )
|
||||
add_library ( ${TEST_LIB} SHARED ${TEST_LIB_SRC} )
|
||||
target_include_directories ( ${TEST_LIB} PRIVATE ${TEST_HSA} ${ROOT_DIR} ${HSA_RUNTIME_INC_PATH} )
|
||||
|
||||
@@ -43,7 +43,7 @@ export ROCP_THRS=1
|
||||
# paths to ROC profiler and oher libraries
|
||||
export LD_LIBRARY_PATH=$PWD
|
||||
# ROC profiler library loaded by HSA runtime
|
||||
export HSA_TOOLS_LIB="test/libtool.so libroctracer64.so"
|
||||
export HSA_TOOLS_LIB="test/tracer_libtool.so libroctracer64.so"
|
||||
export LD_PRELOAD="libroctracer64.so"
|
||||
|
||||
eval ./test/hsa/ctrl
|
||||
|
||||
@@ -20,7 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <inc/roctracer_hsa.h>
|
||||
#include <inc/ext/hsa_rt_utils.hpp>
|
||||
|
||||
@@ -45,8 +49,12 @@ void hsa_api_callback(
|
||||
if (data->phase == ACTIVITY_API_PHASE_ENTER) {
|
||||
begin_timestamp = timer.timestamp_fn_ns();
|
||||
} else {
|
||||
timestamp_t duration_ns = (cid == HSA_API_ID_hsa_shut_down) ? 0 : timer.timestamp_fn_ns() - begin_timestamp;
|
||||
fprintf(stdout, "%s,%luns\n", roctracer_id_string(domain, cid, 0), duration_ns);
|
||||
const timestamp_t end_timestamp = (cid == HSA_API_ID_hsa_shut_down) ? begin_timestamp : timer.timestamp_fn_ns();
|
||||
// const timestamp_t duration_ns = end_timestamp - begin_timestamp;
|
||||
// fprintf(stdout, "%s,%luns\n", roctracer_id_string(domain, cid, 0), duration_ns);
|
||||
std::ostringstream os;
|
||||
os << '(' << begin_timestamp << ":" << end_timestamp << ") " << hsa_api_data_pair_t(cid, *data);
|
||||
fprintf(stdout, "%s\n", os.str().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user