FreeBSD/usr.sbin/pmcannotate/pmcannotate.c
/*
 * Create a new raw entry object for a specified function.
 */
Create a new raw entry object for a specified function.
Create a new raw entry object for a specified function .
static struct entry *
entry_create(const char *name, uintptr_t pc, uintptr_t start, uintptr_t end)
{
	struct entry *obj;
	obj = calloc(1, sizeof(struct entry));
	if (obj == NULL)
		return (NULL);
	obj->en_name = strdup(name);
	if (obj->en_name == NULL) {
		free(obj);
		return (NULL);
	}
	obj->en_pc = pc;
	obj->en_ostart = start;
	obj->en_oend = end;
	obj->en_nsamples = 1;
	return (obj);
}
static struct entry * entry_create ( const char * name , uintptr_t pc , uintptr_t start , uintptr_t end ) { struct entry * obj ; obj = calloc ( 1 , sizeof ( struct entry ) ) ; if ( obj == NULL ) return ( NULL ) ; obj -> en_name = strdup ( name ) ; if ( obj -> en_name == NULL ) { free ( obj ) ; return ( NULL ) ; } obj -> en_pc = pc ; obj -> en_ostart = start ; obj -> en_oend = end ; obj -> en_nsamples = 1 ; return ( obj ) ; }
Create a new raw entry object for a specified function.
Create a new raw entry object for a specified function .