[m5-dev] changeset in m5: debug: fix help output

2011-05-04 Thread Nathan Binkert
changeset 5a9a639ce16f in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=5a9a639ce16f
description:
debug: fix help output

diffstat:

 src/base/debug.cc  |   4 ++--
 src/base/debug.hh  |  16 
 src/python/m5/debug.py |  28 
 3 files changed, 30 insertions(+), 18 deletions(-)

diffs (115 lines):

diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.cc
--- a/src/base/debug.cc Mon May 02 12:40:32 2011 -0700
+++ b/src/base/debug.cc Wed May 04 10:08:08 2011 -0400
@@ -101,14 +101,14 @@
 CompoundFlag::enable()
 {
 SimpleFlag::enable();
-for_each(flags.begin(), flags.end(), mem_fun(Flag::enable));
+for_each(_kids.begin(), _kids.end(), mem_fun(Flag::enable));
 }
 
 void
 CompoundFlag::disable()
 {
 SimpleFlag::disable();
-for_each(flags.begin(), flags.end(), mem_fun(Flag::disable));
+for_each(_kids.begin(), _kids.end(), mem_fun(Flag::disable));
 }
 
 struct AllFlags : public Flag
diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.hh
--- a/src/base/debug.hh Mon May 02 12:40:32 2011 -0700
+++ b/src/base/debug.hh Wed May 04 10:08:08 2011 -0400
@@ -44,6 +44,7 @@
   protected:
 const char *_name;
 const char *_desc;
+std::vectorFlag * _kids;
 
   public:
 Flag(const char *name, const char *desc);
@@ -51,6 +52,7 @@
 
 std::string name() const { return _name; }
 std::string desc() const { return _desc; }
+std::vectorFlag * kids() { return _kids; }
 
 virtual void enable() = 0;
 virtual void disable() = 0;
@@ -77,7 +79,12 @@
 class CompoundFlag : public SimpleFlag
 {
   protected:
-std::vectorFlag * flags;
+void
+addFlag(Flag f)
+{
+if (f != NULL)
+_kids.push_back(f);
+}
 
   public:
 CompoundFlag(const char *name, const char *desc,
@@ -99,13 +106,6 @@
 addFlag(f15); addFlag(f16); addFlag(f17); addFlag(f18); addFlag(f19);
 }
 
-void
-addFlag(Flag f)
-{
-if (f != NULL)
-flags.push_back(f);
-}
-
 void enable();
 void disable();
 };
diff -r 3f49ed206f46 -r 5a9a639ce16f src/python/m5/debug.py
--- a/src/python/m5/debug.pyMon May 02 12:40:32 2011 -0700
+++ b/src/python/m5/debug.pyWed May 04 10:08:08 2011 -0400
@@ -26,24 +26,36 @@
 #
 # Authors: Nathan Binkert
 
+from UserDict import DictMixin
+
 import internal
 
+from internal.debug import SimpleFlag, CompoundFlag
 from internal.debug import schedBreakCycle, setRemoteGDBPort
+from m5.util import printList
 
 def help():
 print Base Flags:
-for flag in flags.basic:
-print %s: %s % (flag, flags.descriptions[flag])
+for name in sorted(flags):
+if name == 'All':
+continue
+flag = flags[name]
+children = [c for c in flag.kids() ]
+if not children:
+print %s: %s % (name, flag.desc())
 print
 print Compound Flags:
-for flag in flags.compound:
-if flag == 'All':
+for name in sorted(flags):
+if name == 'All':
 continue
-print %s: %s % (flag, flags.descriptions[flag])
-util.printList(flags.compoundMap[flag], indent=8)
-print
+flag = flags[name]
+children = [c for c in flag.kids() ]
+if children:
+print %s: %s % (name, flag.desc())
+printList([ c.name() for c in children ], indent=8)
+print
 
-class AllFlags(object):
+class AllFlags(DictMixin):
 def __init__(self):
 self._version = -1
 self._dict = {}
___
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev


Re: [m5-dev] changeset in m5: debug: fix help output

2011-05-04 Thread Steve Reinhardt
Note that running m5 --help still has the old names:

Trace Options
-
--trace-helpPrint help on trace flags
--trace-flags=FLAG[,FLAG]
Sets the flags for tracing (-FLAG disables a flag)
--trace-start=TIME  Start tracing at TIME (must be in ticks)
--trace-file=FILE   Sets the output file for tracing [Default: cout]
--trace-ignore=EXPR Ignore EXPR sim objects


On Wed, May 4, 2011 at 7:07 AM, Nathan Binkert n...@binkert.org wrote:

 changeset 5a9a639ce16f in /z/repo/m5
 details: http://repo.m5sim.org/m5?cmd=changeset;node=5a9a639ce16f
 description:
debug: fix help output

 diffstat:

  src/base/debug.cc  |   4 ++--
  src/base/debug.hh  |  16 
  src/python/m5/debug.py |  28 
  3 files changed, 30 insertions(+), 18 deletions(-)

 diffs (115 lines):

 diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.cc
 --- a/src/base/debug.cc Mon May 02 12:40:32 2011 -0700
 +++ b/src/base/debug.cc Wed May 04 10:08:08 2011 -0400
 @@ -101,14 +101,14 @@
  CompoundFlag::enable()
  {
 SimpleFlag::enable();
 -for_each(flags.begin(), flags.end(), mem_fun(Flag::enable));
 +for_each(_kids.begin(), _kids.end(), mem_fun(Flag::enable));
  }

  void
  CompoundFlag::disable()
  {
 SimpleFlag::disable();
 -for_each(flags.begin(), flags.end(), mem_fun(Flag::disable));
 +for_each(_kids.begin(), _kids.end(), mem_fun(Flag::disable));
  }

  struct AllFlags : public Flag
 diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.hh
 --- a/src/base/debug.hh Mon May 02 12:40:32 2011 -0700
 +++ b/src/base/debug.hh Wed May 04 10:08:08 2011 -0400
 @@ -44,6 +44,7 @@
   protected:
 const char *_name;
 const char *_desc;
 +std::vectorFlag * _kids;

   public:
 Flag(const char *name, const char *desc);
 @@ -51,6 +52,7 @@

 std::string name() const { return _name; }
 std::string desc() const { return _desc; }
 +std::vectorFlag * kids() { return _kids; }

 virtual void enable() = 0;
 virtual void disable() = 0;
 @@ -77,7 +79,12 @@
  class CompoundFlag : public SimpleFlag
  {
   protected:
 -std::vectorFlag * flags;
 +void
 +addFlag(Flag f)
 +{
 +if (f != NULL)
 +_kids.push_back(f);
 +}

   public:
 CompoundFlag(const char *name, const char *desc,
 @@ -99,13 +106,6 @@
 addFlag(f15); addFlag(f16); addFlag(f17); addFlag(f18);
 addFlag(f19);
 }

 -void
 -addFlag(Flag f)
 -{
 -if (f != NULL)
 -flags.push_back(f);
 -}
 -
 void enable();
 void disable();
  };
 diff -r 3f49ed206f46 -r 5a9a639ce16f src/python/m5/debug.py
 --- a/src/python/m5/debug.pyMon May 02 12:40:32 2011 -0700
 +++ b/src/python/m5/debug.pyWed May 04 10:08:08 2011 -0400
 @@ -26,24 +26,36 @@
  #
  # Authors: Nathan Binkert

 +from UserDict import DictMixin
 +
  import internal

 +from internal.debug import SimpleFlag, CompoundFlag
  from internal.debug import schedBreakCycle, setRemoteGDBPort
 +from m5.util import printList

  def help():
 print Base Flags:
 -for flag in flags.basic:
 -print %s: %s % (flag, flags.descriptions[flag])
 +for name in sorted(flags):
 +if name == 'All':
 +continue
 +flag = flags[name]
 +children = [c for c in flag.kids() ]
 +if not children:
 +print %s: %s % (name, flag.desc())
 print
 print Compound Flags:
 -for flag in flags.compound:
 -if flag == 'All':
 +for name in sorted(flags):
 +if name == 'All':
 continue
 -print %s: %s % (flag, flags.descriptions[flag])
 -util.printList(flags.compoundMap[flag], indent=8)
 -print
 +flag = flags[name]
 +children = [c for c in flag.kids() ]
 +if children:
 +print %s: %s % (name, flag.desc())
 +printList([ c.name() for c in children ], indent=8)
 +print

 -class AllFlags(object):
 +class AllFlags(DictMixin):
 def __init__(self):
 self._version = -1
 self._dict = {}
 ___
 m5-dev mailing list
 m5-dev@m5sim.org
 http://m5sim.org/mailman/listinfo/m5-dev

___
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev


Re: [m5-dev] changeset in m5: debug: fix help output

2011-05-04 Thread nathan binkert
I'm not sure.  Something must have happened when I rebased my patch
queue.  I believe all that needs to happen is delete the 4 lines
relating to --trace-help and --trace-flags.  Can someone delete them
for me and make sure that M5 still runs correctly?  I'm out of town
and I'm really not going to be able to do anything for a couple of
days.

  Nate

 Note that running m5 --help still has the old names:

 Trace Options
 -
 --trace-help            Print help on trace flags
 --trace-flags=FLAG[,FLAG]
                        Sets the flags for tracing (-FLAG disables a flag)
 --trace-start=TIME      Start tracing at TIME (must be in ticks)
 --trace-file=FILE       Sets the output file for tracing [Default: cout]
 --trace-ignore=EXPR     Ignore EXPR sim objects


 On Wed, May 4, 2011 at 7:07 AM, Nathan Binkert n...@binkert.org wrote:

 changeset 5a9a639ce16f in /z/repo/m5
 details: http://repo.m5sim.org/m5?cmd=changeset;node=5a9a639ce16f
 description:
        debug: fix help output

 diffstat:

  src/base/debug.cc      |   4 ++--
  src/base/debug.hh      |  16 
  src/python/m5/debug.py |  28 
  3 files changed, 30 insertions(+), 18 deletions(-)

 diffs (115 lines):

 diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.cc
 --- a/src/base/debug.cc Mon May 02 12:40:32 2011 -0700
 +++ b/src/base/debug.cc Wed May 04 10:08:08 2011 -0400
 @@ -101,14 +101,14 @@
  CompoundFlag::enable()
  {
     SimpleFlag::enable();
 -    for_each(flags.begin(), flags.end(), mem_fun(Flag::enable));
 +    for_each(_kids.begin(), _kids.end(), mem_fun(Flag::enable));
  }

  void
  CompoundFlag::disable()
  {
     SimpleFlag::disable();
 -    for_each(flags.begin(), flags.end(), mem_fun(Flag::disable));
 +    for_each(_kids.begin(), _kids.end(), mem_fun(Flag::disable));
  }

  struct AllFlags : public Flag
 diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.hh
 --- a/src/base/debug.hh Mon May 02 12:40:32 2011 -0700
 +++ b/src/base/debug.hh Wed May 04 10:08:08 2011 -0400
 @@ -44,6 +44,7 @@
   protected:
     const char *_name;
     const char *_desc;
 +    std::vectorFlag * _kids;

   public:
     Flag(const char *name, const char *desc);
 @@ -51,6 +52,7 @@

     std::string name() const { return _name; }
     std::string desc() const { return _desc; }
 +    std::vectorFlag * kids() { return _kids; }

     virtual void enable() = 0;
     virtual void disable() = 0;
 @@ -77,7 +79,12 @@
  class CompoundFlag : public SimpleFlag
  {
   protected:
 -    std::vectorFlag * flags;
 +    void
 +    addFlag(Flag f)
 +    {
 +        if (f != NULL)
 +            _kids.push_back(f);
 +    }

   public:
     CompoundFlag(const char *name, const char *desc,
 @@ -99,13 +106,6 @@
         addFlag(f15); addFlag(f16); addFlag(f17); addFlag(f18);
 addFlag(f19);
     }

 -    void
 -    addFlag(Flag f)
 -    {
 -        if (f != NULL)
 -            flags.push_back(f);
 -    }
 -
     void enable();
     void disable();
  };
 diff -r 3f49ed206f46 -r 5a9a639ce16f src/python/m5/debug.py
 --- a/src/python/m5/debug.py    Mon May 02 12:40:32 2011 -0700
 +++ b/src/python/m5/debug.py    Wed May 04 10:08:08 2011 -0400
 @@ -26,24 +26,36 @@
  #
  # Authors: Nathan Binkert

 +from UserDict import DictMixin
 +
  import internal

 +from internal.debug import SimpleFlag, CompoundFlag
  from internal.debug import schedBreakCycle, setRemoteGDBPort
 +from m5.util import printList

  def help():
     print Base Flags:
 -    for flag in flags.basic:
 -        print     %s: %s % (flag, flags.descriptions[flag])
 +    for name in sorted(flags):
 +        if name == 'All':
 +            continue
 +        flag = flags[name]
 +        children = [c for c in flag.kids() ]
 +        if not children:
 +            print     %s: %s % (name, flag.desc())
     print
     print Compound Flags:
 -    for flag in flags.compound:
 -        if flag == 'All':
 +    for name in sorted(flags):
 +        if name == 'All':
             continue
 -        print     %s: %s % (flag, flags.descriptions[flag])
 -        util.printList(flags.compoundMap[flag], indent=8)
 -        print
 +        flag = flags[name]
 +        children = [c for c in flag.kids() ]
 +        if children:
 +            print     %s: %s % (name, flag.desc())
 +            printList([ c.name() for c in children ], indent=8)
 +    print

 -class AllFlags(object):
 +class AllFlags(DictMixin):
     def __init__(self):
         self._version = -1
         self._dict = {}
 ___
 m5-dev mailing list
 m5-dev@m5sim.org
 http://m5sim.org/mailman/listinfo/m5-dev

 ___
 m5-dev mailing list
 m5-dev@m5sim.org
 http://m5sim.org/mailman/listinfo/m5-dev

___
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev


Re: [m5-dev] changeset in m5: debug: fix help output

2011-05-04 Thread Steve Reinhardt
So --trace-start, --trace-ignore, and --trace-file didn't get renamed?

On Wed, May 4, 2011 at 4:21 PM, nathan binkert n...@binkert.org wrote:

 I'm not sure.  Something must have happened when I rebased my patch
 queue.  I believe all that needs to happen is delete the 4 lines
 relating to --trace-help and --trace-flags.  Can someone delete them
 for me and make sure that M5 still runs correctly?  I'm out of town
 and I'm really not going to be able to do anything for a couple of
 days.

  Nate

  Note that running m5 --help still has the old names:
 
  Trace Options
  -
  --trace-helpPrint help on trace flags
  --trace-flags=FLAG[,FLAG]
 Sets the flags for tracing (-FLAG disables a flag)
  --trace-start=TIME  Start tracing at TIME (must be in ticks)
  --trace-file=FILE   Sets the output file for tracing [Default: cout]
  --trace-ignore=EXPR Ignore EXPR sim objects
 
 
  On Wed, May 4, 2011 at 7:07 AM, Nathan Binkert n...@binkert.org wrote:
 
  changeset 5a9a639ce16f in /z/repo/m5
  details: http://repo.m5sim.org/m5?cmd=changeset;node=5a9a639ce16f
  description:
 debug: fix help output
 
  diffstat:
 
   src/base/debug.cc  |   4 ++--
   src/base/debug.hh  |  16 
   src/python/m5/debug.py |  28 
   3 files changed, 30 insertions(+), 18 deletions(-)
 
  diffs (115 lines):
 
  diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.cc
  --- a/src/base/debug.cc Mon May 02 12:40:32 2011 -0700
  +++ b/src/base/debug.cc Wed May 04 10:08:08 2011 -0400
  @@ -101,14 +101,14 @@
   CompoundFlag::enable()
   {
  SimpleFlag::enable();
  -for_each(flags.begin(), flags.end(), mem_fun(Flag::enable));
  +for_each(_kids.begin(), _kids.end(), mem_fun(Flag::enable));
   }
 
   void
   CompoundFlag::disable()
   {
  SimpleFlag::disable();
  -for_each(flags.begin(), flags.end(), mem_fun(Flag::disable));
  +for_each(_kids.begin(), _kids.end(), mem_fun(Flag::disable));
   }
 
   struct AllFlags : public Flag
  diff -r 3f49ed206f46 -r 5a9a639ce16f src/base/debug.hh
  --- a/src/base/debug.hh Mon May 02 12:40:32 2011 -0700
  +++ b/src/base/debug.hh Wed May 04 10:08:08 2011 -0400
  @@ -44,6 +44,7 @@
protected:
  const char *_name;
  const char *_desc;
  +std::vectorFlag * _kids;
 
public:
  Flag(const char *name, const char *desc);
  @@ -51,6 +52,7 @@
 
  std::string name() const { return _name; }
  std::string desc() const { return _desc; }
  +std::vectorFlag * kids() { return _kids; }
 
  virtual void enable() = 0;
  virtual void disable() = 0;
  @@ -77,7 +79,12 @@
   class CompoundFlag : public SimpleFlag
   {
protected:
  -std::vectorFlag * flags;
  +void
  +addFlag(Flag f)
  +{
  +if (f != NULL)
  +_kids.push_back(f);
  +}
 
public:
  CompoundFlag(const char *name, const char *desc,
  @@ -99,13 +106,6 @@
  addFlag(f15); addFlag(f16); addFlag(f17); addFlag(f18);
  addFlag(f19);
  }
 
  -void
  -addFlag(Flag f)
  -{
  -if (f != NULL)
  -flags.push_back(f);
  -}
  -
  void enable();
  void disable();
   };
  diff -r 3f49ed206f46 -r 5a9a639ce16f src/python/m5/debug.py
  --- a/src/python/m5/debug.pyMon May 02 12:40:32 2011 -0700
  +++ b/src/python/m5/debug.pyWed May 04 10:08:08 2011 -0400
  @@ -26,24 +26,36 @@
   #
   # Authors: Nathan Binkert
 
  +from UserDict import DictMixin
  +
   import internal
 
  +from internal.debug import SimpleFlag, CompoundFlag
   from internal.debug import schedBreakCycle, setRemoteGDBPort
  +from m5.util import printList
 
   def help():
  print Base Flags:
  -for flag in flags.basic:
  -print %s: %s % (flag, flags.descriptions[flag])
  +for name in sorted(flags):
  +if name == 'All':
  +continue
  +flag = flags[name]
  +children = [c for c in flag.kids() ]
  +if not children:
  +print %s: %s % (name, flag.desc())
  print
  print Compound Flags:
  -for flag in flags.compound:
  -if flag == 'All':
  +for name in sorted(flags):
  +if name == 'All':
  continue
  -print %s: %s % (flag, flags.descriptions[flag])
  -util.printList(flags.compoundMap[flag], indent=8)
  -print
  +flag = flags[name]
  +children = [c for c in flag.kids() ]
  +if children:
  +print %s: %s % (name, flag.desc())
  +printList([ c.name() for c in children ], indent=8)
  +print
 
  -class AllFlags(object):
  +class AllFlags(DictMixin):
  def __init__(self):
  self._version = -1
  self._dict = {}
  ___
  m5-dev mailing list
  m5-dev@m5sim.org
  http://m5sim.org/mailman/listinfo/m5-dev
 
  ___
  m5-dev mailing list
  

Re: [m5-dev] changeset in m5: debug: fix help output

2011-05-04 Thread nathan binkert
 So --trace-start, --trace-ignore, and --trace-file didn't get renamed?

Yeah, the idea was that there was more to the flags than tracing, but
the start, ignore, and file things were specific to tracing.

  Nate
___
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev