粘贴过来,翻墙不方便 When I found this, I just could not believed it.
In the past few weeks I did many articles greatly appreciated by the community: FlashPlayer Security, FlashPlayer Memory, AS3 Array under the hood, Optimized Base64 Encoding. But this one, I think, will rule them all!
I knew for a long time now that flash had undocumented features, little part of flash that could help speed up process (like the memory opcodes) or make interaction easy with right click and that kind of things. But I never thought that FlashPlayer would hide data that could help find bugs, or give better knowledge of how flash is interpreted.
As you may know, The mm.cfg files is located in:
?Windows; C:\Documents and Settings\username\mm.cfg ?OSX; /Library/Application Support/Macromedia/mm.cfg ?Linux; home/username/mm.cfg This file is interpreted when a Flash Player instance launches a SWF and gives indication of what should or shouldn’t be done. For example, most people use this file to set tracing parameters: ErrorReportingEnable=1 TraceOutputFileEnable=1 TraceOutputFileName=c:\logs\flashlogs.txt MaxWarnings=50
Many other options are specified in the Adobe FlashPlayer Admin Guide… but most of is NOT DOCUMENTED!
There is a LOT of thing to talk about and many cutting edge tools to improve your understanding of flash.
So let’s get into it
The Treasure The complete list of features of mm.cfg is at the end of the post, but first lets talk about what’s most interesting. I took my favorite 7 features and made detailed explanation with example for each one so here they are:
TraceOutputB?red = 1|0 This feature is essential to the rest of all the cool features because they output A LOT of lines in the flashlog
This is a very simple features but it change everything. Did you ever had problem tracing to many information and losing half of it in the flashlog? Well this is a known bug. If you make a loop of 1 000 000 and you trace the iterator, the flashlog will skip thousand of entries and will take 100% of your CPU while writing to disk. If you set this variable to tr, the traces will be b?red and the write to disk will output multiple lines in one access. Performance? By default (without this feature), I’m able to trace 3600 line in 6 seconds and my CPU is at 100%. If I turn the features on, I can trace 1 000 000 lines in the same time! And my CPU is not even near 100%.
AS3Verbose = 1|0 This one is totally crazy. It traces detailed information about SWF ByteCode str ture and Runtime parsing of the bytecode! You don’t need any software… no special framework to bind in your own SWF… just this one flag!
粘贴过来,翻墙不方便 When I found this, I just could not believed it.
In the past few weeks I did many articles greatly appreciated by the community: FlashPlayer Security, FlashPlayer Memory, AS3 Array under the hood, Optimized Base64 Encoding. But this one, I think, will rule them all!
I knew for a long time now that flash had undocumented features, little part of flash that could help speed up process (like the memory opcodes) or make interaction easy with right click and that kind of things. But I never thought that FlashPlayer would hide data that could help find bugs, or give better knowledge of how flash is interpreted.
As you may know, The mm.cfg files is located in:
?Windows; C:\Documents and Settings\username\mm.cfg ?OSX; /Library/Application Support/Macromedia/mm.cfg ?Linux; home/username/mm.cfg This file is interpreted when a Flash Player instance launches a SWF and gives indication of what should or shouldn’t be done. For example, most people use this file to set tracing parameters: ErrorReportingEnable=1 TraceOutputFileEnable=1 TraceOutputFileName=c:\logs\flashlogs.txt MaxWarnings=50
Many other options are specified in the Adobe FlashPlayer Admin Guide… but most of is NOT DOCUMENTED!
There is a LOT of thing to talk about and many cutting edge tools to improve your understanding of flash.
So let’s get into it
The Treasure The complete list of features of mm.cfg is at the end of the post, but first lets talk about what’s most interesting. I took my favorite 7 features and made detailed explanation with example for each one so here they are:
TraceOutputB?red = 1|0 This feature is essential to the rest of all the cool features because they output A LOT of lines in the flashlog
This is a very simple features but it change everything. Did you ever had problem tracing to many information and losing half of it in the flashlog? Well this is a known bug. If you make a loop of 1 000 000 and you trace the iterator, the flashlog will skip thousand of entries and will take 100% of your CPU while writing to disk. If you set this variable to tr, the traces will be b?red and the write to disk will output multiple lines in one access. Performance? By default (without this feature), I’m able to trace 3600 line in 6 seconds and my CPU is at 100%. If I turn the features on, I can trace 1 000 000 lines in the same time! And my CPU is not even near 100%.
AS3Verbose = 1|0 This one is totally crazy. It traces detailed information about SWF ByteCode str ture and Runtime parsing of the bytecode! You don’t need any software… no special framework to bind in your own SWF… just this one flag!
AS3Trace = 1|0 This one is also very useful for debugging It trace every single call to any function that is being called in the SWF at runtime! It’s like expending the StackTrace to the full software run time.
If you got a crash hard to find, you can turn this on and you will see ALL the last function executed that leaded to the crash.