aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/parse-events.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index d3086cecd2dd..cf082daa43e3 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -446,8 +446,8 @@ parse_single_tracepoint_event(char *sys_name,
446/* sys + ':' + event + ':' + flags*/ 446/* sys + ':' + event + ':' + flags*/
447#define MAX_EVOPT_LEN (MAX_EVENT_LENGTH * 2 + 2 + 128) 447#define MAX_EVOPT_LEN (MAX_EVENT_LENGTH * 2 + 2 + 128)
448static enum event_result 448static enum event_result
449parse_multiple_tracepoint_event(char *sys_name, const char *evt_exp, 449parse_multiple_tracepoint_event(const struct option *opt, char *sys_name,
450 char *flags) 450 const char *evt_exp, char *flags)
451{ 451{
452 char evt_path[MAXPATHLEN]; 452 char evt_path[MAXPATHLEN];
453 struct dirent *evt_ent; 453 struct dirent *evt_ent;
@@ -480,15 +480,16 @@ parse_multiple_tracepoint_event(char *sys_name, const char *evt_exp,
480 if (len < 0) 480 if (len < 0)
481 return EVT_FAILED; 481 return EVT_FAILED;
482 482
483 if (parse_events(NULL, event_opt, 0)) 483 if (parse_events(opt, event_opt, 0))
484 return EVT_FAILED; 484 return EVT_FAILED;
485 } 485 }
486 486
487 return EVT_HANDLED_ALL; 487 return EVT_HANDLED_ALL;
488} 488}
489 489
490static enum event_result parse_tracepoint_event(const char **strp, 490static enum event_result
491 struct perf_event_attr *attr) 491parse_tracepoint_event(const struct option *opt, const char **strp,
492 struct perf_event_attr *attr)
492{ 493{
493 const char *evt_name; 494 const char *evt_name;
494 char *flags = NULL, *comma_loc; 495 char *flags = NULL, *comma_loc;
@@ -527,7 +528,7 @@ static enum event_result parse_tracepoint_event(const char **strp,
527 return EVT_FAILED; 528 return EVT_FAILED;
528 if (strpbrk(evt_name, "*?")) { 529 if (strpbrk(evt_name, "*?")) {
529 *strp += strlen(sys_name) + evt_length + 1; /* 1 == the ':' */ 530 *strp += strlen(sys_name) + evt_length + 1; /* 1 == the ':' */
530 return parse_multiple_tracepoint_event(sys_name, evt_name, 531 return parse_multiple_tracepoint_event(opt, sys_name, evt_name,
531 flags); 532 flags);
532 } else { 533 } else {
533 return parse_single_tracepoint_event(sys_name, evt_name, 534 return parse_single_tracepoint_event(sys_name, evt_name,
@@ -737,11 +738,12 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr)
737 * Symbolic names are (almost) exactly matched. 738 * Symbolic names are (almost) exactly matched.
738 */ 739 */
739static enum event_result 740static enum event_result
740parse_event_symbols(const char **str, struct perf_event_attr *attr) 741parse_event_symbols(const struct option *opt, const char **str,
742 struct perf_event_attr *attr)
741{ 743{
742 enum event_result ret; 744 enum event_result ret;
743 745
744 ret = parse_tracepoint_event(str, attr); 746 ret = parse_tracepoint_event(opt, str, attr);
745 if (ret != EVT_FAILED) 747 if (ret != EVT_FAILED)
746 goto modifier; 748 goto modifier;
747 749
@@ -783,7 +785,7 @@ int parse_events(const struct option *opt, const char *str, int unset __used)
783 785
784 for (;;) { 786 for (;;) {
785 memset(&attr, 0, sizeof(attr)); 787 memset(&attr, 0, sizeof(attr));
786 ret = parse_event_symbols(&str, &attr); 788 ret = parse_event_symbols(opt, &str, &attr);
787 if (ret == EVT_FAILED) 789 if (ret == EVT_FAILED)
788 return -1; 790 return -1;
789 791