自打不知道哪个版本的Firefox下面的Flashbug停止开发了,就对Flash开发感觉到困惑。虽然一直忙于工作没时间来做flash,能够实时监控TraceLog的问题一直得不到解决,今天终于解决了一把。

首先,强烈鄙视那个每年要8美元的插件,我用不着那么多复杂的功能,我只想实时看个TraceLog。然后,也许你会说我做了一个插件?No!不要插件完全手动档配置指南,现在开始。

第一步——配置mm.cfg,我的mm.cfg是这样写的:

ErrorReportingEnable=1

TraceOutputFileEnable=1

CrashLogEnable=1

DisableNetworkAndFilesystemInHostApp=0

第二步——测试

第三步——找一个监控工具,我用的是BareTailhttp://www.baremetalsoft.com/),这个有免费版,唯一不爽的就是启动的时候弹几秒广告,不过无所谓了。注意文件编码选择UTF8.

附表:mm.cfg参数一览,转自这里

1. TraceOutputBuffered = 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 true, the traces will be buffered and the write to disk will output multiple lines in one access.

Performance? By default (without this feature), Im 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%.

 

2. AS3Verbose = 1|0

This one is totally crazy.

It traces detailed information about SWF ByteCode structure and Runtime parsing of the bytecode!

You dont need any software… no special framework to bind in your own SWF… just this one flag!

 

3. AS3Trace = 1|0

If turned on, ALL function called (at runtime) will be outputed in the flashlogs!

You should always use in conjonction with TraceOutputBuffered=1

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!

Its 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.

You can even see Timer Call and Events callbacks!

 

4. AS3StaticProfile = 1|0

Information Generated by NanoJit (just in time compiler used in Tamarin), including a lot of statistic on code conversion, time to process and memory use

This flag enable Just in Time Compiler (NanoJIT) logs.

It gives detailed information on function conversion, bytecode conversion, MIR (machine-dependent intermediate representation) created, memory used and many others.

At the end of execution, it also output a summary of all bytecode processed (For each opcode you have the number of occurrence, relatives importance, etc)

 

5. AS3DynamicProfile = 1|0

When enabling this (you might crash half the time) the flash player is going to collect precious profiling information on opcodes used in the Swf (count/Time/%/Cycles)

This one give dynamic information about the opcodes being called and gives statistic for each.

The statistics include count, cycles, %count, %times and CPI

 

My question is: Having access to the CPI (Cycle per instruction) will we be able to conclude all fights between what operation is faster that the others? Cycle counts does not lies (on the same platform)

* Request for Jackson Dunstan: Wanna work on that?  *

But there is a problem with this one, it crash all the time.

My guess is it cant process Flash Object” like Movieclip, Event, and all the other and only support operation valid in tamarin.

 

6. LogGPU = 1|0

This enable logging GPU information about current SWF while it runs.

Use GPULogOutputFileName = [path] to specify where to output that log.

Use DisplayGPUBlend = 1 to display the little green square while GPU runs

use ForceGPUBlend = 1 (At your own risk) to force GPU event if your videocard is not officially listed as valid for Flash GPU.

 

7. PreloadSwf?flashvar1=value&

This is mainly used by the FlashBuilder Profiler. When you launch a SWF profiling, FlashBuilder add this line to mm.cfg to make it run another SWF before the one you profile.

The default file is: C:/Documents and Settings/{USER}/My Documents/Flex Builder 3/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf?host=localhost&port=9999

The profiler agent is a SWF that use the as3 sampling classes to collect information and send them all over a socket connection to FlashBuilder.

FlashBuilder is only interpreting that data received from the SWF

By changing localhost by any other machine name you can connect to a remote FlashBuilder Profiler. On the Remote profiler you need to check the wait for application” box and then start the local SWF on the other machine.

 

8. AllowUserLocalTrust = 1|0

Lets you prevent users from designating any files on local file systems as trusted.

 

9. AS3AllocationTracking = 1|0

Enable/Disable Profiling information (if turned off, we cant profile Allocation in FlexBuilder anymore)

 

10. AS3AutoStartSampling = 1|0

Specify if we need a feedback before starting the profiler or we start right away.

 

11. AS3CSE = 1|0

CSE is an acronym for Common Subexpression Elimination. It seems plausible that these may be employed by the Flash virtual machine to optimize the byte-code before executing

 

12. AS3DCE = 1|0

DCE is an acronym for Dead Code Elimination. It seems plausible that these may be employed by the Flash virtual machine to optimize the byte-code before executing

 

13. AS3MIR = 1|0

Enable/Disable Profiling information (if turned off, FlashPlayer wont keep information on Machine-dependant intermediate representation – NanoJIT)

 

14. AS3Sampling = 1|0

Enable/Disable Profiling information (if turned off, we cant profile in FlexBuilder anymore)

 

15. AS3SSE = 1|0

*My guess is it turns on and off SSE optimization

 

16. AS3Turbo = 1|0

 

17. AS3Verbose = 1|0

Trace detailed information about SWF ByteCode structure and Runtime parsing of the bytecode!

 

18. AssetCacheSize=X

Lets you specify a hard limit, in MB, on the amount of local storage that Flash Player uses for the storage of common Flash components.

 

19. AutoUpdateDisable = 1|0

Lets you prevent Flash Player from automatically checking for and installing updated versions.

 

20. AutoUpdateInterval = X

Lets you specify how often to check for an updated version of Flash Player.

 

21. AutoUpdateVersionUrl = [URL]

Lets you specify a precise server to look up for new flash version

 

22. AVHardwareDisable = 1|0

Lets you prevent SWF files from accessing webcams or microphones.

 

23. CodeSignLogFile

 

24. CodeSignRootCert = 1|0

 

25. Convert8kAnd16kAudio = 1|0

 

26. CrashLogEnable = 1|0

 

27. DisableAVM1Loading = 1|0

If turned on, no SWF of version 8 and earlier can be loaded.

 

28. DisableDeviceFontEnumeration = 1|0

Lets you prevent information on installed fonts from being displayed.

 

29. DisableIncrementalGC = 1|0

Lets you enable/disable Garbage Collector Incremental policies (more info on the GC)

 

30. DisableMulticoreRenderer = 1|0

Lets you turn off multiple core rendering

 

31. DisableNetworkAndFilesystemInHostApp = 1|0

Lets you prevent networking or file system access of any kind.

 

32. DisableProductDownload = 1|0

Lets you prevent native code applications that are digitally signed and delivered by Adobe from being downloaded.

 

33. DisableSockets = 1|0

Lets you enable or disable the use of the Socket.connect() and XMLSocket.connect() methods.

 

34. DisplayGPUBlend = 1|0

If set to 1, it will prevent GPU use even if the SWF context is setted to use GPU and your card support it.

 

35. EnableIncrementalValidation = 1|0

 

36. EnableLeakFile = 1|0

 

37. EnableSocketsTo = [address]

Lets you create a whitelist of servers to which socket connections are allowed.

EnableSocketsTo = localhost.localdomain

EnableSocketsTo = 127.0.0.1

 

38. EnforceLocalSecurityInActiveXHostApp = 1|0

Lets you enforce local security rules for a specified application.

 

39. ErrorReportingEnable = 1|0

Set the ErrorReportingEnable property to 1 to enable the debugger version of Flash Player to write error messages to the log file.

 

40. FileDownloadDisable = 1|0

Lets you prevent the ActionScript FileReference API from performing file downloads.

 

41. FileUploadDisable = 1|0

Lets you prevent the ActionScript FileReference API from performing file uploads.

 

42. ForceGPUBlend = 1|0

Force GPU blending even if you video card is not officialy supported (At your own risk!)

 

43. FrameProfilingEnable = 1|0

Enable/Disable Profiling information (if turned off, we cant profile Frames in FlexBuilder anymore)

 

44. FullScreenDisable = 1|0

Lets you disable SWF files playing via a browser plug-in from being displayed in full-screen mode.

 

45. GCStats = 1|0

Enable/Disable Profiling information (if turned off, we cant profile GC in FlexBuilder anymore)

 

46. GPULogOutputFileName

Lets you specify the output file for the GPU informations

 

47. HeapProfilingAS3Enable = 1|0

Enable/Disable Profiling information (if turned off, we cant profile Heap in FlexBuilder anymore)

 

48. LegacyDomainMatching = 1|0

Lets you specify whether SWF files produced for Flash Player 6 and earlier can execute an operation that has been restricted in a newer version of Flash Player.

 

49. LocalFileLegacyAction = 1|0

Lets you specify how Flash Player determines whether to execute certain local SWF files that were originally produced for Flash Player 7 and earlier.

 

50. LocalFileReadDisable = 1|0

Lets you prevent local SWF files from having read access to files on local hard drives.

 

51. LocalStorageLimit = X

Lets you specify a hard limit on the amount of local storage that Flash Player uses (per domain) for persistent shared objects.

 

52. LogGPU = 1|0

Lets you specify if you want to output debug GPU log

 

53. MaxWarnings = X

The default value of the MaxWarnings property is 100. After 100 messages, the debugger version of Flash Player writes a message to the file stating that further error messages will be suppressed.

 

54. OverrideGPUValidation = 1|0

Overrides validation of the requirements needed to implement GPU compositing.

 

55. OverrideUserInvokedActions = 1|0

 

56. PolicyFileLog = 1|0

Enables the logging of policy file messages.

 

57. PolicyFileLogAppend = 1|0

Set the PolicyFileLogAppend property to 1 to save previous policy file log entries

 

58. PreloadSwf?flashvar1=value&

Lets you specify a SWF to be loaded before the main swf.This is the profiler agent, a little flash app (ProfilerAgent.swf) that connect to the FlexBuilder Profiler via socket (localhost:9999).

FlexBuilder is only interpreting that data.

PreloadSwf=C:/Documents and Settings/{USER}/My Documents/Flex Builder 3/.metadata/.plugins/com.adobe.flash.profiler/ProfilerAgent.swf?host=localhost&port=9999

By changing localhost by any other machine name you can connect to a remote FlashBuilder Profiler. On the Remote profiler you need to check the wait for application” box and then start the local SWF on the other machine.

 

59. ProductDisabled = 1|0

Creates a list of ProductManager applications that users are not permitted to install or launch.

 

60. ProductDownloadBaseUrl

 

61. ProfileFunctionEnable = 1|0

Enable/Disable Profiling information (if turned off, we cant profile function in FlexBuilder anymore)

 

62. ProfilingOutputDirectory = [path]

Specify where to save the ProfilerData file

 

63. ProfilingOutputFileEnable = 1|0

Specify if we want to create a file containing all the profiler data (flashprof_1265745253708.dat)

 

64. RendererProfilingEnable = 1|0

Enable/Disable Profiling information (if turned off, we cant profile in FlexBuilder anymore)

 

65. RTMFPP2PDisable = 1|0

Specifies how the NetStream constructor connects to a server when a value is specified for peerID, the second parameter passed to the constructor.

 

66. RTMFPTURNProxy = 1|0

Lets Flash Player make RTMFP connections through the specified TURN server in addition to normal UDP sockets.

 

67. ScriptStuckTimeout = X

Lets you specify the time after what the timeout (too much time running a script) exception will popup

 

68. SecurityDialogReportingEnable = 1|0

Lets you specify whether the Security dialog should be visible or not.

 

69. SuppressDebuggerExceptionDialogs = 1|0

Lets you specify whether the Error dialog should be visible or not.

 

70. ThirdPartyStorage

Lets you specify whether third-party SWF files can read and write locally persistent shared objects.

 

71. TraceOutputBuffered = 1|0

Specify the flash player to use a buffer before writing to disk. If you had problem when tracing tousands of lines and line were skipped, this solve the thing. Its also a lot faster (1000000 trace in 7 seconds instead of 3200 trace in 7 sec!)

 

72. TraceOutputFileEnable = 1|0

Set TraceOutputFileEnable to 1 to enable the debugger version of Flash Player to write trace messages to the log file.

 

73. TraceOutputFileName= [path]

(Before Flash 9) Sets the location of the log file. By default, the debugger version of Flash Player writes error messages to a file named flashlog.txt, located in the same directory in which the mm.cfg file is located.

 

74. UseBrokerProcess = 1|0

Lets you specify if you want to use elevated privileges or not (See the FlashPlayer update)

 

75. WindowlessDisable = 1|0