1/** 2 * @file op_parse_event.h 3 * event parsing 4 * 5 * You can have silliness here. 6 * 7 * @remark Copyright 2002 OProfile authors 8 * @remark Read the file COPYING 9 * 10 * @author John Levon 11 * @author Philippe Elie 12 */ 13 14#ifndef OP_PARSE_EVENT_H 15#define OP_PARSE_EVENT_H 16 17#include <stddef.h> 18 19struct parsed_event { 20 char * name; 21 int count; 22 int unit_mask; 23 int kernel; 24 int user; 25 int unit_mask_valid; 26}; 27 28/** 29 * @param parsed_events array of events to fill in 30 * @param max_events size of parsed_events 31 * @param events null terminated array of events string on the form 32 * event_name:count[:unit_mask:kernel:user] 33 * 34 * parse events given by the nil terminated array events and fill in 35 * parsed_events with results. Events validity are not checked except. 36 * A fatal error occur if number of events is greater than max_events. 37 * 38 * Return the number of events parsed. 39 */ 40size_t parse_events(struct parsed_event * parsed_events, size_t max_events, 41 char const * const * events); 42 43#endif /* !OP_PARSE_EVENT_H */ 44