Deleted Added
sdiff udiff text old ( 11793:ef606668d247 ) new ( 12090:11d69759b378 )
full compact
1/*
2 * Copyright (c) 2010-2013, 2016 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

231{
232 return new LinuxArmSystem(this);
233}
234
235void
236LinuxArmSystem::startup()
237{
238 if (enableContextSwitchStatsDump) {
239 dumpStatsPCEvent = addKernelFuncEvent<DumpStatsPCEvent>("__switch_to");
240 if (!dumpStatsPCEvent)
241 panic("dumpStatsPCEvent not created!");
242
243 std::string task_filename = "tasks.txt";
244 taskFile = simout.create(name() + "." + task_filename);
245
246 for (int i = 0; i < _numContexts; i++) {
247 ThreadContext *tc = threadContexts[i];

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

271}
272
273void
274LinuxArmSystem::dumpDmesg()
275{
276 Linux::dumpDmesg(getThreadContext(0), std::cout);
277}
278
279/** This function is called whenever the the kernel function
280 * "__switch_to" is called to change running tasks.
281 *
282 * r0 = task_struct of the previously running process
283 * r1 = task_info of the previously running process
284 * r2 = task_info of the next process to run
285 */
286void
287DumpStatsPCEvent::process(ThreadContext *tc)
288{
289 Linux::ThreadInfo ti(tc);
290 Addr task_descriptor = tc->readIntReg(2);
291 uint32_t pid = ti.curTaskPID(task_descriptor);
292 uint32_t tgid = ti.curTaskTGID(task_descriptor);
293 std::string next_task_str = ti.curTaskName(task_descriptor);
294
295 // Streamline treats pid == -1 as the kernel process.
296 // Also pid == 0 implies idle process (except during Linux boot)
297 int32_t mm = ti.curTaskMm(task_descriptor);
298 bool is_kernel = (mm == 0);
299 if (is_kernel && (pid != 0)) {
300 pid = -1;
301 tgid = -1;
302 next_task_str = "kernel";
303 }
304
305 LinuxArmSystem* sys = dynamic_cast<LinuxArmSystem *>(tc->getSystemPtr());

--- 26 unchanged lines hidden ---