lkml.org 
[lkml]   [2015]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 02/11] trace-cmd: make libtracecmd a little more library friendly
Date
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


\
 
 \ /
  Last update: 2015-11-20 22:21    [W:2.403 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site