trace.hh (8232:b28d06a175be) | trace.hh (10259:ebb376f73dd2) |
---|---|
1/* 2 * Copyright (c) 2001-2006 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; --- 58 unchanged lines hidden (view full) --- 67{ 68 std::string str; 69 StringWrap(const std::string &s) : str(s) {} 70 const std::string &operator()() const { return str; } 71}; 72 73inline const std::string &name() { return Trace::DefaultName; } 74 | 1/* 2 * Copyright (c) 2001-2006 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; --- 58 unchanged lines hidden (view full) --- 67{ 68 std::string str; 69 StringWrap(const std::string &s) : str(s) {} 70 const std::string &operator()() const { return str; } 71}; 72 73inline const std::string &name() { return Trace::DefaultName; } 74 |
75// Interface for things with names. (cf. SimObject but without other 76// functionality). This is useful when using DPRINTF 77class Named 78{ 79 protected: 80 const std::string _name; 81 82 public: 83 Named(const std::string &name_) : _name(name_) { } 84 85 public: 86 const std::string &name() const { return _name; } 87}; 88 |
|
75// 76// DPRINTF is a debugging trace facility that allows one to 77// selectively enable tracing statements. To use DPRINTF, there must 78// be a function or functor called name() that returns a const 79// std::string & in the current scope. 80// 81// If you desire that the automatic printing not occur, use DPRINTFR 82// (R for raw) --- 56 unchanged lines hidden --- | 89// 90// DPRINTF is a debugging trace facility that allows one to 91// selectively enable tracing statements. To use DPRINTF, there must 92// be a function or functor called name() that returns a const 93// std::string & in the current scope. 94// 95// If you desire that the automatic printing not occur, use DPRINTFR 96// (R for raw) --- 56 unchanged lines hidden --- |