29#ifndef __ARCH_GENERIC_LINUX_THREADINFO_HH__
30#define __ARCH_GENERIC_LINUX_THREADINFO_HH__
55 auto it = symtab.
find(symbol);
56 if (it == symtab.end()) {
57 warn_once(
"Unable to find kernel symbol %s\n", symbol);
58 warn_once(
"Kernel not compiled with task_struct info; can't get "
59 "currently executing task/process/thread name/ids!\n");
70 :
tc(_tc),
sys(
tc->getSystemPtr()),
81 panic(
"curThreadInfo() not implemented.");
157 return "FailureIn_curTaskName";
159 if (!
get_data(
"task_struct_comm_size", size))
160 return "FailureIn_curTaskName";
162 char buffer[size + 1];
164 buffer, task_struct +
offset, size);
T read(Addr address) const
Read sizeof(T) bytes from address and return as object T.
void readString(std::string &str, Addr addr) const
Same as tryReadString, but insists on success.
Workload * workload
OS kernel.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
This proxy attempts to translate virtual addresses using the TLBs.
virtual const loader::SymbolTable & symtab(ThreadContext *tc)=0
int32_t curTaskTGID(Addr thread_info=0)
int64_t curTaskStartFromTaskStruct(Addr task_struct)
int64_t curTaskStart(Addr thread_info=0)
ThreadInfo(ThreadContext *_tc)
int32_t curTaskMmFromTaskStruct(Addr task_struct)
int32_t curTaskPID(Addr thread_info=0)
int32_t curTaskMm(Addr thread_info=0)
bool get_data(const char *symbol, T &data)
Addr curTaskInfo(Addr thread_info=0)
std::string curTaskName(Addr thread_info=0)
virtual Addr curThreadInfo()
int32_t curTaskTGIDFromTaskStruct(Addr task_struct)
std::string curTaskNameFromTaskStruct(Addr task_struct)
int32_t curTaskPIDFromTaskStruct(Addr task_struct)
const_iterator find(Addr address) const
Search for a symbol by its address.
#define panic(...)
This implements a cprintf based panic() function.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.