Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1430196

[PATCH 11/27] perf tests time-to-tsc: No need to disable an event before deleting it

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 11/27] perf tests time-to-tsc: No need to disable an event before deleting it
Date 2016-06-23 23:40 +0200
Message-ID <rNkvT-7uA-13@gated-at.bofh.it> (permalink)
References <rNkmd-7qp-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnaldo Carvalho de Melo <acme@redhat.com>

Because at the destructor we will call close() and that will do the
disable. And we destructors can accept NULL, just like free(), so no
need to check it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-i98mcyfkkjh5qp62dle27ac1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/tests/perf-time-to-tsc.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
index d4aa567a29c4..5c76cc83186a 100644
--- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c
+++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
@@ -154,10 +154,6 @@ next_event:
 	err = 0;
 
 out_err:
-	if (evlist) {
-		perf_evlist__disable(evlist);
-		perf_evlist__delete(evlist);
-	}
-
+	perf_evlist__delete(evlist);
 	return err;
 }
-- 
2.5.5

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/27] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:30 +0200
  [PATCH 26/27] perf config: Introduce new init() and exit() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:30 +0200
  [PATCH 23/27] perf script: Print sample flags more nicely Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:30 +0200
  [PATCH 05/27] perf hists browser: Move horizontal scroll init to new() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  [PATCH 07/27] perf hists browser: Introduce init() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  [PATCH 06/27] perf hists browser: Introduce perf_evsel_browser constructor Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  [PATCH 02/27] perf hists browser: Move hist_browser into header file Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  [PATCH 04/27] perf hists browser: Introduce struct hist_browser title callback Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  [PATCH 11/27] perf tests time-to-tsc: No need to disable an event before deleting it Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  [PATCH 03/27] perf hists browser: Make (new|delete|run) public Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  [PATCH 24/27] perf auxtrace: Add option to feed branches to the thread stack Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-23 23:40 +0200
  Re: [GIT PULL 00/27] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-06-26 12:50 +0200

csiph-web