Fixing Logging for profiler v2

Change-Id: I7e52236c828f441e78631c5125692959eac7260b


[ROCm/rocprofiler commit: bbc7bc1ada]
This commit is contained in:
gobhardw
2023-06-13 00:52:33 +05:30
committed by Gopesh Bhardwaj
orang tua 94e608e1ad
melakukan 41be6ae55a
3 mengubah file dengan 11 tambahan dan 4 penghapusan
+5
Melihat File
@@ -303,7 +303,12 @@ The user has two options for building:
```bash
cd build && cmake --build . -- -j check
```
## Logging
To enable error messages logging to '/tmp/rocprofiler_log.txt':
```bash
$ export ROCPROFILER_LOG=1
```
## Documentation
We make use of doxygen to automatically generate API documentation. Generated document can be found in the following path:
+3 -3
Melihat File
@@ -66,7 +66,7 @@ class Logger {
static void endl() { Instance().ResetStreaming(false); }
const std::string& LastMessage() {
std::lock_guard lock(mutex_);
std::lock_guard<std::recursive_mutex> lock(mutex_);
return message_[GetTid()];
}
@@ -94,7 +94,7 @@ class Logger {
}
void ResetStreaming(const bool messaging) {
std::lock_guard lock(mutex_);
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (messaging) {
message_[GetTid()] = "";
} else if (streaming_) {
@@ -106,7 +106,7 @@ class Logger {
}
void Put(const std::string& m) {
std::lock_guard lock(mutex_);
std::lock_guard<std::recursive_mutex> lock(mutex_);
if (messaging_) {
message_[GetTid()] += m;
}
@@ -35,7 +35,7 @@ THE SOFTWARE.
#include "src/utils/helper.h"
#include "utils/test_utils.h"
#include "utils/csv_parser.h"
#include "src/utils/logger.h"
std::string running_path;
std::string lib_path;
@@ -47,6 +47,7 @@ std::string profiler_api_lib_path = "";
static void init_test_path() {
if (is_installed_path()) {
INFO_LOGGING("operating from /opt/rocm");
running_path = "share/rocprofiler/tests/runFeatureTests";
lib_path = "lib/rocprofiler/librocprofiler_tool.so";
golden_trace_path = "share/rocprofiler/tests/featuretests/profiler/apps/goldentraces/";
@@ -55,6 +56,7 @@ static void init_test_path() {
binary_path = "bin/rocprofv2";
profiler_api_lib_path = "/lib";
} else {
INFO_LOGGING("operating from ./build/");
running_path = "tests-v2/featuretests/profiler/runFeatureTests";
lib_path = "librocprofiler_tool.so";
golden_trace_path = "tests-v2/featuretests/profiler/apps/goldentraces/";