src/libpfm4/lib/pfmlib_perf_event.c
/*
 * old interface, maintained for backward compatibility with earlier versions of the library
 */
old interface, maintained for backward compatibility with earlier versions of the library
old interface maintained for backward compatibility with earlier versions of the library
int
pfm_get_perf_event_encoding(const char *str, int dfl_plm, struct perf_event_attr *attr, char **fstr, int *idx)
{
	pfm_perf_encode_arg_t arg;
	int ret;
	if (PFMLIB_INITIALIZED() == 0)
		return PFM_ERR_NOINIT;
	if (!(attr && str))
		return PFM_ERR_INVAL;
	if (dfl_plm & ~(PFM_PLM_ALL))
		return PFM_ERR_INVAL;
	memset(&arg, 0, sizeof(arg));
	arg.attr = attr;
	arg.fstr = fstr;
	ret = pfm_get_os_event_encoding(str, dfl_plm, PFM_OS_PERF_EVENT_EXT, &arg);
	if (ret != PFM_SUCCESS)
		return ret;
	if (idx)
		*idx = arg.idx;
	return PFM_SUCCESS;
}
int pfm_get_perf_event_encoding ( const char * str , int dfl_plm , struct perf_event_attr * attr , char * * fstr , int * idx ) { pfm_perf_encode_arg_t arg ; int ret ; if ( PFMLIB_INITIALIZED ( ) == 0 ) return PFM_ERR_NOINIT ; if ( ! ( attr && str ) ) return PFM_ERR_INVAL ; if ( dfl_plm & ~ ( PFM_PLM_ALL ) ) return PFM_ERR_INVAL ; memset ( & arg , 0 , sizeof ( arg ) ) ; arg . attr = attr ; arg . fstr = fstr ; ret = pfm_get_os_event_encoding ( str , dfl_plm , PFM_OS_PERF_EVENT_EXT , & arg ) ; if ( ret != PFM_SUCCESS ) return ret ; if ( idx ) * idx = arg . idx ; return PFM_SUCCESS ; }
old interface, maintained for backward compatibility with earlier versions of the library
old interface maintained for backward compatibility with earlier versions of the library
/* idx and fstr can be NULL */ /* do not clear attr, some fields may be initialized by caller already, e.g., size */