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:
@@ -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 { \
|
||||
|
||||
مرجع در شماره جدید
Block a user