diff options
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/probe-event.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index eab25d638f21..3e30be928101 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
@@ -404,7 +404,6 @@ static void show_perf_probe_event(const char *group, const char *event, | |||
404 | /* List up current perf-probe events */ | 404 | /* List up current perf-probe events */ |
405 | void show_perf_probe_events(void) | 405 | void show_perf_probe_events(void) |
406 | { | 406 | { |
407 | unsigned int i; | ||
408 | int fd, nr; | 407 | int fd, nr; |
409 | char *group, *event; | 408 | char *group, *event; |
410 | struct probe_point pp; | 409 | struct probe_point pp; |
@@ -415,8 +414,7 @@ void show_perf_probe_events(void) | |||
415 | rawlist = get_trace_kprobe_event_rawlist(fd); | 414 | rawlist = get_trace_kprobe_event_rawlist(fd); |
416 | close(fd); | 415 | close(fd); |
417 | 416 | ||
418 | for (i = 0; i < strlist__nr_entries(rawlist); i++) { | 417 | strlist__for_each(ent, rawlist) { |
419 | ent = strlist__entry(rawlist, i); | ||
420 | parse_trace_kprobe_event(ent->s, &group, &event, &pp); | 418 | parse_trace_kprobe_event(ent->s, &group, &event, &pp); |
421 | /* Synthesize only event probe point */ | 419 | /* Synthesize only event probe point */ |
422 | nr = pp.nr_args; | 420 | nr = pp.nr_args; |
@@ -436,7 +434,6 @@ void show_perf_probe_events(void) | |||
436 | /* Get current perf-probe event names */ | 434 | /* Get current perf-probe event names */ |
437 | static struct strlist *get_perf_event_names(int fd, bool include_group) | 435 | static struct strlist *get_perf_event_names(int fd, bool include_group) |
438 | { | 436 | { |
439 | unsigned int i; | ||
440 | char *group, *event; | 437 | char *group, *event; |
441 | char buf[128]; | 438 | char buf[128]; |
442 | struct strlist *sl, *rawlist; | 439 | struct strlist *sl, *rawlist; |
@@ -445,8 +442,7 @@ static struct strlist *get_perf_event_names(int fd, bool include_group) | |||
445 | rawlist = get_trace_kprobe_event_rawlist(fd); | 442 | rawlist = get_trace_kprobe_event_rawlist(fd); |
446 | 443 | ||
447 | sl = strlist__new(true, NULL); | 444 | sl = strlist__new(true, NULL); |
448 | for (i = 0; i < strlist__nr_entries(rawlist); i++) { | 445 | strlist__for_each(ent, rawlist) { |
449 | ent = strlist__entry(rawlist, i); | ||
450 | parse_trace_kprobe_event(ent->s, &group, &event, NULL); | 446 | parse_trace_kprobe_event(ent->s, &group, &event, NULL); |
451 | if (include_group) { | 447 | if (include_group) { |
452 | if (e_snprintf(buf, 128, "%s:%s", group, event) < 0) | 448 | if (e_snprintf(buf, 128, "%s:%s", group, event) < 0) |
@@ -561,7 +557,6 @@ static void del_trace_kprobe_event(int fd, const char *group, | |||
561 | void del_trace_kprobe_events(struct strlist *dellist) | 557 | void del_trace_kprobe_events(struct strlist *dellist) |
562 | { | 558 | { |
563 | int fd; | 559 | int fd; |
564 | unsigned int i; | ||
565 | const char *group, *event; | 560 | const char *group, *event; |
566 | char *p, *str; | 561 | char *p, *str; |
567 | struct str_node *ent; | 562 | struct str_node *ent; |
@@ -571,8 +566,7 @@ void del_trace_kprobe_events(struct strlist *dellist) | |||
571 | /* Get current event names */ | 566 | /* Get current event names */ |
572 | namelist = get_perf_event_names(fd, true); | 567 | namelist = get_perf_event_names(fd, true); |
573 | 568 | ||
574 | for (i = 0; i < strlist__nr_entries(dellist); i++) { | 569 | strlist__for_each(ent, dellist) { |
575 | ent = strlist__entry(dellist, i); | ||
576 | str = strdup(ent->s); | 570 | str = strdup(ent->s); |
577 | if (!str) | 571 | if (!str) |
578 | die("Failed to copy event."); | 572 | die("Failed to copy event."); |