Store mem profile file in /tmp
This commit is contained in:
		
							parent
							
								
									35843cce22
								
							
						
					
					
						commit
						da8d82e09f
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -209,7 +209,7 @@ def debug(cmd: list[str], debugger: str = "lldb", wait: bool = False):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _profileCpu(cmd: list[str], rate=1000):
 | 
					def _profileCpu(cmd: list[str], rate=1000):
 | 
				
			||||||
    mkdir(const.TMP_DIR)
 | 
					    mkdir(const.TMP_DIR)
 | 
				
			||||||
    perfFile = f"{const.TMP_DIR}/perf.data"
 | 
					    perfFile = f"{const.TMP_DIR}/cpu-profile.data"
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        exec(
 | 
					        exec(
 | 
				
			||||||
            "perf",
 | 
					            "perf",
 | 
				
			||||||
| 
						 | 
					@ -241,7 +241,8 @@ def _profileCpu(cmd: list[str], rate=1000):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _profileMem(cmd: list[str]):
 | 
					def _profileMem(cmd: list[str]):
 | 
				
			||||||
    exec("heaptrack", *cmd)
 | 
					    perfFile = f"{const.TMP_DIR}/mem-profile.data"
 | 
				
			||||||
 | 
					    exec("heaptrack", "-o", perfFile, *cmd)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def profile(cmd: list[str], rate=1000, what: Literal["cpu", "mem"] = "cpu"):
 | 
					def profile(cmd: list[str], rate=1000, what: Literal["cpu", "mem"] = "cpu"):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue