stacktrace.cc (5254:c555f8b07345) | stacktrace.cc (5499:8bfc7650c344) |
---|---|
1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 56 unchanged lines hidden (view full) --- 65 66// if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_pid", addr)) 67// panic("thread info not compiled into kernel\n"); 68// pid_off = vp->readGtoH<int32_t>(addr); 69 70// if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr)) 71// panic("thread info not compiled into kernel\n"); 72// name_off = vp->readGtoH<int32_t>(addr); | 1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 56 unchanged lines hidden (view full) --- 65 66// if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_pid", addr)) 67// panic("thread info not compiled into kernel\n"); 68// pid_off = vp->readGtoH<int32_t>(addr); 69 70// if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr)) 71// panic("thread info not compiled into kernel\n"); 72// name_off = vp->readGtoH<int32_t>(addr); |
73 74 tc->delVirtPort(vp); | |
75} 76 77Addr 78ProcessInfo::task(Addr ksp) const 79{ 80 Addr base = ksp & ~0x3fff; 81 if (base == ULL(0xfffffc0000000000)) 82 return 0; 83 84 Addr tsk; 85 86 VirtualPort *vp; 87 88 vp = tc->getVirtPort(); 89 tsk = vp->readGtoH<Addr>(base + task_off); | 73} 74 75Addr 76ProcessInfo::task(Addr ksp) const 77{ 78 Addr base = ksp & ~0x3fff; 79 if (base == ULL(0xfffffc0000000000)) 80 return 0; 81 82 Addr tsk; 83 84 VirtualPort *vp; 85 86 vp = tc->getVirtPort(); 87 tsk = vp->readGtoH<Addr>(base + task_off); |
90 tc->delVirtPort(vp); | |
91 92 return tsk; 93} 94 95int 96ProcessInfo::pid(Addr ksp) const 97{ 98 Addr task = this->task(ksp); 99 if (!task) 100 return -1; 101 102 uint16_t pd; 103 104 VirtualPort *vp; 105 106 vp = tc->getVirtPort(); 107 pd = vp->readGtoH<uint16_t>(task + pid_off); | 88 89 return tsk; 90} 91 92int 93ProcessInfo::pid(Addr ksp) const 94{ 95 Addr task = this->task(ksp); 96 if (!task) 97 return -1; 98 99 uint16_t pd; 100 101 VirtualPort *vp; 102 103 vp = tc->getVirtPort(); 104 pd = vp->readGtoH<uint16_t>(task + pid_off); |
108 tc->delVirtPort(vp); | |
109 110 return pd; 111} 112 113string 114ProcessInfo::name(Addr ksp) const 115{ 116 Addr task = this->task(ksp); --- 238 unchanged lines hidden --- | 105 106 return pd; 107} 108 109string 110ProcessInfo::name(Addr ksp) const 111{ 112 Addr task = this->task(ksp); --- 238 unchanged lines hidden --- |