diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-01-18 14:29:49 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-01-24 14:40:50 -0500 |
commit | 6cee6cd310638cd5751eea0c81315b17eb7c28a9 (patch) | |
tree | 504ad5683181b588eb13e3cb5c1404fb9f62e130 /tools/perf/util | |
parent | 08aa9cce6bf3ecdfa386cf0a0be842855eac3e7d (diff) |
perf tools: Fix usage of __ in parse_events_term struct
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 parse_events_term and fix
also its 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-h6vkql4jr7dv0096f1s6hldm@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/parse-events.c | 26 | ||||
-rw-r--r-- | tools/perf/util/parse-events.h | 14 | ||||
-rw-r--r-- | tools/perf/util/parse-events.y | 38 | ||||
-rw-r--r-- | tools/perf/util/pmu.c | 12 |
4 files changed, 45 insertions, 45 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index d3bf570a7084..e5c0fcbe8dbe 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -534,7 +534,7 @@ int parse_events_add_breakpoint(struct list_head **list, int *idx, | |||
534 | } | 534 | } |
535 | 535 | ||
536 | static int config_term(struct perf_event_attr *attr, | 536 | static int config_term(struct perf_event_attr *attr, |
537 | struct parse_events__term *term) | 537 | struct parse_events_term *term) |
538 | { | 538 | { |
539 | #define CHECK_TYPE_VAL(type) \ | 539 | #define CHECK_TYPE_VAL(type) \ |
540 | do { \ | 540 | do { \ |
@@ -579,7 +579,7 @@ do { \ | |||
579 | static int config_attr(struct perf_event_attr *attr, | 579 | static int config_attr(struct perf_event_attr *attr, |
580 | struct list_head *head, int fail) | 580 | struct list_head *head, int fail) |
581 | { | 581 | { |
582 | struct parse_events__term *term; | 582 | struct parse_events_term *term; |
583 | 583 | ||
584 | list_for_each_entry(term, head, list) | 584 | list_for_each_entry(term, head, list) |
585 | if (config_term(attr, term) && fail) | 585 | if (config_term(attr, term) && fail) |
@@ -605,14 +605,14 @@ int parse_events_add_numeric(struct list_head **list, int *idx, | |||
605 | return add_event(list, idx, &attr, NULL); | 605 | return add_event(list, idx, &attr, NULL); |
606 | } | 606 | } |
607 | 607 | ||
608 | static int parse_events__is_name_term(struct parse_events__term *term) | 608 | static int parse_events__is_name_term(struct parse_events_term *term) |
609 | { | 609 | { |
610 | return term->type_term == PARSE_EVENTS__TERM_TYPE_NAME; | 610 | return term->type_term == PARSE_EVENTS__TERM_TYPE_NAME; |
611 | } | 611 | } |
612 | 612 | ||
613 | static char *pmu_event_name(struct list_head *head_terms) | 613 | static char *pmu_event_name(struct list_head *head_terms) |
614 | { | 614 | { |
615 | struct parse_events__term *term; | 615 | struct parse_events_term *term; |
616 | 616 | ||
617 | list_for_each_entry(term, head_terms, list) | 617 | list_for_each_entry(term, head_terms, list) |
618 | if (parse_events__is_name_term(term)) | 618 | if (parse_events__is_name_term(term)) |
@@ -1162,16 +1162,16 @@ void print_events(const char *event_glob, bool name_only) | |||
1162 | print_tracepoint_events(NULL, NULL, name_only); | 1162 | print_tracepoint_events(NULL, NULL, name_only); |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | int parse_events__is_hardcoded_term(struct parse_events__term *term) | 1165 | int parse_events__is_hardcoded_term(struct parse_events_term *term) |
1166 | { | 1166 | { |
1167 | return term->type_term != PARSE_EVENTS__TERM_TYPE_USER; | 1167 | return term->type_term != PARSE_EVENTS__TERM_TYPE_USER; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | static int new_term(struct parse_events__term **_term, int type_val, | 1170 | static int new_term(struct parse_events_term **_term, int type_val, |
1171 | int type_term, char *config, | 1171 | int type_term, char *config, |
1172 | char *str, u64 num) | 1172 | char *str, u64 num) |
1173 | { | 1173 | { |
1174 | struct parse_events__term *term; | 1174 | struct parse_events_term *term; |
1175 | 1175 | ||
1176 | term = zalloc(sizeof(*term)); | 1176 | term = zalloc(sizeof(*term)); |
1177 | if (!term) | 1177 | if (!term) |
@@ -1197,21 +1197,21 @@ static int new_term(struct parse_events__term **_term, int type_val, | |||
1197 | return 0; | 1197 | return 0; |
1198 | } | 1198 | } |
1199 | 1199 | ||
1200 | int parse_events__term_num(struct parse_events__term **term, | 1200 | int parse_events_term__num(struct parse_events_term **term, |
1201 | int type_term, char *config, u64 num) | 1201 | int type_term, char *config, u64 num) |
1202 | { | 1202 | { |
1203 | return new_term(term, PARSE_EVENTS__TERM_TYPE_NUM, type_term, | 1203 | return new_term(term, PARSE_EVENTS__TERM_TYPE_NUM, type_term, |
1204 | config, NULL, num); | 1204 | config, NULL, num); |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | int parse_events__term_str(struct parse_events__term **term, | 1207 | int parse_events_term__str(struct parse_events_term **term, |
1208 | int type_term, char *config, char *str) | 1208 | int type_term, char *config, char *str) |
1209 | { | 1209 | { |
1210 | return new_term(term, PARSE_EVENTS__TERM_TYPE_STR, type_term, | 1210 | return new_term(term, PARSE_EVENTS__TERM_TYPE_STR, type_term, |
1211 | config, str, 0); | 1211 | config, str, 0); |
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | int parse_events__term_sym_hw(struct parse_events__term **term, | 1214 | int parse_events_term__sym_hw(struct parse_events_term **term, |
1215 | char *config, unsigned idx) | 1215 | char *config, unsigned idx) |
1216 | { | 1216 | { |
1217 | struct event_symbol *sym; | 1217 | struct event_symbol *sym; |
@@ -1229,8 +1229,8 @@ int parse_events__term_sym_hw(struct parse_events__term **term, | |||
1229 | (char *) "event", (char *) sym->symbol, 0); | 1229 | (char *) "event", (char *) sym->symbol, 0); |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | int parse_events__term_clone(struct parse_events__term **new, | 1232 | int parse_events_term__clone(struct parse_events_term **new, |
1233 | struct parse_events__term *term) | 1233 | struct parse_events_term *term) |
1234 | { | 1234 | { |
1235 | return new_term(new, term->type_val, term->type_term, term->config, | 1235 | return new_term(new, term->type_val, term->type_term, term->config, |
1236 | term->val.str, term->val.num); | 1236 | term->val.str, term->val.num); |
@@ -1238,7 +1238,7 @@ int parse_events__term_clone(struct parse_events__term **new, | |||
1238 | 1238 | ||
1239 | void parse_events__free_terms(struct list_head *terms) | 1239 | void parse_events__free_terms(struct list_head *terms) |
1240 | { | 1240 | { |
1241 | struct parse_events__term *term, *h; | 1241 | struct parse_events_term *term, *h; |
1242 | 1242 | ||
1243 | list_for_each_entry_safe(term, h, terms, list) | 1243 | list_for_each_entry_safe(term, h, terms, list) |
1244 | free(term); | 1244 | free(term); |
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 7c5244fa0885..dd2978e7b8c0 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h | |||
@@ -50,7 +50,7 @@ enum { | |||
50 | PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE, | 50 | PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | struct parse_events__term { | 53 | struct parse_events_term { |
54 | char *config; | 54 | char *config; |
55 | union { | 55 | union { |
56 | char *str; | 56 | char *str; |
@@ -70,15 +70,15 @@ struct parse_events_data__terms { | |||
70 | struct list_head *terms; | 70 | struct list_head *terms; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | int parse_events__is_hardcoded_term(struct parse_events__term *term); | 73 | int parse_events__is_hardcoded_term(struct parse_events_term *term); |
74 | int parse_events__term_num(struct parse_events__term **_term, | 74 | int parse_events_term__num(struct parse_events_term **_term, |
75 | int type_term, char *config, u64 num); | 75 | int type_term, char *config, u64 num); |
76 | int parse_events__term_str(struct parse_events__term **_term, | 76 | int parse_events_term__str(struct parse_events_term **_term, |
77 | int type_term, char *config, char *str); | 77 | int type_term, char *config, char *str); |
78 | int parse_events__term_sym_hw(struct parse_events__term **term, | 78 | int parse_events_term__sym_hw(struct parse_events_term **term, |
79 | char *config, unsigned idx); | 79 | char *config, unsigned idx); |
80 | int parse_events__term_clone(struct parse_events__term **new, | 80 | int parse_events_term__clone(struct parse_events_term **new, |
81 | struct parse_events__term *term); | 81 | struct parse_events_term *term); |
82 | void parse_events__free_terms(struct list_head *terms); | 82 | void parse_events__free_terms(struct list_head *terms); |
83 | int parse_events__modifier_event(struct list_head *list, char *str, bool add); | 83 | int parse_events__modifier_event(struct list_head *list, char *str, bool add); |
84 | int parse_events__modifier_group(struct list_head *list, char *event_mod); | 84 | int parse_events__modifier_group(struct list_head *list, char *event_mod); |
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 0f9914ae6bac..57ecf9db1f29 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y | |||
@@ -68,7 +68,7 @@ do { \ | |||
68 | char *str; | 68 | char *str; |
69 | u64 num; | 69 | u64 num; |
70 | struct list_head *head; | 70 | struct list_head *head; |
71 | struct parse_events__term *term; | 71 | struct parse_events_term *term; |
72 | } | 72 | } |
73 | %% | 73 | %% |
74 | 74 | ||
@@ -315,7 +315,7 @@ event_config: | |||
315 | event_config ',' event_term | 315 | event_config ',' event_term |
316 | { | 316 | { |
317 | struct list_head *head = $1; | 317 | struct list_head *head = $1; |
318 | struct parse_events__term *term = $3; | 318 | struct parse_events_term *term = $3; |
319 | 319 | ||
320 | ABORT_ON(!head); | 320 | ABORT_ON(!head); |
321 | list_add_tail(&term->list, head); | 321 | list_add_tail(&term->list, head); |
@@ -325,7 +325,7 @@ event_config ',' event_term | |||
325 | event_term | 325 | event_term |
326 | { | 326 | { |
327 | struct list_head *head = malloc(sizeof(*head)); | 327 | struct list_head *head = malloc(sizeof(*head)); |
328 | struct parse_events__term *term = $1; | 328 | struct parse_events_term *term = $1; |
329 | 329 | ||
330 | ABORT_ON(!head); | 330 | ABORT_ON(!head); |
331 | INIT_LIST_HEAD(head); | 331 | INIT_LIST_HEAD(head); |
@@ -336,70 +336,70 @@ event_term | |||
336 | event_term: | 336 | event_term: |
337 | PE_NAME '=' PE_NAME | 337 | PE_NAME '=' PE_NAME |
338 | { | 338 | { |
339 | struct parse_events__term *term; | 339 | struct parse_events_term *term; |
340 | 340 | ||
341 | ABORT_ON(parse_events__term_str(&term, PARSE_EVENTS__TERM_TYPE_USER, | 341 | ABORT_ON(parse_events_term__str(&term, PARSE_EVENTS__TERM_TYPE_USER, |
342 | $1, $3)); | 342 | $1, $3)); |
343 | $$ = term; | 343 | $$ = term; |
344 | } | 344 | } |
345 | | | 345 | | |
346 | PE_NAME '=' PE_VALUE | 346 | PE_NAME '=' PE_VALUE |
347 | { | 347 | { |
348 | struct parse_events__term *term; | 348 | struct parse_events_term *term; |
349 | 349 | ||
350 | ABORT_ON(parse_events__term_num(&term, PARSE_EVENTS__TERM_TYPE_USER, | 350 | ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER, |
351 | $1, $3)); | 351 | $1, $3)); |
352 | $$ = term; | 352 | $$ = term; |
353 | } | 353 | } |
354 | | | 354 | | |
355 | PE_NAME '=' PE_VALUE_SYM_HW | 355 | PE_NAME '=' PE_VALUE_SYM_HW |
356 | { | 356 | { |
357 | struct parse_events__term *term; | 357 | struct parse_events_term *term; |
358 | int config = $3 & 255; | 358 | int config = $3 & 255; |
359 | 359 | ||
360 | ABORT_ON(parse_events__term_sym_hw(&term, $1, config)); | 360 | ABORT_ON(parse_events_term__sym_hw(&term, $1, config)); |
361 | $$ = term; | 361 | $$ = term; |
362 | } | 362 | } |
363 | | | 363 | | |
364 | PE_NAME | 364 | PE_NAME |
365 | { | 365 | { |
366 | struct parse_events__term *term; | 366 | struct parse_events_term *term; |
367 | 367 | ||
368 | ABORT_ON(parse_events__term_num(&term, PARSE_EVENTS__TERM_TYPE_USER, | 368 | ABORT_ON(parse_events_term__num(&term, PARSE_EVENTS__TERM_TYPE_USER, |
369 | $1, 1)); | 369 | $1, 1)); |
370 | $$ = term; | 370 | $$ = term; |
371 | } | 371 | } |
372 | | | 372 | | |
373 | PE_VALUE_SYM_HW | 373 | PE_VALUE_SYM_HW |
374 | { | 374 | { |
375 | struct parse_events__term *term; | 375 | struct parse_events_term *term; |
376 | int config = $1 & 255; | 376 | int config = $1 & 255; |
377 | 377 | ||
378 | ABORT_ON(parse_events__term_sym_hw(&term, NULL, config)); | 378 | ABORT_ON(parse_events_term__sym_hw(&term, NULL, config)); |
379 | $$ = term; | 379 | $$ = term; |
380 | } | 380 | } |
381 | | | 381 | | |
382 | PE_TERM '=' PE_NAME | 382 | PE_TERM '=' PE_NAME |
383 | { | 383 | { |
384 | struct parse_events__term *term; | 384 | struct parse_events_term *term; |
385 | 385 | ||
386 | ABORT_ON(parse_events__term_str(&term, (int)$1, NULL, $3)); | 386 | ABORT_ON(parse_events_term__str(&term, (int)$1, NULL, $3)); |
387 | $$ = term; | 387 | $$ = term; |
388 | } | 388 | } |
389 | | | 389 | | |
390 | PE_TERM '=' PE_VALUE | 390 | PE_TERM '=' PE_VALUE |
391 | { | 391 | { |
392 | struct parse_events__term *term; | 392 | struct parse_events_term *term; |
393 | 393 | ||
394 | ABORT_ON(parse_events__term_num(&term, (int)$1, NULL, $3)); | 394 | ABORT_ON(parse_events_term__num(&term, (int)$1, NULL, $3)); |
395 | $$ = term; | 395 | $$ = term; |
396 | } | 396 | } |
397 | | | 397 | | |
398 | PE_TERM | 398 | PE_TERM |
399 | { | 399 | { |
400 | struct parse_events__term *term; | 400 | struct parse_events_term *term; |
401 | 401 | ||
402 | ABORT_ON(parse_events__term_num(&term, (int)$1, NULL, 1)); | 402 | ABORT_ON(parse_events_term__num(&term, (int)$1, NULL, 1)); |
403 | $$ = term; | 403 | $$ = term; |
404 | } | 404 | } |
405 | 405 | ||
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index b93ff146766e..c107e24b75f8 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
@@ -175,12 +175,12 @@ static int pmu_aliases(char *name, struct list_head *head) | |||
175 | static int pmu_alias_terms(struct perf_pmu__alias *alias, | 175 | static int pmu_alias_terms(struct perf_pmu__alias *alias, |
176 | struct list_head *terms) | 176 | struct list_head *terms) |
177 | { | 177 | { |
178 | struct parse_events__term *term, *clone; | 178 | struct parse_events_term *term, *clone; |
179 | LIST_HEAD(list); | 179 | LIST_HEAD(list); |
180 | int ret; | 180 | int ret; |
181 | 181 | ||
182 | list_for_each_entry(term, &alias->terms, list) { | 182 | list_for_each_entry(term, &alias->terms, list) { |
183 | ret = parse_events__term_clone(&clone, term); | 183 | ret = parse_events_term__clone(&clone, term); |
184 | if (ret) { | 184 | if (ret) { |
185 | parse_events__free_terms(&list); | 185 | parse_events__free_terms(&list); |
186 | return ret; | 186 | return ret; |
@@ -403,7 +403,7 @@ static __u64 pmu_format_value(unsigned long *format, __u64 value) | |||
403 | */ | 403 | */ |
404 | static int pmu_config_term(struct list_head *formats, | 404 | static int pmu_config_term(struct list_head *formats, |
405 | struct perf_event_attr *attr, | 405 | struct perf_event_attr *attr, |
406 | struct parse_events__term *term) | 406 | struct parse_events_term *term) |
407 | { | 407 | { |
408 | struct perf_pmu__format *format; | 408 | struct perf_pmu__format *format; |
409 | __u64 *vp; | 409 | __u64 *vp; |
@@ -450,7 +450,7 @@ int perf_pmu__config_terms(struct list_head *formats, | |||
450 | struct perf_event_attr *attr, | 450 | struct perf_event_attr *attr, |
451 | struct list_head *head_terms) | 451 | struct list_head *head_terms) |
452 | { | 452 | { |
453 | struct parse_events__term *term; | 453 | struct parse_events_term *term; |
454 | 454 | ||
455 | list_for_each_entry(term, head_terms, list) | 455 | list_for_each_entry(term, head_terms, list) |
456 | if (pmu_config_term(formats, attr, term)) | 456 | if (pmu_config_term(formats, attr, term)) |
@@ -472,7 +472,7 @@ int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, | |||
472 | } | 472 | } |
473 | 473 | ||
474 | static struct perf_pmu__alias *pmu_find_alias(struct perf_pmu *pmu, | 474 | static struct perf_pmu__alias *pmu_find_alias(struct perf_pmu *pmu, |
475 | struct parse_events__term *term) | 475 | struct parse_events_term *term) |
476 | { | 476 | { |
477 | struct perf_pmu__alias *alias; | 477 | struct perf_pmu__alias *alias; |
478 | char *name; | 478 | char *name; |
@@ -507,7 +507,7 @@ static struct perf_pmu__alias *pmu_find_alias(struct perf_pmu *pmu, | |||
507 | */ | 507 | */ |
508 | int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms) | 508 | int perf_pmu__check_alias(struct perf_pmu *pmu, struct list_head *head_terms) |
509 | { | 509 | { |
510 | struct parse_events__term *term, *h; | 510 | struct parse_events_term *term, *h; |
511 | struct perf_pmu__alias *alias; | 511 | struct perf_pmu__alias *alias; |
512 | int ret; | 512 | int ret; |
513 | 513 | ||