Hi,

thanks for your help. M5 is truncating the stat file once at the beginning. But because the stream-pointer for the statistics information is not reset after saving (flushing) the statistics to the stats.txt file in case of calling the printing routine multiple time during one M5 execution the new statistics are just attached to the stats.txt file. I now solved my problem by resetting the start position of the output stream (stream->seekp(0)) in the function Text::output() in src/base/stat/text.cc just in case someone can use this info.

Best wishes
    Fabian Oboril


I want to save the current statistics to the stats.txt file every x cycles.
I managed that this is done in a way that the new values are attached to the
stats.txt file, meaning that every x cycles a new passage beginning with
"---------- Begin Simulation Statistics ----------" and ending with
"---------- End Simulation Statistics ----------" is attached to the output
file. My wish is that only the new and actual values can be found in the
file. So I want to clear/reset the stats.txt before dumping the new
statistics. I tried to simple delete the file and create a new and empty one
before saving the statistics but this doesn't work (in this case the file
stays empty). Has anyone an idea how to solve this problem?
This is because the file descriptor continues to point to the deleted
file.  What you could try to do instead is truncate the file using the
truncate command.  Alternatively, you can just hack the code to seek
to the beginning and truncate the file.  One issue is that I'm not
sure if we open the file for append, so you may have to hack the code
anyway.

   Nate
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to