Commit 36d67f73 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

trace: add gem5 instruction event

parent aa796ba1
......@@ -42,6 +42,21 @@ class event {
virtual void dump(std::ostream &out) = 0;
};
class EHostInstr : public event {
public:
uint64_t pc;
EHostInstr(uint64_t ts_, uint64_t pc_) : event(ts_), pc(pc_) {
}
virtual ~EHostInstr() {
}
virtual void dump(std::ostream &out) {
out << ts << ": H.INSTR pc=" << std::hex << pc << std::dec << std::endl;
}
};
class EHostCall : public event {
public:
const std::string &fun;
......
......@@ -52,6 +52,8 @@ void gem5_parser::process_msg(uint64_t ts, char *comp_name,
if (!p.consume_hex(addr) || p.consume_char('.'))
return;
yield(std::make_shared<EHostInstr>(ts, addr));
if (const std::string *s = syms.lookup(addr)) {
yield(std::make_shared<EHostCall>(ts, *s));
}
......
......@@ -81,7 +81,10 @@ void Printer(coro_t::pull_type &source) {
uint64_t ts_off = 0;
for (auto ev: source) {
std::shared_ptr<EHostCall> hc;
if ((hc = std::dynamic_pointer_cast<EHostCall>(ev)) &&
std::shared_ptr<EHostInstr> hi;
if ((hi = std::dynamic_pointer_cast<EHostInstr>(ev))) {
continue;
} else if ((hc = std::dynamic_pointer_cast<EHostCall>(ev)) &&
strcmp(ev->source->label, "C") &&
hc->fun == "__sys_sendto") {
std::cout << "---------- REQ START:" << ev->ts << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment