I never use the ignore option myself, so it may well be that there's
another bug in there somewhere.

Personally I would just dump the full trace and use grep to filter out the
L2 cache lines.

Steve

On Mon, Oct 13, 2014 at 11:24 PM, Marcus Tshibangu <nmtsh...@ncsu.edu>
wrote:

> Thanks Steve, your guess makes more sense but the last string is not
> replacing the previous, they all get passed correctly but it just doesnt
> work correctly somewhere else. because when I print the value of "expr"
> from trace.i after "Trace::ignore.setExpression(expr)" has been executed,
> it gives me the entire string entered on the command line. so the code in
> main.py, trace.i and match.cc seem to work fine. it's just that somewhere
> along the line the code is not written to ignore more than one simObject.
> btw, when I put multiple expression, none of them seem to be considered but
> all get passed correctly as I explained above. but one expression works
> fine.
>
> What I am trying to accomplish is just to print the trace for L2 cache
> ONLY (e.g. system.l2). any other way to accomplish this? without messing
> with ignore option which has never worked before.
> src/mem/cache/cahe_impl.hh is the generic code used by all the caches.
> where can I go to only print trace for L2 cache and ignore icache and
> dcache?
>
> On Sat, Oct 11, 2014 at 12:43 PM, Steve Reinhardt <ste...@gmail.com>
> wrote:
>
>> It's a little convoluted, but I think I found the problem.  Apparently
>> having multiple ignore strings hasn't worked in quite some time, if ever.
>>
>> In src/python/m5/main.py, the ignore strings are passed into C++ one at a
>> time:
>>
>>     for ignore in options.debug_ignore:
>>         check_tracing()
>>         trace.ignore(ignore)
>>
>> And it's a little tricky to track down, but trace.ignore() corresponds to
>> this swig-wrapped C++ function in src/python/swig/trace.i:
>>
>> inline void
>> ignore(const char *expr)
>> {
>>     Trace::ignore.setExpression(expr);
>> }
>>
>> And if you track down setExpression() in src/base/match.cc, you find:
>>
>> void
>> ObjectMatch::setExpression(const string &expr)
>> {
>>     tokens.resize(1);
>>     tokenize(tokens[0], expr, '.');
>> }
>>
>> So it looks like every time you call trace.ignore(ignore) from python
>> you're replacing the list of expressions in 'tokens' with the new string.
>> So my guess based on looking at the code is that, when you pass in multiple
>> strings, only the last one is actually taking effect---just a guess though.
>>
>> I see a few ways to fix this.
>>
>> I think the best way to fix it is to make a single call from python into
>> C++ with the entire list of strings.  There's already an overloaded version
>> of setExpression for this ('ObjectMatch::setExpression(const vector<string>
>> &expr)').  So it would just be a matter of exposing that function via swig
>> in trace.i, and passing it the full options.debug_ignore list directly (no
>> more for loop in python).
>>
>> If that sounds daunting, a more incremental quick fix would just be to
>> change ObjectMatch::setExpression() to append the passed-in expression to
>> the token vector instead of overwriting it.
>>
>> If you do fix it, and particularly if you choose the more comprehensive
>> former fix, please upload your patch on reviewboard so we can consider
>> putting it back in the main repository.
>>
>> Thanks,
>>
>> Steve
>>
>>
>> On Sat, Oct 11, 2014 at 11:56 AM, Marcus Tshibangu <nmtsh...@ncsu.edu>
>> wrote:
>>
>>> Thanks Steve, you are right I still have the old version with both
>>> debug* and trace* optons but it shouldn't make a difference. it maybe that
>>> the --trace-ignore option itself is not working for multiple objects only
>>> for one object. because even append doesn't work for it but it works for
>>> other options. for instance in the following command:
>>>
>>> *--debug-flags=Cache --debug-flags=BaseBus --trace-ignore='system.cpu0'
>>> --trace-ignore='system.cpu1' --trace-file=trace.out*
>>>
>>> Cache and BaseBus are appended and I get their traces but for ignore
>>> part it's not appended and doesn't even work for neither one of the
>>> objects. but it works fine if i only have one ignore objects.
>>> so can u do me a favor and use the above command in your new version
>>> (with trace* replaced by debug* of course) and see if it's a version issue?
>>> if not where can I go to fix this?
>>>
>>> On Sat, Oct 11, 2014 at 9:37 AM, Steve Reinhardt <ste...@gmail.com>
>>> wrote:
>>>
>>>> Sometimes you've got to use the source... from src/python/m5/main.py:
>>>>
>>>>     option("--debug-ignore", metavar="EXPR", action='append', split=':',
>>>>         help="Ignore EXPR sim objects")
>>>>
>>>> Apparently colon is supposed to be the delimiter.  The 'split' option
>>>> is a Nate extension (see src/python/m5/options.py), so if colon is not
>>>> actually working, it could be a bug.  The "action='append'" part means that
>>>> you can also specify --debug-ignore more than once to get the same effect,
>>>> and that's built in to python optparse, so it's much less likely to be
>>>> buggy.
>>>>
>>>> BTW, the --trace-* options were changed to --debug-* a while ago, so
>>>> you may have an old version, but you can check your source to see if these
>>>> comments still apply.
>>>>
>>>> Steve
>>>>
>>>>
>>>>
>>>> On Sat, Oct 11, 2014 at 12:24 AM, Marcus Tshibangu via gem5-users <
>>>> gem5-users@gem5.org> wrote:
>>>>
>>>>> when I use *--trace-ignore='system.cpu0'*, I ignore everything
>>>>> related to cpu0 from trace file. but if I try 
>>>>> *--trace-ignore='system.cpu0;system.cpu1'
>>>>> *hoping that I can ignore also cpu1, it doesn't work. what is the
>>>>> best separator for multiple simObjects in EXPR. I have tried comma,
>>>>> semicolon, colon ,..., all types of separator but nothing seems to work.
>>>>> any idea? the trace file is so big but i only need L2 cache trace info
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> gem5-users mailing list
>>>>> gem5-users@gem5.org
>>>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Marcus Tshibangu
>>> Graduate Student and Research Assistant
>>> Electrical & Computer Engineering, NCSU
>>> MRC 438, 2410 Campus Shore Dr., Raleigh NC 27606
>>> nmtsh...@ncsu.edu
>>>
>>
>>
>
>
> --
> Marcus Tshibangu
> Graduate Student and Research Assistant
> Electrical & Computer Engineering, NCSU
> MRC 438, 2410 Campus Shore Dr., Raleigh NC 27606
> nmtsh...@ncsu.edu
>
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to