diff options
author | Chander Sudanthi <chander.sudanthi@arm.com> | 2011-05-13 17:27:00 -0500 |
---|---|---|
committer | Chander Sudanthi <chander.sudanthi@arm.com> | 2011-05-13 17:27:00 -0500 |
commit | 4bf48a11efd7253bdb7a61da42d2bc754033757b (patch) | |
tree | 6cfb8c58569c81b4daf9ccd86fbfa4ac7b643d02 /src/arch | |
parent | 5299c75e62832aab2e200b22c73865ed9c51b335 (diff) | |
download | gem5-4bf48a11efd7253bdb7a61da42d2bc754033757b.tar.xz |
Trace: Allow printing ASIDs and selectively tracing based on user/kernel code.
Debug flags are ExecUser, ExecKernel, and ExecAsid. ExecUser and
ExecKernel are set by default when Exec is specified. Use minus
sign with ExecUser or ExecKernel to remove user or kernel tracing
respectively.
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/alpha/utility.cc | 1 | ||||
-rw-r--r-- | src/arch/alpha/utility.hh | 7 | ||||
-rw-r--r-- | src/arch/arm/utility.hh | 7 | ||||
-rw-r--r-- | src/arch/mips/utility.hh | 6 | ||||
-rw-r--r-- | src/arch/power/utility.hh | 13 | ||||
-rw-r--r-- | src/arch/sparc/utility.hh | 6 | ||||
-rw-r--r-- | src/arch/x86/utility.hh | 7 |
7 files changed, 45 insertions, 2 deletions
diff --git a/src/arch/alpha/utility.cc b/src/arch/alpha/utility.cc index 2d56ca9b8..5d40f85d7 100644 --- a/src/arch/alpha/utility.cc +++ b/src/arch/alpha/utility.cc @@ -29,7 +29,6 @@ * Ali Saidi */ -#include "arch/alpha/ev5.hh" #include "arch/alpha/utility.hh" #if FULL_SYSTEM diff --git a/src/arch/alpha/utility.hh b/src/arch/alpha/utility.hh index 8759b49ce..c0c985c34 100644 --- a/src/arch/alpha/utility.hh +++ b/src/arch/alpha/utility.hh @@ -39,6 +39,7 @@ #include "config/full_system.hh" #include "cpu/static_inst.hh" #include "cpu/thread_context.hh" +#include "arch/alpha/ev5.hh" namespace AlphaISA { @@ -111,6 +112,12 @@ advancePC(PCState &pc, const StaticInstPtr inst) pc.advance(); } +inline uint64_t +getExecutingAsid(ThreadContext *tc) +{ + return DTB_ASN_ASN(tc->readMiscRegNoEffect(IPR_DTB_ASN)); +} + } // namespace AlphaISA #endif // __ARCH_ALPHA_UTILITY_HH__ diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh index 20cb9b426..8ad3de66a 100644 --- a/src/arch/arm/utility.hh +++ b/src/arch/arm/utility.hh @@ -173,7 +173,12 @@ advancePC(PCState &pc, const StaticInstPtr inst) Addr truncPage(Addr addr); Addr roundPage(Addr addr); -}; +inline uint64_t +getExecutingAsid(ThreadContext *tc) +{ + return tc->readMiscReg(MISCREG_CONTEXTIDR); +} +}; #endif diff --git a/src/arch/mips/utility.hh b/src/arch/mips/utility.hh index 61c43a158..a2995b098 100644 --- a/src/arch/mips/utility.hh +++ b/src/arch/mips/utility.hh @@ -120,6 +120,12 @@ advancePC(PCState &pc, const StaticInstPtr inst) pc.advance(); } +inline uint64_t +getExecutingAsid(ThreadContext *tc) +{ + return 0; +} + }; diff --git a/src/arch/power/utility.hh b/src/arch/power/utility.hh index cbb9bb646..349054774 100644 --- a/src/arch/power/utility.hh +++ b/src/arch/power/utility.hh @@ -78,6 +78,19 @@ advancePC(PCState &pc, const StaticInstPtr inst) pc.advance(); } +static inline bool +inUserMode(ThreadContext *tc) +{ + return 0; +} + +inline uint64_t +getExecutingAsid(ThreadContext *tc) +{ + return 0; +} + } // namespace PowerISA + #endif // __ARCH_POWER_UTILITY_HH__ diff --git a/src/arch/sparc/utility.hh b/src/arch/sparc/utility.hh index b702e6838..76b551ac8 100644 --- a/src/arch/sparc/utility.hh +++ b/src/arch/sparc/utility.hh @@ -94,6 +94,12 @@ advancePC(PCState &pc, const StaticInstPtr inst) inst->advancePC(pc); } +inline uint64_t +getExecutingAsid(ThreadContext *tc) +{ + return tc->readMiscRegNoEffect(MISCREG_MMU_P_CONTEXT); +} + } // namespace SparcISA #endif diff --git a/src/arch/x86/utility.hh b/src/arch/x86/utility.hh index 143fde00c..4cfbe77db 100644 --- a/src/arch/x86/utility.hh +++ b/src/arch/x86/utility.hh @@ -102,6 +102,13 @@ namespace X86ISA { inst->advancePC(pc); } + + inline uint64_t + getExecutingAsid(ThreadContext *tc) + { + return 0; + } + }; #endif // __ARCH_X86_UTILITY_HH__ |