mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 08:38:45 +02:00 
			
		
		
		
	perf: Only dump the throttle log for the leader
The PERF_RECORD_THROTTLE records are dumped for all throttled events. It's not necessary for group events, which are throttled altogether. Optimize it by only dump the throttle log for the leader. The sample right after the THROTTLE record must be generated by the actual target event. It is good enough for the perf tool to locate the actual target event. Suggested-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20250520181644.2673067-3-kan.liang@linux.intel.com
This commit is contained in:
		
							parent
							
								
									9734e25fbf
								
							
						
					
					
						commit
						e800ac5120
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -2650,14 +2650,16 @@ static void perf_event_unthrottle(struct perf_event *event, bool start) | |||
| 	event->hw.interrupts = 0; | ||||
| 	if (start) | ||||
| 		event->pmu->start(event, 0); | ||||
| 	perf_log_throttle(event, 1); | ||||
| 	if (event == event->group_leader) | ||||
| 		perf_log_throttle(event, 1); | ||||
| } | ||||
| 
 | ||||
| static void perf_event_throttle(struct perf_event *event) | ||||
| { | ||||
| 	event->pmu->stop(event, 0); | ||||
| 	event->hw.interrupts = MAX_INTERRUPTS; | ||||
| 	perf_log_throttle(event, 0); | ||||
| 	if (event == event->group_leader) | ||||
| 		perf_log_throttle(event, 0); | ||||
| } | ||||
| 
 | ||||
| static void perf_event_unthrottle_group(struct perf_event *event, bool skip_start_event) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Kan Liang
						Kan Liang