src/components/pcp/linux-pcp.c
//-----------------------------------------------------------------------------
// qsort comparison routine, for pcp_event_info.
//-----------------------------------------------------------------------------
qsort comparison routine, for pcp_event_info.
qsort comparison routine for pcp_event_info .
static int qsPMID(const void *arg1, const void* arg2) 
{
   _pcp_event_info_t *p1 = (_pcp_event_info_t*) arg1;
   _pcp_event_info_t *p2 = (_pcp_event_info_t*) arg2;
   if (p1->pmid < p2->pmid) return (-1);                                
   if (p1->pmid > p2->pmid) return ( 1);                                
   if (p1->idx  < p2->idx ) return (-1);                                
   if (p1->idx  > p2->idx ) return ( 1);                                 
   return (strcmp(p1->name, p2->name));                                 
}
static int qsPMID ( const void * arg1 , const void * arg2 ) { _pcp_event_info_t * p1 = ( _pcp_event_info_t * ) arg1 ; _pcp_event_info_t * p2 = ( _pcp_event_info_t * ) arg2 ; if ( p1 -> pmid < p2 -> pmid ) return ( -1 ) ; if ( p1 -> pmid > p2 -> pmid ) return ( 1 ) ; if ( p1 -> idx < p2 -> idx ) return ( -1 ) ; if ( p1 -> idx > p2 -> idx ) return ( 1 ) ; return ( strcmp ( p1 -> name , p2 -> name ) ) ; }
qsort comparison routine, for pcp_event_info.
qsort comparison routine for pcp_event_info .
// 1 comes before 2. // 1 comes after 2. // same pmid, try idx into vlist. // 1 comes after 2.  // sort by name if same PMID and idx.