arch: Delete the unused ProcessInfo class.
authorGabe Black <gabeblack@google.com>
Sat, 4 Jul 2020 21:04:55 +0000 (14:04 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 7 Jul 2020 05:08:41 +0000 (05:08 +0000)
Change-Id: Ie67f696005fa60e117e1e4e4e985aee5e767ccec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30958
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/stacktrace.cc
src/arch/arm/stacktrace.hh
src/arch/mips/stacktrace.cc
src/arch/mips/stacktrace.hh
src/arch/power/stacktrace.cc
src/arch/power/stacktrace.hh
src/arch/riscv/stacktrace.cc
src/arch/riscv/stacktrace.hh
src/arch/x86/stacktrace.cc
src/arch/x86/stacktrace.hh

index 2c39576859594df994566116ac5eca231ec34630..a9f79e86402063c8a7a913647cc5a431e68d4573 100644 (file)
 namespace ArmISA
 {
 
-static int32_t
-readSymbol(ThreadContext *tc, const std::string name)
-{
-    PortProxy &vp = tc->getVirtProxy();
-    const auto &symtab = tc->getSystemPtr()->workload->symtab(tc);
-
-    auto it = symtab.find(name);
-    panic_if(it == symtab.end(), "Thread info not compiled into kernel.");
-
-    return vp.read<int32_t>(it->address, GuestByteOrder);
-}
-
-ProcessInfo::ProcessInfo(ThreadContext *_tc) : tc(_tc)
-{
-    thread_info_size = readSymbol(tc, "thread_info_size");
-    task_struct_size = readSymbol(tc, "task_struct_size");
-    task_off = readSymbol(tc, "thread_info_task");
-    pid_off = readSymbol(tc, "task_struct_pid");
-    name_off = readSymbol(tc, "task_struct_comm");
-}
-
-Addr
-ProcessInfo::task(Addr ksp) const
-{
-    Addr base = ksp & ~0x1fff;
-    if (base == ULL(0xffffffffc0000000))
-        return 0;
-
-    Addr tsk;
-
-    PortProxy &vp = tc->getVirtProxy();
-    tsk = vp.read<Addr>(base + task_off, GuestByteOrder);
-
-    return tsk;
-}
-
-int
-ProcessInfo::pid(Addr ksp) const
-{
-    Addr task = this->task(ksp);
-    if (!task)
-        return -1;
-
-    uint16_t pd;
-
-    PortProxy &vp = tc->getVirtProxy();
-    pd = vp.read<uint16_t>(task + pid_off, GuestByteOrder);
-
-    return pd;
-}
-
-std::string
-ProcessInfo::name(Addr ksp) const
-{
-    Addr task = this->task(ksp);
-    if (!task)
-        return "unknown";
-
-    char comm[256];
-    tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm));
-    if (!comm[0])
-        return "startup";
-
-    return comm;
-}
-
 StackTrace::StackTrace()
     : tc(0), stack(64)
 {
index fd0ec1b7ae32a4f4667ec1f0363d8269c81e9367..61bea299c2daab6178ec848c7d915dde9432247d 100644 (file)
@@ -37,27 +37,6 @@ class ThreadContext;
 namespace ArmISA
 {
 
-class StackTrace;
-
-class ProcessInfo
-{
-  private:
-    ThreadContext *tc;
-
-    int thread_info_size;
-    int task_struct_size;
-    int task_off;
-    int pid_off;
-    int name_off;
-
-  public:
-    ProcessInfo(ThreadContext *_tc);
-
-    Addr task(Addr ksp) const;
-    int pid(Addr ksp) const;
-    std::string name(Addr ksp) const;
-};
-
 class StackTrace
 {
   protected:
index ec5597c5597aa0ebf37e00efd414f710215d6a64..0384e2bd053691b061a9bc3d78e0235640247ec3 100644 (file)
 
 using namespace MipsISA;
 
-ProcessInfo::ProcessInfo(ThreadContext *_tc) : tc(_tc)
-{}
-
-Addr
-ProcessInfo::task(Addr ksp) const
-{
-    Addr base = ksp & ~0x3fff;
-    if (base == ULL(0xfffffc0000000000))
-        return 0;
-
-    Addr tsk;
-
-    PortProxy &vp = tc->getVirtProxy();
-    tsk = vp.read<Addr>(base + task_off, GuestByteOrder);
-
-    return tsk;
-}
-
-int
-ProcessInfo::pid(Addr ksp) const
-{
-    Addr task = this->task(ksp);
-    if (!task)
-        return -1;
-
-    uint16_t pd;
-
-    PortProxy &vp = tc->getVirtProxy();
-    pd = vp.read<uint16_t>(task + pid_off, GuestByteOrder);
-
-    return pd;
-}
-
-std::string
-ProcessInfo::name(Addr ksp) const
-{
-    Addr task = this->task(ksp);
-    if (!task)
-        return "console";
-
-    char comm[256];
-    tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm));
-    if (!comm[0])
-        return "startup";
-
-    return comm;
-}
-
 StackTrace::StackTrace()
     : tc(0), stack(64)
 {
index eb3a95a23771e7ea25b837695659f83134b0f7b4..9c0217055b99294b78f4fe7b26362c33c60c0187 100644 (file)
@@ -38,23 +38,6 @@ class ThreadContext;
 namespace MipsISA
 {
 
-class ProcessInfo
-{
-  private:
-    ThreadContext *tc;
-
-    int task_off;
-    int pid_off;
-    int name_off;
-
-  public:
-    ProcessInfo(ThreadContext *_tc);
-
-    Addr task(Addr ksp) const;
-    int pid(Addr ksp) const;
-    std::string name(Addr ksp) const;
-};
-
 class StackTrace
 {
   protected:
index 64ea9264a7f88c62a02575c36989f2fb902d157f..84f1b654724b633a38c2e9efa93f1028b55fc9f5 100644 (file)
@@ -36,32 +36,6 @@ using namespace std;
 
 namespace PowerISA {
 
-ProcessInfo::ProcessInfo(ThreadContext *_tc)
-{
-    panic("ProcessInfo constructor not implemented.\n");
-}
-
-Addr
-ProcessInfo::task(Addr ksp) const
-{
-    panic("ProcessInfo::task not implemented.\n");
-    return 0;
-}
-
-int
-ProcessInfo::pid(Addr ksp) const
-{
-    panic("ProcessInfo::pid not implemented.\n");
-    return 0;
-}
-
-string
-ProcessInfo::name(Addr ksp) const
-{
-    panic("ProcessInfo::name not implemented.\n");
-    return "";
-}
-
 StackTrace::StackTrace()
     : tc(0), stack(64)
 {
index bf43cc298624fd980060f03176ea410d1988d3e8..d67569ff944d8a5b453e00f82be035eaca125ec2 100644 (file)
@@ -41,16 +41,6 @@ class StackTrace;
 namespace PowerISA
 {
 
-class ProcessInfo
-{
-  public:
-    ProcessInfo(ThreadContext *_tc);
-
-    Addr task(Addr ksp) const;
-    int pid(Addr ksp) const;
-    std::string name(Addr ksp) const;
-};
-
 class StackTrace
 {
   private:
index 69159b95f75513330c8037fdf9da63c685c0c7e8..f495b60ee9da3918ebd66dbe83f9069583572436 100644 (file)
@@ -36,32 +36,6 @@ using namespace std;
 
 namespace RiscvISA {
 
-ProcessInfo::ProcessInfo(ThreadContext *_tc)
-{
-    panic("ProcessInfo constructor not implemented.\n");
-}
-
-Addr
-ProcessInfo::task(Addr ksp) const
-{
-    panic("ProcessInfo::task not implemented.\n");
-    return 0;
-}
-
-int
-ProcessInfo::pid(Addr ksp) const
-{
-    panic("ProcessInfo::pid not implemented.\n");
-    return 0;
-}
-
-string
-ProcessInfo::name(Addr ksp) const
-{
-    panic("ProcessInfo::name not implemented.\n");
-    return "";
-}
-
 StackTrace::StackTrace()
     : tc(0), stack(64)
 {
index b88db692611655d3704a7db5a74b1648e6653147..28134126bb12a26be9f0e48a0bab2db582afee27 100644 (file)
@@ -41,16 +41,6 @@ class StackTrace;
 namespace RiscvISA
 {
 
-class ProcessInfo
-{
-  public:
-    ProcessInfo(ThreadContext *_tc);
-
-    Addr task(Addr ksp) const;
-    int pid(Addr ksp) const;
-    std::string name(Addr ksp) const;
-};
-
 class StackTrace
 {
   private:
index cb9e529ad81488ed1a1fb3b2ed4a9068f9b87d1f..2d4e8fbe0691ae2549cfcef49642032fede2e48d 100644 (file)
 namespace X86ISA
 {
 
-static int32_t
-readSymbol(ThreadContext *tc, const std::string name)
-{
-    PortProxy &vp = tc->getVirtProxy();
-    const auto &symtab = tc->getSystemPtr()->workload->symtab(tc);
-
-    auto it = symtab.find(name);
-    panic_if(it == symtab.end(), "Thread info not compiled into kernel.");
-
-    return vp.read<int32_t>(it->address, GuestByteOrder);
-}
-
-ProcessInfo::ProcessInfo(ThreadContext *_tc) : tc(_tc)
-{
-    thread_info_size = readSymbol(tc, "thread_info_size");
-    task_struct_size = readSymbol(tc, "task_struct_size");
-    task_off = readSymbol(tc, "thread_info_task");
-    pid_off = readSymbol(tc, "task_struct_pid");
-    name_off = readSymbol(tc, "task_struct_comm");
-}
-
-Addr
-ProcessInfo::task(Addr ksp) const
-{
-    Addr base = ksp & ~0x3fff;
-    if (base == ULL(0xfffffc0000000000))
-        return 0;
-
-    Addr tsk;
-
-    PortProxy &vp = tc->getVirtProxy();
-    tsk = vp.read<Addr>(base + task_off, GuestByteOrder);
-
-    return tsk;
-}
-
-int
-ProcessInfo::pid(Addr ksp) const
-{
-    Addr task = this->task(ksp);
-    if (!task)
-        return -1;
-
-    uint16_t pd;
-
-    PortProxy &vp = tc->getVirtProxy();
-    pd = vp.read<uint16_t>(task + pid_off, GuestByteOrder);
-
-    return pd;
-}
-
-std::string
-ProcessInfo::name(Addr ksp) const
-{
-    Addr task = this->task(ksp);
-    if (!task)
-        return "console";
-
-    char comm[256];
-    tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm));
-    if (!comm[0])
-        return "startup";
-
-    return comm;
-}
-
 StackTrace::StackTrace()
     : tc(0), stack(64)
 {
index bd0a4b7ad9d9e7c80c0d439910ff1625a131d5f8..8ed89ec5f6a869a848253b6f956f298575c61ebe 100644 (file)
 class ThreadContext;
 namespace X86ISA
 {
-    class StackTrace;
-
-    class ProcessInfo
-    {
-      private:
-        ThreadContext *tc;
-
-        int thread_info_size;
-        int task_struct_size;
-        int task_off;
-        int pid_off;
-        int name_off;
-
-      public:
-        ProcessInfo(ThreadContext *_tc);
-
-        Addr task(Addr ksp) const;
-        int pid(Addr ksp) const;
-        std::string name(Addr ksp) const;
-    };
-
     class StackTrace
     {
       private: