* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Nathan Binkert
*/
#ifndef __CPU_PROFILE_HH__
#include <map>
-#include "cpu/static_inst.hh"
-#include "sim/host.hh"
#include "arch/stacktrace.hh"
+#include "base/types.hh"
+#include "config/the_isa.hh"
+#include "cpu/static_inst.hh"
-class ExecContext;
+class ThreadContext;
class ProfileNode
{
const SymbolTable *symtab;
ProfileNode top;
std::map<Addr, Counter> pc_count;
- StackTrace trace;
+ TheISA::StackTrace trace;
public:
FunctionProfile(const SymbolTable *symtab);
~FunctionProfile();
- ProfileNode *consume(ExecContext *xc, StaticInstPtr inst);
+ ProfileNode *consume(ThreadContext *tc, StaticInstPtr inst);
ProfileNode *consume(const std::vector<Addr> &stack);
void clear();
- void dump(ExecContext *xc, std::ostream &out) const;
+ void dump(ThreadContext *tc, std::ostream &out) const;
void sample(ProfileNode *node, Addr pc);
};
inline ProfileNode *
-FunctionProfile::consume(ExecContext *xc, StaticInstPtr inst)
+FunctionProfile::consume(ThreadContext *tc, StaticInstPtr inst)
{
- if (!trace.trace(xc, inst))
+ if (!trace.trace(tc, inst))
return NULL;
trace.dprintf();
return consume(trace.getstack());