42#include "params/MemTraceProbe.hh"
43#include "proto/packet.pb.h"
58 if (
p.trace_file !=
"") {
63 const std::string suffix =
".gz";
66 if (
p.trace_compress &&
67 filename.compare(filename.size() - suffix.size(), suffix.size(),
69 filename = filename + suffix;
74 (
p.trace_compress ?
".gz" :
""));
90 ProtoMessage::PacketHeader header_msg;
91 header_msg.set_obj_id(
name());
95 auto id_string = header_msg.add_id_strings();
96 id_string->set_key(
i);
113 ProtoMessage::Packet pkt_msg;
116 pkt_msg.set_cmd(pkt_info.
cmd.
toInt());
117 pkt_msg.set_flags(pkt_info.
flags);
118 pkt_msg.set_addr(pkt_info.
addr);
119 pkt_msg.set_size(pkt_info.
size);
121 pkt_msg.set_pc(pkt_info.
pc);
122 pkt_msg.set_pkt_id(pkt_info.
id);
A ProtoOutputStream wraps a coded stream, potentially with compression, based on looking at the file ...
void write(const google::protobuf::Message &msg)
Write a message to the stream, preprending it with the message size.
Base class for memory system probes accepting Packet instances.
const bool withPC
Include the Program Counter in the memory trace.
ProtoOutputStream * traceStream
Trace output stream.
void startup() override
startup() is the final initialization call before simulation.
void closeStreams()
Callback to flush and close all open output streams on exit.
void handleRequest(const probing::PacketInfo &pkt_info) override
Callback to analyse intercepted Packets.
MemTraceProbe(const MemTraceProbeParams ¶ms)
virtual std::string name() const
std::string resolve(const std::string &name) const
Returns relative file names prepended with name of this directory.
std::string getRequestorName(RequestorID requestor_id)
Get the name of an object for a given request id.
RequestorID maxRequestors()
Get the number of requestors registered in the system.
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
void registerExitCallback(const std::function< void()> &callback)
Register an exit callback.
A struct to hold on to the essential fields from a packet, so that the packet and underlying request ...