From: Josef Bacik <jbacik@fb.com>
To: <kernel-team@fb.com>, <linux-kernel@vger.kernel.org>,
<rostedt@goodmis.org>
Subject: [PATCH 02/11] trace-cmd: make libtracecmd a little more library friendly
Date: Fri, 20 Nov 2015 15:57:24 -0500 [thread overview]
Message-ID: <1448053053-24188-3-git-send-email-jbacik@fb.com> (raw)
In-Reply-To: <1448053053-24188-1-git-send-email-jbacik@fb.com>
Whenever you link against libtracecmd you will get a bunch of debugging output
if you don't provide your own pr_stat(). So instead default to no output if we
don't provide a pr_stat(). Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
ctracecmd.i | 1 +
parse-utils.c | 6 ------
plugin_function.c | 1 +
trace-cmd-local.h | 1 +
trace-cmd.c | 1 +
trace-cmd.h | 2 --
trace-hooks.c | 2 ++
trace-local.h | 1 +
trace-recorder.c | 1 +
trace-util.c | 1 +
10 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/ctracecmd.i b/ctracecmd.i
index e91d068..ba32d3b 100644
--- a/ctracecmd.i
+++ b/ctracecmd.i
@@ -15,6 +15,7 @@
%{
#include "trace-cmd.h"
+#include "event-utils.h"
%}
diff --git a/parse-utils.c b/parse-utils.c
index f023a13..c5b0487 100644
--- a/parse-utils.c
+++ b/parse-utils.c
@@ -87,16 +87,10 @@ void __pr_stat(const char *fmt, ...)
void __weak vpr_stat(const char *fmt, va_list ap)
{
- __vpr_stat(fmt, ap);
}
void __weak pr_stat(const char *fmt, ...)
{
- va_list ap;
-
- va_start(ap, fmt);
- __vpr_stat(fmt, ap);
- va_end(ap);
}
void __weak *malloc_or_die(unsigned int size)
diff --git a/plugin_function.c b/plugin_function.c
index 02cfd43..1e88a7f 100644
--- a/plugin_function.c
+++ b/plugin_function.c
@@ -22,6 +22,7 @@
#include <string.h>
#include "trace-cmd.h"
+#include "event-utils.h"
static struct func_stack {
int size;
diff --git a/trace-cmd-local.h b/trace-cmd-local.h
index 051a470..9412f9d 100644
--- a/trace-cmd-local.h
+++ b/trace-cmd-local.h
@@ -23,6 +23,7 @@
/* Local for trace-input.c and trace-output.c */
#include "trace-cmd.h"
+#include "event-utils.h"
static ssize_t __do_write(int fd, const void *data, size_t size)
{
diff --git a/trace-cmd.c b/trace-cmd.c
index 4c5b564..49d3559 100644
--- a/trace-cmd.c
+++ b/trace-cmd.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
+#include <stdlib.h>
#include "trace-local.h"
diff --git a/trace-cmd.h b/trace-cmd.h
index c9b9b95..2e59b46 100644
--- a/trace-cmd.h
+++ b/trace-cmd.h
@@ -20,8 +20,6 @@
#ifndef _TRACE_CMD_H
#define _TRACE_CMD_H
-#include <stdlib.h>
-#include "event-utils.h"
#include "event-parse.h"
#define TRACECMD_ERR_MSK ((unsigned long)(-1) & ~((1UL << 14) - 1))
diff --git a/trace-hooks.c b/trace-hooks.c
index 1d2bff2..11266ab 100644
--- a/trace-hooks.c
+++ b/trace-hooks.c
@@ -19,9 +19,11 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include "trace-cmd.h"
+#include "event-utils.h"
struct hook_list *tracecmd_create_event_hook(const char *arg)
{
diff --git a/trace-local.h b/trace-local.h
index 62363d0..a1596e7 100644
--- a/trace-local.h
+++ b/trace-local.h
@@ -24,6 +24,7 @@
#include <dirent.h> /* for DIR */
#include "trace-cmd.h"
+#include "event-utils.h"
/* fix stupid glib guint64 typecasts and printf formats */
typedef unsigned long long u64;
diff --git a/trace-recorder.c b/trace-recorder.c
index 66cad98..16d1be0 100644
--- a/trace-recorder.c
+++ b/trace-recorder.c
@@ -34,6 +34,7 @@
#include <errno.h>
#include "trace-cmd.h"
+#include "event-utils.h"
struct tracecmd_recorder {
int fd;
diff --git a/trace-util.c b/trace-util.c
index da20e4c..d486738 100644
--- a/trace-util.c
+++ b/trace-util.c
@@ -32,6 +32,7 @@
#include <sys/stat.h>
#include "trace-cmd.h"
+#include "event-utils.h"
#define LOCAL_PLUGIN_DIR ".trace-cmd/plugins"
#define TRACEFS_PATH "/sys/kernel/tracing"
--
2.1.0
next prev parent reply other threads:[~2015-11-20 20:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 20:57 [PATCH 00/11] trace-cmd: make libtracecmd a linkable object Josef Bacik
2015-11-20 20:57 ` [PATCH 01/11] trace-cmd: add install_libs target to trace-cmd Josef Bacik
2015-11-20 20:57 ` Josef Bacik [this message]
2015-11-20 20:57 ` [PATCH 03/11] trace-cmd: add a function to create a top instance Josef Bacik
2015-11-20 20:57 ` [PATCH 04/11] trace-cmd: add global functions for live tracing Josef Bacik
2019-07-09 13:09 ` Steven Rostedt
2019-07-09 13:56 ` Josef Bacik
2015-11-20 20:57 ` [PATCH 05/11] trace-cmd: allow for custom show and handle init Josef Bacik
2015-11-20 20:57 ` [PATCH 06/11] trace-cmd: add helpers for starting and stopping threads Josef Bacik
2015-11-20 20:57 ` [PATCH 07/11] trace-cmd: add trace-hash to libtracecmd Josef Bacik
2015-11-20 20:57 ` [PATCH 08/11] trace-cmd: add trace-stat and -ldl " Josef Bacik
2015-11-20 20:57 ` [PATCH 09/11] trace-cmd: disentangle profile and read from record Josef Bacik
2015-11-20 20:57 ` [PATCH 10/11] trace-cmd: add a helper function for stream polling Josef Bacik
2015-11-20 20:57 ` [PATCH 11/11] trace-cmd: add tracecmd_expand_event_list Josef Bacik
2016-11-21 17:13 ` [PATCH 00/11] trace-cmd: make libtracecmd a linkable object Steven Rostedt
2016-11-21 20:06 ` Josef Bacik
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=1448053053-24188-3-git-send-email-jbacik@fb.com \
--to=jbacik@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®