arch: Delete the unused ProcessInfo class.
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>
This commit is contained in:
@@ -41,72 +41,6 @@
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -40,54 +40,6 @@
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -41,72 +41,6 @@
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -36,27 +36,6 @@
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user