aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-01-18 14:56:57 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-01-24 14:40:51 -0500
commit23b6339b914ec009ba206584a410039b589243aa (patch)
treea5abfabc39badf66472fed0a3034203353a7bec5
parent7c3102b843a581b4b84643a18d423f8807364ca0 (diff)
perf tools: Fix usage of __ in event parsing struct names
In tools/perf we use a convention where __ separates the struct name from the function name for functions that operate on a struct instance. Fix this usage by removing it from the struct names and fix also the associated functions. Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-kdcoh7uitivx68otqcz12aaz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/tests/parse-events.c24
-rw-r--r--tools/perf/util/parse-events.c4
-rw-r--r--tools/perf/util/parse-events.h4
-rw-r--r--tools/perf/util/parse-events.y26
4 files changed, 29 insertions, 29 deletions
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 9ac45c58305e..20acaff295d2 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -840,13 +840,13 @@ static int test__all_tracepoints(struct perf_evlist *evlist)
840 return test__checkevent_tracepoint_multi(evlist); 840 return test__checkevent_tracepoint_multi(evlist);
841} 841}
842 842
843struct test__event_st { 843struct evlist_test {
844 const char *name; 844 const char *name;
845 __u32 type; 845 __u32 type;
846 int (*check)(struct perf_evlist *evlist); 846 int (*check)(struct perf_evlist *evlist);
847}; 847};
848 848
849static struct test__event_st test__events[] = { 849static struct evlist_test test__events[] = {
850 [0] = { 850 [0] = {
851 .name = "syscalls:sys_enter_open", 851 .name = "syscalls:sys_enter_open",
852 .check = test__checkevent_tracepoint, 852 .check = test__checkevent_tracepoint,
@@ -985,7 +985,7 @@ static struct test__event_st test__events[] = {
985 }, 985 },
986}; 986};
987 987
988static struct test__event_st test__events_pmu[] = { 988static struct evlist_test test__events_pmu[] = {
989 [0] = { 989 [0] = {
990 .name = "cpu/config=10,config1,config2=3,period=1000/u", 990 .name = "cpu/config=10,config1,config2=3,period=1000/u",
991 .check = test__checkevent_pmu, 991 .check = test__checkevent_pmu,
@@ -996,20 +996,20 @@ static struct test__event_st test__events_pmu[] = {
996 }, 996 },
997}; 997};
998 998
999struct test__term { 999struct terms_test {
1000 const char *str; 1000 const char *str;
1001 __u32 type; 1001 __u32 type;
1002 int (*check)(struct list_head *terms); 1002 int (*check)(struct list_head *terms);
1003}; 1003};
1004 1004
1005static struct test__term test__terms[] = { 1005static struct terms_test test__terms[] = {
1006 [0] = { 1006 [0] = {
1007 .str = "config=10,config1,config2=3,umask=1", 1007 .str = "config=10,config1,config2=3,umask=1",
1008 .check = test__checkterms_simple, 1008 .check = test__checkterms_simple,
1009 }, 1009 },
1010}; 1010};
1011 1011
1012static int test_event(struct test__event_st *e) 1012static int test_event(struct evlist_test *e)
1013{ 1013{
1014 struct perf_evlist *evlist; 1014 struct perf_evlist *evlist;
1015 int ret; 1015 int ret;
@@ -1031,13 +1031,13 @@ static int test_event(struct test__event_st *e)
1031 return ret; 1031 return ret;
1032} 1032}
1033 1033
1034static int test_events(struct test__event_st *events, unsigned cnt) 1034static int test_events(struct evlist_test *events, unsigned cnt)
1035{ 1035{
1036 int ret1, ret2 = 0; 1036 int ret1, ret2 = 0;
1037 unsigned i; 1037 unsigned i;
1038 1038
1039 for (i = 0; i < cnt; i++) { 1039 for (i = 0; i < cnt; i++) {
1040 struct test__event_st *e = &events[i]; 1040 struct evlist_test *e = &events[i];
1041 1041
1042 pr_debug("running test %d '%s'\n", i, e->name); 1042 pr_debug("running test %d '%s'\n", i, e->name);
1043 ret1 = test_event(e); 1043 ret1 = test_event(e);
@@ -1048,7 +1048,7 @@ static int test_events(struct test__event_st *events, unsigned cnt)
1048 return ret2; 1048 return ret2;
1049} 1049}
1050 1050
1051static int test_term(struct test__term *t) 1051static int test_term(struct terms_test *t)
1052{ 1052{
1053 struct list_head *terms; 1053 struct list_head *terms;
1054 int ret; 1054 int ret;
@@ -1072,13 +1072,13 @@ static int test_term(struct test__term *t)
1072 return ret; 1072 return ret;
1073} 1073}
1074 1074
1075static int test_terms(struct test__term *terms, unsigned cnt) 1075static int test_terms(struct terms_test *terms, unsigned cnt)
1076{ 1076{
1077 int ret = 0; 1077 int ret = 0;
1078 unsigned i; 1078 unsigned i;
1079 1079
1080 for (i = 0; i < cnt; i++) { 1080 for (i = 0; i < cnt; i++) {
1081 struct test__term *t = &terms[i]; 1081 struct terms_test *t = &terms[i];
1082 1082
1083 pr_debug("running test %d '%s'\n", i, t->str); 1083 pr_debug("running test %d '%s'\n", i, t->str);
1084 ret = test_term(t); 1084 ret = test_term(t);
@@ -1129,7 +1129,7 @@ static int test_pmu_events(void)
1129 1129
1130 while (!ret && (ent = readdir(dir))) { 1130 while (!ret && (ent = readdir(dir))) {
1131#define MAX_NAME 100 1131#define MAX_NAME 100
1132 struct test__event_st e; 1132 struct evlist_test e;
1133 char name[MAX_NAME]; 1133 char name[MAX_NAME];
1134 1134
1135 if (!strcmp(ent->d_name, ".") || 1135 if (!strcmp(ent->d_name, ".") ||
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e5c0fcbe8dbe..02f6421f03a0 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -856,7 +856,7 @@ static int parse_events__scanner(const char *str, void *data, int start_token)
856 */ 856 */
857int parse_events_terms(struct list_head *terms, const char *str) 857int parse_events_terms(struct list_head *terms, const char *str)
858{ 858{
859 struct parse_events_data__terms data = { 859 struct parse_events_terms data = {
860 .terms = NULL, 860 .terms = NULL,
861 }; 861 };
862 int ret; 862 int ret;
@@ -874,7 +874,7 @@ int parse_events_terms(struct list_head *terms, const char *str)
874 874
875int parse_events(struct perf_evlist *evlist, const char *str) 875int parse_events(struct perf_evlist *evlist, const char *str)
876{ 876{
877 struct parse_events_data__events data = { 877 struct parse_events_evlist data = {
878 .list = LIST_HEAD_INIT(data.list), 878 .list = LIST_HEAD_INIT(data.list),
879 .idx = evlist->nr_entries, 879 .idx = evlist->nr_entries,
880 }; 880 };
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index dd2978e7b8c0..2cd2c42a69c5 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -61,12 +61,12 @@ struct parse_events_term {
61 struct list_head list; 61 struct list_head list;
62}; 62};
63 63
64struct parse_events_data__events { 64struct parse_events_evlist {
65 struct list_head list; 65 struct list_head list;
66 int idx; 66 int idx;
67}; 67};
68 68
69struct parse_events_data__terms { 69struct parse_events_terms {
70 struct list_head *terms; 70 struct list_head *terms;
71}; 71};
72 72
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 57ecf9db1f29..9d43c86176ff 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -79,7 +79,7 @@ PE_START_TERMS start_terms
79 79
80start_events: groups 80start_events: groups
81{ 81{
82 struct parse_events_data__events *data = _data; 82 struct parse_events_evlist *data = _data;
83 83
84 parse_events_update_lists($1, &data->list); 84 parse_events_update_lists($1, &data->list);
85} 85}
@@ -186,7 +186,7 @@ event_def: event_pmu |
186event_pmu: 186event_pmu:
187PE_NAME '/' event_config '/' 187PE_NAME '/' event_config '/'
188{ 188{
189 struct parse_events_data__events *data = _data; 189 struct parse_events_evlist *data = _data;
190 struct list_head *list = NULL; 190 struct list_head *list = NULL;
191 191
192 ABORT_ON(parse_events_add_pmu(&list, &data->idx, $1, $3)); 192 ABORT_ON(parse_events_add_pmu(&list, &data->idx, $1, $3));
@@ -202,7 +202,7 @@ PE_VALUE_SYM_SW
202event_legacy_symbol: 202event_legacy_symbol:
203value_sym '/' event_config '/' 203value_sym '/' event_config '/'
204{ 204{
205 struct parse_events_data__events *data = _data; 205 struct parse_events_evlist *data = _data;
206 struct list_head *list = NULL; 206 struct list_head *list = NULL;
207 int type = $1 >> 16; 207 int type = $1 >> 16;
208 int config = $1 & 255; 208 int config = $1 & 255;
@@ -215,7 +215,7 @@ value_sym '/' event_config '/'
215| 215|
216value_sym sep_slash_dc 216value_sym sep_slash_dc
217{ 217{
218 struct parse_events_data__events *data = _data; 218 struct parse_events_evlist *data = _data;
219 struct list_head *list = NULL; 219 struct list_head *list = NULL;
220 int type = $1 >> 16; 220 int type = $1 >> 16;
221 int config = $1 & 255; 221 int config = $1 & 255;
@@ -228,7 +228,7 @@ value_sym sep_slash_dc
228event_legacy_cache: 228event_legacy_cache:
229PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT 229PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT
230{ 230{
231 struct parse_events_data__events *data = _data; 231 struct parse_events_evlist *data = _data;
232 struct list_head *list = NULL; 232 struct list_head *list = NULL;
233 233
234 ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, $3, $5)); 234 ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, $3, $5));
@@ -237,7 +237,7 @@ PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT
237| 237|
238PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT 238PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT
239{ 239{
240 struct parse_events_data__events *data = _data; 240 struct parse_events_evlist *data = _data;
241 struct list_head *list = NULL; 241 struct list_head *list = NULL;
242 242
243 ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, $3, NULL)); 243 ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, $3, NULL));
@@ -246,7 +246,7 @@ PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT
246| 246|
247PE_NAME_CACHE_TYPE 247PE_NAME_CACHE_TYPE
248{ 248{
249 struct parse_events_data__events *data = _data; 249 struct parse_events_evlist *data = _data;
250 struct list_head *list = NULL; 250 struct list_head *list = NULL;
251 251
252 ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, NULL, NULL)); 252 ABORT_ON(parse_events_add_cache(&list, &data->idx, $1, NULL, NULL));
@@ -256,7 +256,7 @@ PE_NAME_CACHE_TYPE
256event_legacy_mem: 256event_legacy_mem:
257PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc 257PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc
258{ 258{
259 struct parse_events_data__events *data = _data; 259 struct parse_events_evlist *data = _data;
260 struct list_head *list = NULL; 260 struct list_head *list = NULL;
261 261
262 ABORT_ON(parse_events_add_breakpoint(&list, &data->idx, 262 ABORT_ON(parse_events_add_breakpoint(&list, &data->idx,
@@ -266,7 +266,7 @@ PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc
266| 266|
267PE_PREFIX_MEM PE_VALUE sep_dc 267PE_PREFIX_MEM PE_VALUE sep_dc
268{ 268{
269 struct parse_events_data__events *data = _data; 269 struct parse_events_evlist *data = _data;
270 struct list_head *list = NULL; 270 struct list_head *list = NULL;
271 271
272 ABORT_ON(parse_events_add_breakpoint(&list, &data->idx, 272 ABORT_ON(parse_events_add_breakpoint(&list, &data->idx,
@@ -277,7 +277,7 @@ PE_PREFIX_MEM PE_VALUE sep_dc
277event_legacy_tracepoint: 277event_legacy_tracepoint:
278PE_NAME ':' PE_NAME 278PE_NAME ':' PE_NAME
279{ 279{
280 struct parse_events_data__events *data = _data; 280 struct parse_events_evlist *data = _data;
281 struct list_head *list = NULL; 281 struct list_head *list = NULL;
282 282
283 ABORT_ON(parse_events_add_tracepoint(&list, &data->idx, $1, $3)); 283 ABORT_ON(parse_events_add_tracepoint(&list, &data->idx, $1, $3));
@@ -287,7 +287,7 @@ PE_NAME ':' PE_NAME
287event_legacy_numeric: 287event_legacy_numeric:
288PE_VALUE ':' PE_VALUE 288PE_VALUE ':' PE_VALUE
289{ 289{
290 struct parse_events_data__events *data = _data; 290 struct parse_events_evlist *data = _data;
291 struct list_head *list = NULL; 291 struct list_head *list = NULL;
292 292
293 ABORT_ON(parse_events_add_numeric(&list, &data->idx, (u32)$1, $3, NULL)); 293 ABORT_ON(parse_events_add_numeric(&list, &data->idx, (u32)$1, $3, NULL));
@@ -297,7 +297,7 @@ PE_VALUE ':' PE_VALUE
297event_legacy_raw: 297event_legacy_raw:
298PE_RAW 298PE_RAW
299{ 299{
300 struct parse_events_data__events *data = _data; 300 struct parse_events_evlist *data = _data;
301 struct list_head *list = NULL; 301 struct list_head *list = NULL;
302 302
303 ABORT_ON(parse_events_add_numeric(&list, &data->idx, 303 ABORT_ON(parse_events_add_numeric(&list, &data->idx,
@@ -307,7 +307,7 @@ PE_RAW
307 307
308start_terms: event_config 308start_terms: event_config
309{ 309{
310 struct parse_events_data__terms *data = _data; 310 struct parse_events_terms *data = _data;
311 data->terms = $1; 311 data->terms = $1;
312} 312}
313 313