All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: [PATCH v3 09/11] trace-cmd agent: Have agent work without vsockets available
Date: Wed, 20 Apr 2022 11:26:35 -0400	[thread overview]
Message-ID: <20220420152637.13105-10-rostedt@goodmis.org> (raw)
In-Reply-To: <20220420152637.13105-1-rostedt@goodmis.org>

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

Compile agent code without vsockets available to allow it to work with
networking. This includes allowing the ptp time synchronization protocol
to be used.

Link: https://lore.kernel.org/linux-trace-devel/20220417184538.1044417-10-rostedt@goodmis.org

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 lib/trace-cmd/Makefile                    | 2 +-
 lib/trace-cmd/include/trace-tsync-local.h | 6 +-----
 tracecmd/Makefile                         | 5 ++---
 tracecmd/trace-cmd.c                      | 2 --
 tracecmd/trace-usage.c                    | 2 --
 5 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/lib/trace-cmd/Makefile b/lib/trace-cmd/Makefile
index da0ad4deeb4f..9374b163b5f3 100644
--- a/lib/trace-cmd/Makefile
+++ b/lib/trace-cmd/Makefile
@@ -21,8 +21,8 @@ ifeq ($(PERF_DEFINED), 1)
 OBJS += trace-perf.o
 endif
 OBJS += trace-timesync.o
-ifeq ($(VSOCK_DEFINED), 1)
 OBJS += trace-timesync-ptp.o
+ifeq ($(VSOCK_DEFINED), 1)
 OBJS += trace-timesync-kvm.o
 endif
 OBJS += trace-compress.o
diff --git a/lib/trace-cmd/include/trace-tsync-local.h b/lib/trace-cmd/include/trace-tsync-local.h
index 885c9f51d891..5bbc1db622c4 100644
--- a/lib/trace-cmd/include/trace-tsync-local.h
+++ b/lib/trace-cmd/include/trace-tsync-local.h
@@ -64,15 +64,11 @@ int tracecmd_tsync_proto_register(const char *proto_name, int accuracy, int role
 					      long long *, long long *, long long*,
 					      long long *, unsigned int));
 int tracecmd_tsync_proto_unregister(char *proto_name);
+int ptp_clock_sync_register(void);
 
 #ifdef VSOCK
-int ptp_clock_sync_register(void);
 int kvm_clock_sync_register(void);
 #else
-static inline int ptp_clock_sync_register(void)
-{
-	return 0;
-}
 static inline int kvm_clock_sync_register(void)
 {
 	return 0;
diff --git a/tracecmd/Makefile b/tracecmd/Makefile
index 13f7776e8e45..0114948fe385 100644
--- a/tracecmd/Makefile
+++ b/tracecmd/Makefile
@@ -37,11 +37,10 @@ TRACE_CMD_OBJS += trace-dump.o
 TRACE_CMD_OBJS += trace-clear.o
 TRACE_CMD_OBJS += trace-vm.o
 TRACE_CMD_OBJS += trace-convert.o
-TRACE_CMD_OBJS += trace-vsock.o
-
-ifeq ($(VSOCK_DEFINED), 1)
 TRACE_CMD_OBJS += trace-agent.o
 TRACE_CMD_OBJS += trace-setup-guest.o
+ifeq ($(VSOCK_DEFINED), 1)
+TRACE_CMD_OBJS += trace-vsock.o
 endif
 
 ALL_OBJS := $(TRACE_CMD_OBJS:%.o=$(bdir)/%.o)
diff --git a/tracecmd/trace-cmd.c b/tracecmd/trace-cmd.c
index 3f3e69a7f1e2..69800d26c5ee 100644
--- a/tracecmd/trace-cmd.c
+++ b/tracecmd/trace-cmd.c
@@ -127,10 +127,8 @@ struct command commands[] = {
 	{"hist", trace_hist},
 	{"mem", trace_mem},
 	{"listen", trace_listen},
-#ifdef VSOCK
 	{"agent", trace_agent},
 	{"setup-guest", trace_setup_guest},
-#endif
 	{"split", trace_split},
 	{"restore", trace_restore},
 	{"stack", trace_stack},
diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c
index ec6376557394..88eac10a4e75 100644
--- a/tracecmd/trace-usage.c
+++ b/tracecmd/trace-usage.c
@@ -325,7 +325,6 @@ static struct usage_help usage_help[] = {
 		"          -l logfile to write messages to.\n"
 		"          --verbose 'level' Set the desired log level\n"
 	},
-#ifdef VSOCK
 	{
 		"agent",
 		"listen on a vsocket for trace clients",
@@ -344,7 +343,6 @@ static struct usage_help usage_help[] = {
 		"          -g FIFOs group owner\n"
 		"          -a Attach FIFOs to guest VM config\n"
 	},
-#endif
 	{
 		"list",
 		"list the available events, plugins or options",
-- 
2.35.1


  parent reply	other threads:[~2022-04-20 15:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 15:26 [PATCH v3 00/11] trace-cmd: Allow agent to use networking Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 01/11] trace-cmd record: Move port_type into instance Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 02/11] trace-cmd library: Add network roles for time sync Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 03/11] trace-cmd record: Allow for ip connections to agents Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 04/11] trace-cmd agent: Allow for ip connections from the agent Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 05/11] trace-cmd library: Create tracecmd_debug() for debug printing Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 06/11] trace-cmd: Add debug prints for network connections Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 07/11] trace-cmd: Add print helpers to show connections Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 08/11] trace-cmd: Override tracecmd_debug() to show thread id Steven Rostedt
2022-04-20 15:26 ` Steven Rostedt [this message]
2022-04-20 15:26 ` [PATCH v3 10/11] trace-cmd agent: Have -N take a host name Steven Rostedt
2022-04-20 15:26 ` [PATCH v3 11/11] trace-cmd agent: Add documentation Steven Rostedt

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=20220420152637.13105-10-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.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 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.