Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162594AbbKTU5s (ORCPT ); Fri, 20 Nov 2015 15:57:48 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:55526 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761084AbbKTU5p (ORCPT ); Fri, 20 Nov 2015 15:57:45 -0500 From: Josef Bacik To: , , Subject: [PATCH 02/11] trace-cmd: make libtracecmd a little more library friendly Date: Fri, 20 Nov 2015 15:57:24 -0500 Message-ID: <1448053053-24188-3-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1448053053-24188-1-git-send-email-jbacik@fb.com> References: <1448053053-24188-1-git-send-email-jbacik@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-11-20_12:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3736 Lines: 160 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 --- 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 #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 #include #include +#include #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 -#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 +#include #include #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 /* 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 #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 #include "trace-cmd.h" +#include "event-utils.h" #define LOCAL_PLUGIN_DIR ".trace-cmd/plugins" #define TRACEFS_PATH "/sys/kernel/tracing" -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/