mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	trace/ftrace: Only require CONFIG_FUNCTION_PROFILER for the function profiling
We currently raise an exception when trying to use the 'function' or 'function_graph' tracer if the kernel wasn't compiled CONFIG_FUNCTION_PROFILER, but that is a completely valid use.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							745dc9499a
						
					
				
				
					commit
					72be3d01f8
				
			@@ -161,9 +161,6 @@ class FtraceCollector(TraceCollector):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        # Check for function tracing support
 | 
					        # Check for function tracing support
 | 
				
			||||||
        if self.functions:
 | 
					        if self.functions:
 | 
				
			||||||
            if not self.target.file_exists(self.function_profile_file):
 | 
					 | 
				
			||||||
                raise TargetStableError('Function profiling not supported. '\
 | 
					 | 
				
			||||||
                        'A kernel build with CONFIG_FUNCTION_PROFILER enable is required')
 | 
					 | 
				
			||||||
            # Validate required functions to be traced
 | 
					            # Validate required functions to be traced
 | 
				
			||||||
            available_functions = self.target.execute(
 | 
					            available_functions = self.target.execute(
 | 
				
			||||||
                    'cat {}'.format(self.available_functions_file),
 | 
					                    'cat {}'.format(self.available_functions_file),
 | 
				
			||||||
@@ -178,7 +175,11 @@ class FtraceCollector(TraceCollector):
 | 
				
			|||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    selected_functions.append(function)
 | 
					                    selected_functions.append(function)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # Function profiling
 | 
				
			||||||
            if self.tracer is None:
 | 
					            if self.tracer is None:
 | 
				
			||||||
 | 
					                if not self.target.file_exists(self.function_profile_file):
 | 
				
			||||||
 | 
					                    raise TargetStableError('Function profiling not supported. '\
 | 
				
			||||||
 | 
					                                            'A kernel build with CONFIG_FUNCTION_PROFILER enable is required')
 | 
				
			||||||
                self.function_string = _build_trace_functions(selected_functions)
 | 
					                self.function_string = _build_trace_functions(selected_functions)
 | 
				
			||||||
                # If function profiling is enabled we always need at least one event.
 | 
					                # If function profiling is enabled we always need at least one event.
 | 
				
			||||||
                # Thus, if not other events have been specified, try to add at least
 | 
					                # Thus, if not other events have been specified, try to add at least
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user