mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Adding support for kernel disasm using IGA
Change-Id: Ic75540c9b42913f5d12d66438cc4e6dcc39ceb98
This commit is contained in:
committed by
sys_ocldev
parent
79e78e18c4
commit
2f42f332d8
@@ -9,6 +9,7 @@
|
||||
#include "elf/types.h"
|
||||
|
||||
#include "helper.h"
|
||||
#include "iga_wrapper.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@@ -21,7 +22,7 @@ struct PTField {
|
||||
};
|
||||
|
||||
struct BinaryHeader {
|
||||
std::vector<PTField> fields; // (size, name)
|
||||
std::vector<PTField> fields;
|
||||
uint32_t size;
|
||||
};
|
||||
struct PatchToken : BinaryHeader {
|
||||
@@ -32,7 +33,9 @@ using PTMap = std::unordered_map<uint8_t, std::unique_ptr<PatchToken>>;
|
||||
|
||||
class BinaryDecoder {
|
||||
public:
|
||||
BinaryDecoder() = default;
|
||||
BinaryDecoder() : iga(new IgaWrapper) {
|
||||
iga->setMessagePrinter(messagePrinter);
|
||||
}
|
||||
BinaryDecoder(const std::string &file, const std::string &patch, const std::string &dump)
|
||||
: binaryFile(file), pathToPatch(patch), pathToDump(dump){};
|
||||
int decode();
|
||||
@@ -43,6 +46,7 @@ class BinaryDecoder {
|
||||
protected:
|
||||
BinaryHeader programHeader, kernelHeader;
|
||||
CLElfLib::ElfBinaryStorage binary;
|
||||
std::unique_ptr<IgaWrapper> iga;
|
||||
PTMap patchTokens;
|
||||
std::string binaryFile, pathToPatch, pathToDump;
|
||||
MessagePrinter messagePrinter;
|
||||
|
||||
Reference in New Issue
Block a user