aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/parse-events.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r--tools/perf/util/parse-events.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index d76aa30cb1fb..c5642e6748b2 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -6,7 +6,7 @@
6#include "parse-options.h" 6#include "parse-options.h"
7#include "parse-events.h" 7#include "parse-events.h"
8#include "exec_cmd.h" 8#include "exec_cmd.h"
9#include "linux/string.h" 9#include "string.h"
10#include "symbol.h" 10#include "symbol.h"
11#include "cache.h" 11#include "cache.h"
12#include "header.h" 12#include "header.h"
@@ -863,32 +863,6 @@ int parse_events_name(struct list_head *list, char *name)
863 return 0; 863 return 0;
864} 864}
865 865
866static int parse_events__scanner(const char *str, void *data, int start_token);
867
868static int parse_events_fixup(int ret, const char *str, void *data,
869 int start_token)
870{
871 char *o = strdup(str);
872 char *s = NULL;
873 char *t = o;
874 char *p;
875 int len = 0;
876
877 if (!o)
878 return ret;
879 while ((p = strsep(&t, ",")) != NULL) {
880 if (s)
881 str_append(&s, &len, ",");
882 str_append(&s, &len, "cpu/");
883 str_append(&s, &len, p);
884 str_append(&s, &len, "/");
885 }
886 free(o);
887 if (!s)
888 return -ENOMEM;
889 return parse_events__scanner(s, data, start_token);
890}
891
892static int parse_events__scanner(const char *str, void *data, int start_token) 866static int parse_events__scanner(const char *str, void *data, int start_token)
893{ 867{
894 YY_BUFFER_STATE buffer; 868 YY_BUFFER_STATE buffer;
@@ -909,8 +883,6 @@ static int parse_events__scanner(const char *str, void *data, int start_token)
909 parse_events__flush_buffer(buffer, scanner); 883 parse_events__flush_buffer(buffer, scanner);
910 parse_events__delete_buffer(buffer, scanner); 884 parse_events__delete_buffer(buffer, scanner);
911 parse_events_lex_destroy(scanner); 885 parse_events_lex_destroy(scanner);
912 if (ret && !strchr(str, '/'))
913 ret = parse_events_fixup(ret, str, data, start_token);
914 return ret; 886 return ret;
915} 887}
916 888