events.cc revision 4826
12212SN/A/*
22212SN/A * Copyright (c) 2004-2006 The Regents of The University of Michigan
32212SN/A * All rights reserved.
42212SN/A *
52212SN/A * Redistribution and use in source and binary forms, with or without
62212SN/A * modification, are permitted provided that the following conditions are
72212SN/A * met: redistributions of source code must retain the above copyright
82212SN/A * notice, this list of conditions and the following disclaimer;
92212SN/A * redistributions in binary form must reproduce the above copyright
102212SN/A * notice, this list of conditions and the following disclaimer in the
112212SN/A * documentation and/or other materials provided with the distribution;
122212SN/A * neither the name of the copyright holders nor the names of its
132212SN/A * contributors may be used to endorse or promote products derived from
142212SN/A * this software without specific prior written permission.
152212SN/A *
162212SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172212SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182212SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192212SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202212SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222212SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232212SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242212SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252212SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262212SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282760Sbinkertn@umich.edu * Authors: Nathan Binkert
292760Sbinkertn@umich.edu *          Ali Saidi
302212SN/A */
312212SN/A
324826Ssaidi@eecs.umich.edu#include "sim/arguments.hh"
332212SN/A#include "base/trace.hh"
342680Sktlim@umich.edu#include "cpu/thread_context.hh"
352212SN/A#include "kern/linux/events.hh"
362212SN/A#include "kern/linux/printk.hh"
372212SN/A#include "kern/system_events.hh"
382235SN/A#include "sim/system.hh"
392212SN/A
404429Ssaidi@eecs.umich.edu#include <sstream>
412212SN/A
422212SN/Anamespace Linux {
432212SN/A
442212SN/Avoid
452680Sktlim@umich.eduDebugPrintkEvent::process(ThreadContext *tc)
462212SN/A{
472212SN/A    if (DTRACE(DebugPrintf)) {
484429Ssaidi@eecs.umich.edu        std::stringstream ss;
494826Ssaidi@eecs.umich.edu        Arguments args(tc);
504429Ssaidi@eecs.umich.edu        Printk(ss, args);
514429Ssaidi@eecs.umich.edu        StringWrap name(tc->getSystemPtr()->name() + ".dprintk");
524429Ssaidi@eecs.umich.edu        DPRINTFN("%s", ss.str());
532212SN/A    }
544424Ssaidi@eecs.umich.edu    SkipFuncEvent::process(tc);
552212SN/A}
562212SN/A
572212SN/A} // namespace linux
58