summaryrefslogtreecommitdiff
path: root/src/arch/arm/linux/system.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm/linux/system.hh')
-rw-r--r--src/arch/arm/linux/system.hh42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/arch/arm/linux/system.hh b/src/arch/arm/linux/system.hh
index caf018cb9..feed8cfaa 100644
--- a/src/arch/arm/linux/system.hh
+++ b/src/arch/arm/linux/system.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 ARM Limited
+ * Copyright (c) 2010-2012 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -43,15 +43,24 @@
#ifndef __ARCH_ARM_LINUX_SYSTEM_HH__
#define __ARCH_ARM_LINUX_SYSTEM_HH__
+#include <cstdio>
+#include <map>
#include <string>
#include <vector>
#include "arch/arm/system.hh"
+#include "base/output.hh"
#include "kern/linux/events.hh"
#include "params/LinuxArmSystem.hh"
+#include "sim/core.hh"
+
+class DumpStatsPCEvent;
class LinuxArmSystem : public ArmSystem
{
+ protected:
+ DumpStatsPCEvent *dumpStatsPCEvent;
+
public:
/** Boilerplate params code */
typedef LinuxArmSystemParams Params;
@@ -61,6 +70,20 @@ class LinuxArmSystem : public ArmSystem
return dynamic_cast<const Params *>(_params);
}
+ /** When enabled, dump stats/task info on context switches for
+ * Streamline and per-thread cache occupancy studies, etc. */
+ bool enableContextSwitchStatsDump;
+
+ /** This map stores a mapping of OS process IDs to internal Task IDs. The
+ * mapping is done because the stats system doesn't tend to like vectors
+ * that are much greater than 1000 items and the entire process space is
+ * 65K. */
+ std::map<uint32_t, uint32_t> taskMap;
+
+ /** This is a file that is placed in the run directory that prints out
+ * mappings between taskIds and OS process IDs */
+ std::ostream* taskFile;
+
LinuxArmSystem(Params *p);
~LinuxArmSystem();
@@ -68,6 +91,12 @@ class LinuxArmSystem : public ArmSystem
bool adderBootUncacheable(Addr a);
+ void startup();
+
+ /** This function creates a new task Id for the given pid.
+ * @param tc thread context that is currentyl executing */
+ void mapPid(ThreadContext* tc, uint32_t pid);
+
private:
#ifndef NDEBUG
/** Event to halt the simulator if the kernel calls panic() */
@@ -97,5 +126,16 @@ class LinuxArmSystem : public ArmSystem
Addr penReleaseAddr;
};
+class DumpStatsPCEvent : public PCEvent
+{
+ public:
+ DumpStatsPCEvent(PCEventQueue *q, const std::string &desc, Addr addr)
+ : PCEvent(q, desc, addr)
+ {}
+
+ virtual void process(ThreadContext* tc);
+};
+
+
#endif // __ARCH_ARM_LINUX_SYSTEM_HH__