qsp_report() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_sync_profile() passes monitor_fprintf() and the current monitor cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the callback, and call qemu_printf() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20190417191805.28198-7-armbru@redhat.com>
		
			
				
	
	
		
			28 lines
		
	
	
		
			610 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			610 B
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * qsp.c - QEMU Synchronization Profiler
 | 
						|
 *
 | 
						|
 * Copyright (C) 2018, Emilio G. Cota <cota@braap.org>
 | 
						|
 *
 | 
						|
 * License: GNU GPL, version 2 or later.
 | 
						|
 *   See the COPYING file in the top-level directory.
 | 
						|
 *
 | 
						|
 * Note: this header file can *only* be included from thread.h.
 | 
						|
 */
 | 
						|
#ifndef QEMU_QSP_H
 | 
						|
#define QEMU_QSP_H
 | 
						|
 | 
						|
enum QSPSortBy {
 | 
						|
    QSP_SORT_BY_TOTAL_WAIT_TIME,
 | 
						|
    QSP_SORT_BY_AVG_WAIT_TIME,
 | 
						|
};
 | 
						|
 | 
						|
void qsp_report(size_t max, enum QSPSortBy sort_by,
 | 
						|
                bool callsite_coalesce);
 | 
						|
 | 
						|
bool qsp_is_enabled(void);
 | 
						|
void qsp_enable(void);
 | 
						|
void qsp_disable(void);
 | 
						|
void qsp_reset(void);
 | 
						|
 | 
						|
#endif /* QEMU_QSP_H */
 |