cp_annotate.cc (8229:78bf55f23338) cp_annotate.cc (10377:434228c914e5)
1/*
2 * Copyright (c) 2006-2009 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;

--- 14 unchanged lines hidden (view full) ---

23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Ali Saidi
29 */
30
1/*
2 * Copyright (c) 2006-2009 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;

--- 14 unchanged lines hidden (view full) ---

23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Ali Saidi
29 */
30
31#include "arch/alpha/linux/threadinfo.hh"
31#include "arch/generic/linux/threadinfo.hh"
32#include "arch/utility.hh"
33#include "base/loader/object_file.hh"
34#include "base/callback.hh"
35#include "base/cp_annotate.hh"
36#include "base/output.hh"
37#include "base/trace.hh"
38#include "config/the_isa.hh"
39#include "cpu/thread_context.hh"
32#include "arch/utility.hh"
33#include "base/loader/object_file.hh"
34#include "base/callback.hh"
35#include "base/cp_annotate.hh"
36#include "base/output.hh"
37#include "base/trace.hh"
38#include "config/the_isa.hh"
39#include "cpu/thread_context.hh"
40#include "debug/Annotate.hh"
41#include "debug/AnnotateVerbose.hh"
40#include "sim/arguments.hh"
41#include "sim/core.hh"
42#include "sim/sim_exit.hh"
43#include "sim/system.hh"
44
45struct CPAIgnoreSymbol
46{
47 const char *symbol;

--- 89 unchanged lines hidden (view full) ---

137 // MAGIC version number 'M''5''A'N' + version/capabilities
138 ah.version = 0x4D35414E00000101ULL;
139 ah.num_recs = 0;
140 ah.key_off = 0;
141 osbin->write((char*)&ah, sizeof(AnnotateHeader));
142
143 registerExitCallback(new AnnotateDumpCallback(this));
144}
42#include "sim/arguments.hh"
43#include "sim/core.hh"
44#include "sim/sim_exit.hh"
45#include "sim/system.hh"
46
47struct CPAIgnoreSymbol
48{
49 const char *symbol;

--- 89 unchanged lines hidden (view full) ---

139 // MAGIC version number 'M''5''A'N' + version/capabilities
140 ah.version = 0x4D35414E00000101ULL;
141 ah.num_recs = 0;
142 ah.key_off = 0;
143 osbin->write((char*)&ah, sizeof(AnnotateHeader));
144
145 registerExitCallback(new AnnotateDumpCallback(this));
146}
147
148uint64_t
149CPA::getFrame(ThreadContext *tc)
150{
151 // This code is ISA specific and will need to be changed
152 // if the annotation code is used for something other than Alpha
153 return (tc->readMiscRegNoEffect(TheISA::IPR_PALtemp23) &
154 ~ULL(0x3FFF));
155
156}
157
145void
146CPA::swSmBegin(ThreadContext *tc)
147{
148 if (!enabled())
149 return;
150
151 Arguments args(tc);
152 std::string st;

--- 170 unchanged lines hidden (view full) ---

323void
324CPA::swAutoBegin(ThreadContext *tc, Addr next_pc)
325{
326 if (!enabled())
327 return;
328
329 string sym;
330 Addr sym_addr = 0;
158void
159CPA::swSmBegin(ThreadContext *tc)
160{
161 if (!enabled())
162 return;
163
164 Arguments args(tc);
165 std::string st;

--- 170 unchanged lines hidden (view full) ---

336void
337CPA::swAutoBegin(ThreadContext *tc, Addr next_pc)
338{
339 if (!enabled())
340 return;
341
342 string sym;
343 Addr sym_addr = 0;
331 SymbolTable *symtab = NULL;
332
344
333
334 if (!TheISA::inUserMode(tc)) {
335 debugSymbolTable->findNearestSymbol(next_pc, sym, sym_addr);
345 if (!TheISA::inUserMode(tc)) {
346 debugSymbolTable->findNearestSymbol(next_pc, sym, sym_addr);
336 symtab = debugSymbolTable;
337 } else {
338 Linux::ThreadInfo ti(tc);
339 string app = ti.curTaskName();
340 if (userApp.count(app))
341 userApp[app]->findNearestSymbol(next_pc, sym, sym_addr);
342 }
343
344 if (sym_addr)

--- 935 unchanged lines hidden (view full) ---

1280 string str;
1281 int sysi;
1282
1283 objParamIn(cp, section, csprintf("nameCache%d.name", x), sptr);
1284 sys = dynamic_cast<System*>(sptr);
1285
1286 paramIn(cp, section, csprintf("nameCache%d.str", x), str);
1287 paramIn(cp, section, csprintf("nameCache%d.int", x), sysi);
347 } else {
348 Linux::ThreadInfo ti(tc);
349 string app = ti.curTaskName();
350 if (userApp.count(app))
351 userApp[app]->findNearestSymbol(next_pc, sym, sym_addr);
352 }
353
354 if (sym_addr)

--- 935 unchanged lines hidden (view full) ---

1290 string str;
1291 int sysi;
1292
1293 objParamIn(cp, section, csprintf("nameCache%d.name", x), sptr);
1294 sys = dynamic_cast<System*>(sptr);
1295
1296 paramIn(cp, section, csprintf("nameCache%d.str", x), str);
1297 paramIn(cp, section, csprintf("nameCache%d.int", x), sysi);
1288 nameCache[sys] = std::make_pair<std::string,int>(str, sysi);
1298 nameCache[sys] = std::make_pair(str, sysi);
1289 }
1290
1291 //smStack (SmStack)
1292 int smStack_size;
1293 paramIn(cp, section, "smStackIdCount", smStack_size);
1294 for (int x = 0; x < smStack_size; x++) {
1295 int sysi;
1296 uint64_t frame;

--- 109 unchanged lines hidden ---
1299 }
1300
1301 //smStack (SmStack)
1302 int smStack_size;
1303 paramIn(cp, section, "smStackIdCount", smStack_size);
1304 for (int x = 0; x < smStack_size; x++) {
1305 int sysi;
1306 uint64_t frame;

--- 109 unchanged lines hidden ---