Improve error reporting and error codes

Make error codes more informative and have negative values. This is an
ABI break but it does not appear known tools are relying on the exact
error codes.

Use logging for all errors so that roctracer_error_string will be able
to return last error message.

Make internal errors fatal and abort.

Do not use the tracer API exceptions in the tracer tool.

Change-Id: Ie8ed3d50e5ad26625ac9d1263f7e048edb5584c0
This commit is contained in:
Tony Tye
2022-05-21 02:50:49 +00:00
والد 1e7783af58
کامیت a4db4084db
5فایلهای تغییر یافته به همراه145 افزوده شده و 108 حذف شده
+9 -4
مشاهده پرونده
@@ -39,8 +39,7 @@
#include <mutex>
#include <map>
namespace roctracer {
namespace util {
namespace roctracer::util {
class Logger {
public:
@@ -164,8 +163,14 @@ class Logger {
std::map<uint32_t, std::string> message_;
};
} // namespace util
} // namespace roctracer
} // namespace roctracer::util
#define FATAL_LOGGING(stream) \
do { \
roctracer::util::Logger::Instance() \
<< "fatal: " << roctracer::util::Logger::begm << stream << roctracer::util::Logger::endl; \
abort(); \
} while (0)
#define ERR_LOGGING(stream) \
do { \