1 #include "../../../include/linux/hw_breakpoint.h"
6 #include "parse-options.h"
7 #include "parse-events.h"
14 #include "parse-events-flex.h"
17 #define MAX_NAME_LEN 100
27 extern int parse_events_debug;
29 int parse_events_parse(struct list_head *list, int *idx);
31 #define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x
32 #define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
34 static struct event_symbol event_symbols[] = {
35 { CHW(CPU_CYCLES), "cpu-cycles", "cycles" },
36 { CHW(STALLED_CYCLES_FRONTEND), "stalled-cycles-frontend", "idle-cycles-frontend" },
37 { CHW(STALLED_CYCLES_BACKEND), "stalled-cycles-backend", "idle-cycles-backend" },
38 { CHW(INSTRUCTIONS), "instructions", "" },
39 { CHW(CACHE_REFERENCES), "cache-references", "" },
40 { CHW(CACHE_MISSES), "cache-misses", "" },
41 { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", "branches" },
42 { CHW(BRANCH_MISSES), "branch-misses", "" },
43 { CHW(BUS_CYCLES), "bus-cycles", "" },
44 { CHW(REF_CPU_CYCLES), "ref-cycles", "" },
46 { CSW(CPU_CLOCK), "cpu-clock", "" },
47 { CSW(TASK_CLOCK), "task-clock", "" },
48 { CSW(PAGE_FAULTS), "page-faults", "faults" },
49 { CSW(PAGE_FAULTS_MIN), "minor-faults", "" },
50 { CSW(PAGE_FAULTS_MAJ), "major-faults", "" },
51 { CSW(CONTEXT_SWITCHES), "context-switches", "cs" },
52 { CSW(CPU_MIGRATIONS), "cpu-migrations", "migrations" },
53 { CSW(ALIGNMENT_FAULTS), "alignment-faults", "" },
54 { CSW(EMULATION_FAULTS), "emulation-faults", "" },
57 #define __PERF_EVENT_FIELD(config, name) \
58 ((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT)
60 #define PERF_EVENT_RAW(config) __PERF_EVENT_FIELD(config, RAW)
61 #define PERF_EVENT_CONFIG(config) __PERF_EVENT_FIELD(config, CONFIG)
62 #define PERF_EVENT_TYPE(config) __PERF_EVENT_FIELD(config, TYPE)
63 #define PERF_EVENT_ID(config) __PERF_EVENT_FIELD(config, EVENT)
65 static const char *sw_event_names[PERF_COUNT_SW_MAX] = {
77 #define for_each_subsystem(sys_dir, sys_dirent, sys_next) \
78 while (!readdir_r(sys_dir, &sys_dirent, &sys_next) && sys_next) \
79 if (sys_dirent.d_type == DT_DIR && \
80 (strcmp(sys_dirent.d_name, ".")) && \
81 (strcmp(sys_dirent.d_name, "..")))
83 static int tp_event_has_id(struct dirent *sys_dir, struct dirent *evt_dir)
85 char evt_path[MAXPATHLEN];
88 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", tracing_events_path,
89 sys_dir->d_name, evt_dir->d_name);
90 fd = open(evt_path, O_RDONLY);
98 #define for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) \
99 while (!readdir_r(evt_dir, &evt_dirent, &evt_next) && evt_next) \
100 if (evt_dirent.d_type == DT_DIR && \
101 (strcmp(evt_dirent.d_name, ".")) && \
102 (strcmp(evt_dirent.d_name, "..")) && \
103 (!tp_event_has_id(&sys_dirent, &evt_dirent)))
105 #define MAX_EVENT_LENGTH 512
108 struct tracepoint_path *tracepoint_id_to_path(u64 config)
110 struct tracepoint_path *path = NULL;
111 DIR *sys_dir, *evt_dir;
112 struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
116 char evt_path[MAXPATHLEN];
117 char dir_path[MAXPATHLEN];
119 if (debugfs_valid_mountpoint(tracing_events_path))
122 sys_dir = opendir(tracing_events_path);
126 for_each_subsystem(sys_dir, sys_dirent, sys_next) {
128 snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
130 evt_dir = opendir(dir_path);
134 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) {
136 snprintf(evt_path, MAXPATHLEN, "%s/%s/id", dir_path,
138 fd = open(evt_path, O_RDONLY);
141 if (read(fd, id_buf, sizeof(id_buf)) < 0) {
150 path = zalloc(sizeof(*path));
151 path->system = malloc(MAX_EVENT_LENGTH);
156 path->name = malloc(MAX_EVENT_LENGTH);
162 strncpy(path->system, sys_dirent.d_name,
164 strncpy(path->name, evt_dirent.d_name,
176 #define TP_PATH_LEN (MAX_EVENT_LENGTH * 2 + 1)
177 static const char *tracepoint_id_to_name(u64 config)
179 static char buf[TP_PATH_LEN];
180 struct tracepoint_path *path;
182 path = tracepoint_id_to_path(config);
184 snprintf(buf, TP_PATH_LEN, "%s:%s", path->system, path->name);
189 snprintf(buf, TP_PATH_LEN, "%s:%s", "unknown", "unknown");
194 const char *event_type(int type)
197 case PERF_TYPE_HARDWARE:
200 case PERF_TYPE_SOFTWARE:
203 case PERF_TYPE_TRACEPOINT:
206 case PERF_TYPE_HW_CACHE:
207 return "hardware-cache";
216 const char *event_name(struct perf_evsel *evsel)
218 u64 config = evsel->attr.config;
219 int type = evsel->attr.type;
221 if (type == PERF_TYPE_RAW || type == PERF_TYPE_HARDWARE || type == PERF_TYPE_HW_CACHE) {
223 * XXX minimal fix, see comment on perf_evsen__name, this static buffer
224 * will go away together with event_name in the next devel cycle.
227 perf_evsel__name(evsel, bf, sizeof(bf));
234 return __event_name(type, config);
237 const char *__event_name(int type, u64 config)
241 if (type == PERF_TYPE_RAW) {
242 sprintf(buf, "raw 0x%" PRIx64, config);
247 case PERF_TYPE_HARDWARE:
248 return __perf_evsel__hw_name(config);
250 case PERF_TYPE_HW_CACHE:
251 __perf_evsel__hw_cache_name(config, buf, sizeof(buf));
254 case PERF_TYPE_SOFTWARE:
255 if (config < PERF_COUNT_SW_MAX && sw_event_names[config])
256 return sw_event_names[config];
257 return "unknown-software";
259 case PERF_TYPE_TRACEPOINT:
260 return tracepoint_id_to_name(config);
269 static int add_event(struct list_head **_list, int *idx,
270 struct perf_event_attr *attr, char *name)
272 struct perf_evsel *evsel;
273 struct list_head *list = *_list;
276 list = malloc(sizeof(*list));
279 INIT_LIST_HEAD(list);
282 event_attr_init(attr);
284 evsel = perf_evsel__new(attr, (*idx)++);
290 evsel->name = strdup(name);
291 list_add_tail(&evsel->node, list);
296 static int parse_aliases(char *str, const char *names[][PERF_EVSEL__MAX_ALIASES], int size)
301 for (i = 0; i < size; i++) {
302 for (j = 0; j < PERF_EVSEL__MAX_ALIASES && names[i][j]; j++) {
303 n = strlen(names[i][j]);
304 if (n > longest && !strncasecmp(str, names[i][j], n))
314 int parse_events_add_cache(struct list_head **list, int *idx,
315 char *type, char *op_result1, char *op_result2)
317 struct perf_event_attr attr;
318 char name[MAX_NAME_LEN];
319 int cache_type = -1, cache_op = -1, cache_result = -1;
320 char *op_result[2] = { op_result1, op_result2 };
324 * No fallback - if we cannot get a clear cache type
327 cache_type = parse_aliases(type, perf_evsel__hw_cache,
328 PERF_COUNT_HW_CACHE_MAX);
329 if (cache_type == -1)
332 n = snprintf(name, MAX_NAME_LEN, "%s", type);
334 for (i = 0; (i < 2) && (op_result[i]); i++) {
335 char *str = op_result[i];
337 snprintf(name + n, MAX_NAME_LEN - n, "-%s\n", str);
339 if (cache_op == -1) {
340 cache_op = parse_aliases(str, perf_evsel__hw_cache_op,
341 PERF_COUNT_HW_CACHE_OP_MAX);
343 if (!perf_evsel__is_cache_op_valid(cache_type, cache_op))
349 if (cache_result == -1) {
350 cache_result = parse_aliases(str, perf_evsel__hw_cache_result,
351 PERF_COUNT_HW_CACHE_RESULT_MAX);
352 if (cache_result >= 0)
358 * Fall back to reads:
361 cache_op = PERF_COUNT_HW_CACHE_OP_READ;
364 * Fall back to accesses:
366 if (cache_result == -1)
367 cache_result = PERF_COUNT_HW_CACHE_RESULT_ACCESS;
369 memset(&attr, 0, sizeof(attr));
370 attr.config = cache_type | (cache_op << 8) | (cache_result << 16);
371 attr.type = PERF_TYPE_HW_CACHE;
372 return add_event(list, idx, &attr, name);
375 static int add_tracepoint(struct list_head **list, int *idx,
376 char *sys_name, char *evt_name)
378 struct perf_event_attr attr;
379 char name[MAX_NAME_LEN];
380 char evt_path[MAXPATHLEN];
385 snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", tracing_events_path,
388 fd = open(evt_path, O_RDONLY);
392 if (read(fd, id_buf, sizeof(id_buf)) < 0) {
400 memset(&attr, 0, sizeof(attr));
402 attr.type = PERF_TYPE_TRACEPOINT;
403 attr.sample_type |= PERF_SAMPLE_RAW;
404 attr.sample_type |= PERF_SAMPLE_TIME;
405 attr.sample_type |= PERF_SAMPLE_CPU;
406 attr.sample_period = 1;
408 snprintf(name, MAX_NAME_LEN, "%s:%s", sys_name, evt_name);
409 return add_event(list, idx, &attr, name);
412 static int add_tracepoint_multi(struct list_head **list, int *idx,
413 char *sys_name, char *evt_name)
415 char evt_path[MAXPATHLEN];
416 struct dirent *evt_ent;
420 snprintf(evt_path, MAXPATHLEN, "%s/%s", tracing_events_path, sys_name);
421 evt_dir = opendir(evt_path);
423 perror("Can't open event dir");
427 while (!ret && (evt_ent = readdir(evt_dir))) {
428 if (!strcmp(evt_ent->d_name, ".")
429 || !strcmp(evt_ent->d_name, "..")
430 || !strcmp(evt_ent->d_name, "enable")
431 || !strcmp(evt_ent->d_name, "filter"))
434 if (!strglobmatch(evt_ent->d_name, evt_name))
437 ret = add_tracepoint(list, idx, sys_name, evt_ent->d_name);
443 int parse_events_add_tracepoint(struct list_head **list, int *idx,
444 char *sys, char *event)
448 ret = debugfs_valid_mountpoint(tracing_events_path);
452 return strpbrk(event, "*?") ?
453 add_tracepoint_multi(list, idx, sys, event) :
454 add_tracepoint(list, idx, sys, event);
458 parse_breakpoint_type(const char *type, struct perf_event_attr *attr)
462 for (i = 0; i < 3; i++) {
463 if (!type || !type[i])
468 attr->bp_type |= HW_BREAKPOINT_R;
471 attr->bp_type |= HW_BREAKPOINT_W;
474 attr->bp_type |= HW_BREAKPOINT_X;
481 if (!attr->bp_type) /* Default */
482 attr->bp_type = HW_BREAKPOINT_R | HW_BREAKPOINT_W;
487 int parse_events_add_breakpoint(struct list_head **list, int *idx,
488 void *ptr, char *type)
490 struct perf_event_attr attr;
491 char name[MAX_NAME_LEN];
493 memset(&attr, 0, sizeof(attr));
494 attr.bp_addr = (unsigned long) ptr;
496 if (parse_breakpoint_type(type, &attr))
500 * We should find a nice way to override the access length
501 * Provide some defaults for now
503 if (attr.bp_type == HW_BREAKPOINT_X)
504 attr.bp_len = sizeof(long);
506 attr.bp_len = HW_BREAKPOINT_LEN_4;
508 attr.type = PERF_TYPE_BREAKPOINT;
510 snprintf(name, MAX_NAME_LEN, "mem:%p:%s", ptr, type ? type : "rw");
511 return add_event(list, idx, &attr, name);
514 static int config_term(struct perf_event_attr *attr,
515 struct parse_events__term *term)
517 #define CHECK_TYPE_VAL(type) \
519 if (PARSE_EVENTS__TERM_TYPE_ ## type != term->type_val) \
523 switch (term->type_term) {
524 case PARSE_EVENTS__TERM_TYPE_CONFIG:
526 attr->config = term->val.num;
528 case PARSE_EVENTS__TERM_TYPE_CONFIG1:
530 attr->config1 = term->val.num;
532 case PARSE_EVENTS__TERM_TYPE_CONFIG2:
534 attr->config2 = term->val.num;
536 case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD:
538 attr->sample_period = term->val.num;
540 case PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE:
542 * TODO uncomment when the field is available
543 * attr->branch_sample_type = term->val.num;
546 case PARSE_EVENTS__TERM_TYPE_NAME:
554 #undef CHECK_TYPE_VAL
557 static int config_attr(struct perf_event_attr *attr,
558 struct list_head *head, int fail)
560 struct parse_events__term *term;
562 list_for_each_entry(term, head, list)
563 if (config_term(attr, term) && fail)
569 int parse_events_add_numeric(struct list_head **list, int *idx,
570 unsigned long type, unsigned long config,
571 struct list_head *head_config)
573 struct perf_event_attr attr;
575 memset(&attr, 0, sizeof(attr));
577 attr.config = config;
580 config_attr(&attr, head_config, 1))
583 return add_event(list, idx, &attr,
584 (char *) __event_name(type, config));
587 static int parse_events__is_name_term(struct parse_events__term *term)
589 return term->type_term == PARSE_EVENTS__TERM_TYPE_NAME;
592 static char *pmu_event_name(struct perf_event_attr *attr,
593 struct list_head *head_terms)
595 struct parse_events__term *term;
597 list_for_each_entry(term, head_terms, list)
598 if (parse_events__is_name_term(term))
599 return term->val.str;
601 return (char *) __event_name(PERF_TYPE_RAW, attr->config);
604 int parse_events_add_pmu(struct list_head **list, int *idx,
605 char *name, struct list_head *head_config)
607 struct perf_event_attr attr;
608 struct perf_pmu *pmu;
610 pmu = perf_pmu__find(name);
614 memset(&attr, 0, sizeof(attr));
617 * Configure hardcoded terms first, no need to check
618 * return value when called with fail == 0 ;)
620 config_attr(&attr, head_config, 0);
622 if (perf_pmu__config(pmu, &attr, head_config))
625 return add_event(list, idx, &attr,
626 pmu_event_name(&attr, head_config));
629 void parse_events_update_lists(struct list_head *list_event,
630 struct list_head *list_all)
633 * Called for single event definition. Update the
634 * 'all event' list, and reinit the 'signle event'
635 * list, for next event definition.
637 list_splice_tail(list_event, list_all);
641 int parse_events_modifier(struct list_head *list, char *str)
643 struct perf_evsel *evsel;
644 int exclude = 0, exclude_GH = 0;
645 int eu = 0, ek = 0, eh = 0, eH = 0, eG = 0, precise = 0;
653 exclude = eu = ek = eh = 1;
655 } else if (*str == 'k') {
657 exclude = eu = ek = eh = 1;
659 } else if (*str == 'h') {
661 exclude = eu = ek = eh = 1;
663 } else if (*str == 'G') {
665 exclude_GH = eG = eH = 1;
667 } else if (*str == 'H') {
669 exclude_GH = eG = eH = 1;
671 } else if (*str == 'p') {
682 * 0 - SAMPLE_IP can have arbitrary skid
683 * 1 - SAMPLE_IP must have constant skid
684 * 2 - SAMPLE_IP requested to have 0 skid
685 * 3 - SAMPLE_IP must have 0 skid
687 * See also PERF_RECORD_MISC_EXACT_IP
692 list_for_each_entry(evsel, list, node) {
693 evsel->attr.exclude_user = eu;
694 evsel->attr.exclude_kernel = ek;
695 evsel->attr.exclude_hv = eh;
696 evsel->attr.precise_ip = precise;
697 evsel->attr.exclude_host = eH;
698 evsel->attr.exclude_guest = eG;
704 int parse_events(struct perf_evlist *evlist, const char *str, int unset __used)
708 YY_BUFFER_STATE buffer;
709 int ret, idx = evlist->nr_entries;
711 buffer = parse_events__scan_string(str);
714 parse_events_debug = 1;
716 ret = parse_events_parse(&list, &idx);
718 parse_events__flush_buffer(buffer);
719 parse_events__delete_buffer(buffer);
720 parse_events_lex_destroy();
723 int entries = idx - evlist->nr_entries;
724 perf_evlist__splice_list_tail(evlist, &list, entries);
729 * There are 2 users - builtin-record and builtin-test objects.
730 * Both call perf_evlist__delete in case of error, so we dont
733 fprintf(stderr, "invalid or unsupported event: '%s'\n", str);
734 fprintf(stderr, "Run 'perf list' for a list of valid events\n");
738 int parse_events_option(const struct option *opt, const char *str,
741 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value;
742 return parse_events(evlist, str, unset);
745 int parse_filter(const struct option *opt, const char *str,
748 struct perf_evlist *evlist = *(struct perf_evlist **)opt->value;
749 struct perf_evsel *last = NULL;
751 if (evlist->nr_entries > 0)
752 last = list_entry(evlist->entries.prev, struct perf_evsel, node);
754 if (last == NULL || last->attr.type != PERF_TYPE_TRACEPOINT) {
756 "-F option should follow a -e tracepoint option\n");
760 last->filter = strdup(str);
761 if (last->filter == NULL) {
762 fprintf(stderr, "not enough memory to hold filter string\n");
769 static const char * const event_type_descriptors[] = {
773 "Hardware cache event",
774 "Raw hardware event descriptor",
775 "Hardware breakpoint",
779 * Print the events from <debugfs_mount_point>/tracing/events
782 void print_tracepoint_events(const char *subsys_glob, const char *event_glob)
784 DIR *sys_dir, *evt_dir;
785 struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
786 char evt_path[MAXPATHLEN];
787 char dir_path[MAXPATHLEN];
789 if (debugfs_valid_mountpoint(tracing_events_path))
792 sys_dir = opendir(tracing_events_path);
796 for_each_subsystem(sys_dir, sys_dirent, sys_next) {
797 if (subsys_glob != NULL &&
798 !strglobmatch(sys_dirent.d_name, subsys_glob))
801 snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
803 evt_dir = opendir(dir_path);
807 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) {
808 if (event_glob != NULL &&
809 !strglobmatch(evt_dirent.d_name, event_glob))
812 snprintf(evt_path, MAXPATHLEN, "%s:%s",
813 sys_dirent.d_name, evt_dirent.d_name);
814 printf(" %-50s [%s]\n", evt_path,
815 event_type_descriptors[PERF_TYPE_TRACEPOINT]);
823 * Check whether event is in <debugfs_mount_point>/tracing/events
826 int is_valid_tracepoint(const char *event_string)
828 DIR *sys_dir, *evt_dir;
829 struct dirent *sys_next, *evt_next, sys_dirent, evt_dirent;
830 char evt_path[MAXPATHLEN];
831 char dir_path[MAXPATHLEN];
833 if (debugfs_valid_mountpoint(tracing_events_path))
836 sys_dir = opendir(tracing_events_path);
840 for_each_subsystem(sys_dir, sys_dirent, sys_next) {
842 snprintf(dir_path, MAXPATHLEN, "%s/%s", tracing_events_path,
844 evt_dir = opendir(dir_path);
848 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) {
849 snprintf(evt_path, MAXPATHLEN, "%s:%s",
850 sys_dirent.d_name, evt_dirent.d_name);
851 if (!strcmp(evt_path, event_string)) {
863 void print_events_type(u8 type)
865 struct event_symbol *syms = event_symbols;
869 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
870 if (type != syms->type)
873 if (strlen(syms->alias))
874 snprintf(name, sizeof(name), "%s OR %s",
875 syms->symbol, syms->alias);
877 snprintf(name, sizeof(name), "%s", syms->symbol);
879 printf(" %-50s [%s]\n", name,
880 event_type_descriptors[type]);
884 int print_hwcache_events(const char *event_glob)
886 unsigned int type, op, i, printed = 0;
889 for (type = 0; type < PERF_COUNT_HW_CACHE_MAX; type++) {
890 for (op = 0; op < PERF_COUNT_HW_CACHE_OP_MAX; op++) {
891 /* skip invalid cache type */
892 if (!perf_evsel__is_cache_op_valid(type, op))
895 for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) {
896 __perf_evsel__hw_cache_type_op_res_name(type, op, i,
898 if (event_glob != NULL && !strglobmatch(name, event_glob))
901 printf(" %-50s [%s]\n", name,
902 event_type_descriptors[PERF_TYPE_HW_CACHE]);
912 * Print the help text for the event symbols:
914 void print_events(const char *event_glob)
916 unsigned int i, type, prev_type = -1, printed = 0, ntypes_printed = 0;
917 struct event_symbol *syms = event_symbols;
918 char name[MAX_NAME_LEN];
921 printf("List of pre-defined events (to be used in -e):\n");
923 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
926 if (type != prev_type && printed) {
932 if (event_glob != NULL &&
933 !(strglobmatch(syms->symbol, event_glob) ||
934 (syms->alias && strglobmatch(syms->alias, event_glob))))
937 if (strlen(syms->alias))
938 snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias);
940 strncpy(name, syms->symbol, MAX_NAME_LEN);
941 printf(" %-50s [%s]\n", name,
942 event_type_descriptors[type]);
948 if (ntypes_printed) {
952 print_hwcache_events(event_glob);
954 if (event_glob != NULL)
958 printf(" %-50s [%s]\n",
960 event_type_descriptors[PERF_TYPE_RAW]);
961 printf(" %-50s [%s]\n",
962 "cpu/t1=v1[,t2=v2,t3 ...]/modifier",
963 event_type_descriptors[PERF_TYPE_RAW]);
964 printf(" (see 'perf list --help' on how to encode it)\n");
967 printf(" %-50s [%s]\n",
968 "mem:<addr>[:access]",
969 event_type_descriptors[PERF_TYPE_BREAKPOINT]);
972 print_tracepoint_events(NULL, NULL);
975 int parse_events__is_hardcoded_term(struct parse_events__term *term)
977 return term->type_term != PARSE_EVENTS__TERM_TYPE_USER;
980 static int new_term(struct parse_events__term **_term, int type_val,
981 int type_term, char *config,
984 struct parse_events__term *term;
986 term = zalloc(sizeof(*term));
990 INIT_LIST_HEAD(&term->list);
991 term->type_val = type_val;
992 term->type_term = type_term;
993 term->config = config;
996 case PARSE_EVENTS__TERM_TYPE_NUM:
999 case PARSE_EVENTS__TERM_TYPE_STR:
1000 term->val.str = str;
1010 int parse_events__term_num(struct parse_events__term **term,
1011 int type_term, char *config, long num)
1013 return new_term(term, PARSE_EVENTS__TERM_TYPE_NUM, type_term,
1017 int parse_events__term_str(struct parse_events__term **term,
1018 int type_term, char *config, char *str)
1020 return new_term(term, PARSE_EVENTS__TERM_TYPE_STR, type_term,
1024 void parse_events__free_terms(struct list_head *terms)
1026 struct parse_events__term *term, *h;
1028 list_for_each_entry_safe(term, h, terms, list)