diff options
author | Upstream <upstream-import@none> | 1970-01-12 13:46:40 +0000 |
---|---|---|
committer | Upstream <upstream-import@none> | 1970-01-12 13:46:40 +0000 |
commit | cc2ee177dbb3befca43e36cfc56778b006c3d050 (patch) | |
tree | c561d5191fe681fc92caf07156a5b2f5fe6642ba /libop/op_parse_event.h | |
download | oprofile-cc2ee177dbb3befca43e36cfc56778b006c3d050.tar.gz |
external/oprofile 0.9.1upstream/0.9.1
Diffstat (limited to 'libop/op_parse_event.h')
-rw-r--r-- | libop/op_parse_event.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/libop/op_parse_event.h b/libop/op_parse_event.h new file mode 100644 index 0000000..247a355 --- /dev/null +++ b/libop/op_parse_event.h @@ -0,0 +1,42 @@ +/** + * @file op_parse_event.h + * event parsing + * + * You can have silliness here. + * + * @remark Copyright 2002 OProfile authors + * @remark Read the file COPYING + * + * @author John Levon + * @author Philippe Elie + */ + +#ifndef OP_PARSE_EVENT_H +#define OP_PARSE_EVENT_H + +#include <stddef.h> + +struct parsed_event { + char * name; + int count; + int unit_mask; + int kernel; + int user; +}; + +/** + * @param parsed_events array of events to fill in + * @param max_events size of parsed_events + * @param events null terminated array of events string on the form + * event_name:count[:unit_mask:kernel:user] + * + * parse events given by the nil terminated array events and fill in + * parsed_events with results. Events validity are not checked except. + * A fatal error occur if number of events is greater than max_events. + * + * Return the number of events parsed. + */ +size_t parse_events(struct parsed_event * parsed_events, size_t max_events, + char const * const * events); + +#endif /* !OP_PARSE_EVENT_H */ |