trace profiling added
This commit is contained in:
		
							parent
							
								
									18d6d59292
								
							
						
					
					
						commit
						f32a4b24c9
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -6,3 +6,4 @@ php-parser | ||||
| 
 | ||||
| cpu.pprof | ||||
| mem.pprof | ||||
| trace.out | ||||
| @ -55,7 +55,7 @@ php-parser [flags] <path> ... | ||||
| |  -d   |string| dump format: [custom, go, json, pretty-json] | | ||||
| |  -p   | bool | show positions                               | | ||||
| |  -r   | bool | resolve names                                | | ||||
| | -prof |string| start profiler: [cpu, mem]                   | | ||||
| | -prof |string| start profiler: [cpu, mem, trace]            | | ||||
| | -meta | bool | show meta info                               | | ||||
| | -php5 | bool | parse as PHP5                                | | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										4
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								main.go
									
									
									
									
									
								
							| @ -29,7 +29,7 @@ func main() { | ||||
| 	withMeta = flag.Bool("meta", false, "show meta") | ||||
| 	showResolvedNs = flag.Bool("r", false, "resolve names") | ||||
| 	flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") | ||||
| 	flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem]") | ||||
| 	flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem, trace]") | ||||
| 
 | ||||
| 	flag.Parse() | ||||
| 
 | ||||
| @ -38,6 +38,8 @@ func main() { | ||||
| 		defer profile.Start(profile.ProfilePath("."), profile.NoShutdownHook).Stop() | ||||
| 	case "mem": | ||||
| 		defer profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() | ||||
| 	case "trace": | ||||
| 		defer profile.Start(profile.TraceProfile, profile.ProfilePath("."), profile.NoShutdownHook).Stop() | ||||
| 	} | ||||
| 
 | ||||
| 	pathCh := make(chan string) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user