bckobayashimaru.de

Bridge Commander Kobayashi Maru Project
It is currently Tue Jun 25, 2019 3:38 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Dec 15, 2006 1:11 pm 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
The core is this simple file:
http://defiant.homedns.org/~erik/STBC/b ... bcdebug.py

The idea is to trace the BC function calls, so you know the last function called before BC crashed.

And this how you do it:
insert
Code:
from bcdebug import debug

ad the top of every file and call debug("") in every function.

Of course you can automate this.
I wrote a simple Python script which does this change for a single file.

try a command like
Code:
find -name "*.py" -not -name App.py -not -name bcdebug.py -exec echo "{}" \; -exec ~/bcdebug/run.py {} \;

to enable bcdebug for all files.

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Dec 17, 2006 11:49 pm 
Offline
Cadet 2nd Year
Cadet 2nd Year
User avatar

Joined: Tue Oct 10, 2006 11:35 pm
Posts: 26
Location: Earth
Hey Defiant i had made a similar script a while ago to debug my scripts: it kept track of the strings that were logged and then on each X seconds or when you exited the game it printed all of them to a specified file.
When the log was small, there was no performance problems, but with the more time i played, the bigger they were getting and lags begun to appear or if they already existed they were lasting longer, and if they got really big the lags were so strong that the game freezed.
Some time ago i've changed it to instead of printing everything at each X seconds, to in the first time create the log file then everytime a string was added she was directly printed (by appending) to the log file. The results using this method were that the game was hitching constantly (tho this lag was smaller than with the previous method, it was constant).

So i would like to know which one would be best to use or what could i change to make it "faster"?

_________________
"Revenge is a dish best served cold"
-Old Klingon Proverb

Yes i don't want to write a good signature.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 18, 2006 5:31 am 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
Try nt.O_APPEND

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 18, 2006 5:21 pm 
Offline
Cadet 2nd Year
Cadet 2nd Year
User avatar

Joined: Tue Oct 10, 2006 11:35 pm
Posts: 26
Location: Earth
i'm using it in the 2º method i mentioned.

_________________
"Revenge is a dish best served cold"
-Old Klingon Proverb

Yes i don't want to write a good signature.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 18, 2006 6:03 pm 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
hmm ok.
Does work mostly fine here. What big files are you talking about?
With my method my files easily grow up to 200MB.
Not noticed any special lag.

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 18, 2006 7:01 pm 
Offline
Cadet 2nd Year
Cadet 2nd Year
User avatar

Joined: Tue Oct 10, 2006 11:35 pm
Posts: 26
Location: Earth
Well 200Mb is bigger than the biggest log i've made (not remember the exact size but it had more than 500000 lines).
I was testing my mod and when i started QB the constant lag as i said was there, then i warped to another set and the lag was gone, and it was still logging the strings, i couldn't check what heppened if i returned to the previous set cause when i tried that BC crashed... I'll try again later.

The only diference i can think of between our scripts is that yours writes everything to a single file, while mine writes several log files (in these tests i noticed the lag it were 3 files). And both write a lot of lines in a single second.

_________________
"Revenge is a dish best served cold"
-Old Klingon Proverb

Yes i don't want to write a good signature.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 18, 2006 8:18 pm 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
hmm And it stops to lag when you deactivate file writing?

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 18, 2006 9:12 pm 
Offline
Cadet 2nd Year
Cadet 2nd Year
User avatar

Joined: Tue Oct 10, 2006 11:35 pm
Posts: 26
Location: Earth
yes.

_________________
"Revenge is a dish best served cold"
-Old Klingon Proverb

Yes i don't want to write a good signature.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group