aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-trace.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 49fedb51d569..ab3ed4af1466 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -452,7 +452,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
452 err = trace__symbols_init(trace, evlist); 452 err = trace__symbols_init(trace, evlist);
453 if (err < 0) { 453 if (err < 0) {
454 printf("Problems initializing symbol libraries!\n"); 454 printf("Problems initializing symbol libraries!\n");
455 goto out_delete_evlist; 455 goto out_delete_maps;
456 } 456 }
457 457
458 perf_evlist__config(evlist, &trace->opts); 458 perf_evlist__config(evlist, &trace->opts);
@@ -465,20 +465,20 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
465 argv, false, false); 465 argv, false, false);
466 if (err < 0) { 466 if (err < 0) {
467 printf("Couldn't run the workload!\n"); 467 printf("Couldn't run the workload!\n");
468 goto out_delete_evlist; 468 goto out_delete_maps;
469 } 469 }
470 } 470 }
471 471
472 err = perf_evlist__open(evlist); 472 err = perf_evlist__open(evlist);
473 if (err < 0) { 473 if (err < 0) {
474 printf("Couldn't create the events: %s\n", strerror(errno)); 474 printf("Couldn't create the events: %s\n", strerror(errno));
475 goto out_delete_evlist; 475 goto out_delete_maps;
476 } 476 }
477 477
478 err = perf_evlist__mmap(evlist, UINT_MAX, false); 478 err = perf_evlist__mmap(evlist, UINT_MAX, false);
479 if (err < 0) { 479 if (err < 0) {
480 printf("Couldn't mmap the events: %s\n", strerror(errno)); 480 printf("Couldn't mmap the events: %s\n", strerror(errno));
481 goto out_delete_evlist; 481 goto out_close_evlist;
482 } 482 }
483 483
484 perf_evlist__enable(evlist); 484 perf_evlist__enable(evlist);
@@ -534,7 +534,7 @@ again:
534 534
535 if (trace->nr_events == before) { 535 if (trace->nr_events == before) {
536 if (done) 536 if (done)
537 goto out_delete_evlist; 537 goto out_unmap_evlist;
538 538
539 poll(evlist->pollfd, evlist->nr_fds, -1); 539 poll(evlist->pollfd, evlist->nr_fds, -1);
540 } 540 }
@@ -544,6 +544,12 @@ again:
544 544
545 goto again; 545 goto again;
546 546
547out_unmap_evlist:
548 perf_evlist__munmap(evlist);
549out_close_evlist:
550 perf_evlist__close(evlist);
551out_delete_maps:
552 perf_evlist__delete_maps(evlist);
547out_delete_evlist: 553out_delete_evlist:
548 perf_evlist__delete(evlist); 554 perf_evlist__delete(evlist);
549out: 555out: