events.cc revision 8138
12212SN/A/*
28138SAli.Saidi@ARM.com * Copyright (c) 2011 ARM Limited
38138SAli.Saidi@ARM.com * All rights reserved
48138SAli.Saidi@ARM.com *
58138SAli.Saidi@ARM.com * The license below extends only to copyright in the software and shall
68138SAli.Saidi@ARM.com * not be construed as granting a license to any other intellectual
78138SAli.Saidi@ARM.com * property including but not limited to intellectual property relating
88138SAli.Saidi@ARM.com * to a hardware implementation of the functionality of the software
98138SAli.Saidi@ARM.com * licensed hereunder.  You may use the software subject to the license
108138SAli.Saidi@ARM.com * terms below provided that you ensure that this notice is replicated
118138SAli.Saidi@ARM.com * unmodified and in its entirety in all distributions of the software,
128138SAli.Saidi@ARM.com * modified or unmodified, in source code or in binary form.
138138SAli.Saidi@ARM.com *
142212SN/A * Copyright (c) 2004-2006 The Regents of The University of Michigan
152212SN/A * All rights reserved.
162212SN/A *
172212SN/A * Redistribution and use in source and binary forms, with or without
182212SN/A * modification, are permitted provided that the following conditions are
192212SN/A * met: redistributions of source code must retain the above copyright
202212SN/A * notice, this list of conditions and the following disclaimer;
212212SN/A * redistributions in binary form must reproduce the above copyright
222212SN/A * notice, this list of conditions and the following disclaimer in the
232212SN/A * documentation and/or other materials provided with the distribution;
242212SN/A * neither the name of the copyright holders nor the names of its
252212SN/A * contributors may be used to endorse or promote products derived from
262212SN/A * this software without specific prior written permission.
272212SN/A *
282212SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292212SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302212SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312212SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322212SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342212SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352212SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362212SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372212SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382212SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392665Ssaidi@eecs.umich.edu *
402760Sbinkertn@umich.edu * Authors: Nathan Binkert
412760Sbinkertn@umich.edu *          Ali Saidi
422212SN/A */
432212SN/A
447676Snate@binkert.org#include <sstream>
457676Snate@binkert.org
462212SN/A#include "base/trace.hh"
472680Sktlim@umich.edu#include "cpu/thread_context.hh"
482212SN/A#include "kern/linux/events.hh"
492212SN/A#include "kern/linux/printk.hh"
502212SN/A#include "kern/system_events.hh"
517676Snate@binkert.org#include "sim/arguments.hh"
522235SN/A#include "sim/system.hh"
532212SN/A
542212SN/Anamespace Linux {
552212SN/A
562212SN/Avoid
572680Sktlim@umich.eduDebugPrintkEvent::process(ThreadContext *tc)
582212SN/A{
592212SN/A    if (DTRACE(DebugPrintf)) {
604429Ssaidi@eecs.umich.edu        std::stringstream ss;
614826Ssaidi@eecs.umich.edu        Arguments args(tc);
624429Ssaidi@eecs.umich.edu        Printk(ss, args);
634429Ssaidi@eecs.umich.edu        StringWrap name(tc->getSystemPtr()->name() + ".dprintk");
644429Ssaidi@eecs.umich.edu        DPRINTFN("%s", ss.str());
652212SN/A    }
664424Ssaidi@eecs.umich.edu    SkipFuncEvent::process(tc);
672212SN/A}
682212SN/A
692212SN/A} // namespace linux
70