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;

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

28 * Authors: Lisa Hsu
29 * Nathan Binkert
30 */
31
32#include <map>
33#include <stack>
34#include <string>
35
36#include "arch/alpha/linux/threadinfo.hh"
37#include "arch/alpha/kernel_stats.hh"
38#include "arch/alpha/osfpal.hh"
39#include "base/trace.hh"
40#include "cpu/thread_context.hh"
41#include "kern/tru64/tru64_syscalls.hh"
42#include "sim/system.hh"
43
44using namespace std;

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

133void
134Statistics::changeMode(cpu_mode newmode, ThreadContext *tc)
135{
136 _mode[newmode]++;
137
138 if (newmode == themode)
139 return;
140
140 DPRINTF(Context, "old mode=%-8s new mode=%-8s\n",
141 modestr[themode], modestr[newmode]);
141 DPRINTF(Context, "old mode=%s new mode=%s pid=%d\n",
142 modestr[themode], modestr[newmode],
143 Linux::ThreadInfo(tc).curTaskPID());
144
145 _modeGood[newmode]++;
146 _modeTicks[themode] += curTick - lastModeTick;
147
148 lastModeTick = curTick;
149 themode = newmode;
150}
151

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

162
163void
164Statistics::context(Addr oldpcbb, Addr newpcbb, ThreadContext *tc)
165{
166 assert(themode != user);
167
168 _swap_context++;
169 changeMode(newpcbb == idleProcess ? idle : kernel, tc);
170
171 DPRINTF(Context, "Context Switch old pid=%d new pid=%d\n",
172 Linux::ThreadInfo(tc, oldpcbb).curTaskPID(),
173 Linux::ThreadInfo(tc, newpcbb).curTaskPID());
174}
175
176void
177Statistics::callpal(int code, ThreadContext *tc)
178{
179 if (!PAL::name(code))
180 return;
181

--- 36 unchanged lines hidden ---