From: tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: adrian.hunter@intel.com, dsahern@gmail.com, tglx@linutronix.de,
linux-kernel@vger.kernel.org, jolsa@kernel.org,
wangnan0@huawei.com, namhyung@kernel.org, mingo@kernel.org,
acme@redhat.com, hpa@zytor.com
Subject: [tip:perf/core] perf tools: Kill die()
Date: Sat, 1 Jul 2017 01:49:25 -0700 [thread overview]
Message-ID: <tip-eivvvzn8ie6w42gy3batxoy7@git.kernel.org> (raw)
Commit-ID: fef2a735167a827a65bbdf1791abe0dd070ce372
Gitweb: http://git.kernel.org/tip/fef2a735167a827a65bbdf1791abe0dd070ce372
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 27 Jun 2017 11:49:13 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 27 Jun 2017 11:49:13 -0300
perf tools: Kill die()
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 0dd77494..0e77b2c 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 bf185f2..6cc9d98 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);
-}
reply other threads:[~2017-07-01 8:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=tip-eivvvzn8ie6w42gy3batxoy7@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).