All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 10/30] perf tools: Kill die()
Date: Fri, 30 Jun 2017 19:24:54 -0300	[thread overview]
Message-ID: <20170630222514.11832-11-acme@kernel.org> (raw)
In-Reply-To: <20170630222514.11832-1-acme@kernel.org>

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

Finally can nuke this function, no more users.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-eivvvzn8ie6w42gy3batxoy7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/attr.c | 10 +++++-----
 tools/perf/util/usage.c | 22 ----------------------
 2 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 0dd77494bb58..0e77b2cf61ec 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -18,6 +18,7 @@
  * permissions. All the event text files are stored there.
  */
 
+#include <debug.h>
 #include <errno.h>
 #include <inttypes.h>
 #include <stdlib.h>
@@ -29,14 +30,11 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include "../perf.h"
-#include "util.h"
 #include <subcmd/exec-cmd.h>
 #include "tests.h"
 
 #define ENV "PERF_TEST_ATTR"
 
-extern int verbose;
-
 static char *dir;
 
 void test_attr__init(void)
@@ -138,8 +136,10 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
 {
 	int errno_saved = errno;
 
-	if (store_event(attr, pid, cpu, fd, group_fd, flags))
-		die("test attr FAILED");
+	if (store_event(attr, pid, cpu, fd, group_fd, flags)) {
+		pr_err("test attr FAILED");
+		exit(128);
+	}
 
 	errno = errno_saved;
 }
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c
index bf185f28b19e..6cc9d9888ce0 100644
--- a/tools/perf/util/usage.c
+++ b/tools/perf/util/usage.c
@@ -9,25 +9,12 @@
 #include "util.h"
 #include "debug.h"
 
-static void report(const char *prefix, const char *err, va_list params)
-{
-	char msg[1024];
-	vsnprintf(msg, sizeof(msg), err, params);
-	fprintf(stderr, " %s%s\n", prefix, msg);
-}
-
 static __noreturn void usage_builtin(const char *err)
 {
 	fprintf(stderr, "\n Usage: %s\n", err);
 	exit(129);
 }
 
-static __noreturn void die_builtin(const char *err, va_list params)
-{
-	report(" Fatal: ", err, params);
-	exit(128);
-}
-
 /* If we are in a dlopen()ed .so write to a global variable would segfault
  * (ugh), so keep things static. */
 static void (*usage_routine)(const char *err) __noreturn = usage_builtin;
@@ -36,12 +23,3 @@ void usage(const char *err)
 {
 	usage_routine(err);
 }
-
-void die(const char *err, ...)
-{
-	va_list params;
-
-	va_start(params, err);
-	die_builtin(err, params);
-	va_end(params);
-}
-- 
2.9.4

  parent reply	other threads:[~2017-06-30 22:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30 22:24 [GIT PULL 00/30] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 01/30] perf tests: Add platform dependency to test 15 Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 02/30] perf help: Introduce exec_failed() to avoid code duplication Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 03/30] perf help: Elliminate dup code for reporting Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 04/30] perf help: Use pr_warning() Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 05/30] perf config: " Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 06/30] perf event-parse: " Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 07/30] perf tools: Remove warning() Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 08/30] perf tools: Replace error() with pr_err() Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 09/30] perf config: Do not die when parsing u64 or int config values Arnaldo Carvalho de Melo
2017-06-30 22:24 ` Arnaldo Carvalho de Melo [this message]
2017-06-30 22:24 ` [PATCH 11/30] perf jit: fix typo: "incalid" -> "invalid" Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 12/30] x86/insn: perf tools: Add new ptwrite instruction Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 13/30] perf script: Add 'synth' event type for synthesized events Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 14/30] tools include: Add byte-swapping macros to kernel.h Arnaldo Carvalho de Melo
2017-06-30 22:24 ` [PATCH 15/30] perf auxtrace: Add itrace option to output ptwrite events Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 16/30] perf auxtrace: Add itrace option to output power events Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 17/30] perf script: Add 'synth' field for synthesized event payloads Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 18/30] perf script: Add synthesized Intel PT power and ptwrite events Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 19/30] perf intel-pt: Factor out common code synthesizing event samples Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 20/30] perf intel-pt: Remove unused instructions_sample_period Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 21/30] perf intel-pt: Join needlessly wrapped lines Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 22/30] perf intel-pt: Tidy Intel PT evsel lookup into separate function Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 23/30] perf intel-pt: Tidy messages into called function intel_pt_synth_event() Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 24/30] perf intel-pt: Factor out intel_pt_set_event_name() Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 25/30] perf intel-pt: Move code in intel_pt_synth_events() to simplify attr setting Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 26/30] perf intel-pt: Synthesize new power and "ptwrite" events Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 27/30] perf intel-pt: Add example script for power events and PTWRITE Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 28/30] perf intel-pt: Update documentation to include new ptwrite and power events Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 29/30] perf intel-pt: Do not use TSC packets for calculating CPU cycles to TSC Arnaldo Carvalho de Melo
2017-06-30 22:25 ` [PATCH 30/30] perf auxtrace: Add CPU filter support Arnaldo Carvalho de Melo
2017-07-01  8:41 ` [GIT PULL 00/30] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170630222514.11832-11-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.