linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
To: Dario Faggioli <dfaggioli@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH v28 0/8] Timestamp synchronization of host - guest tracing session
Date: Tue, 9 Feb 2021 08:08:50 +0200	[thread overview]
Message-ID: <CAPpZLN7boZK+9921zJ+OvZ-yhT6DdAkWkj9+fgswV_g4PxsROg@mail.gmail.com> (raw)
In-Reply-To: <CAPpZLN5SQu=XwQ+XodbVWrXUb-qtcLjH-U79R6NBDJ4jwQSvsw@mail.gmail.com>

On Tue, Feb 9, 2021 at 8:03 AM Tzvetomir Stoyanov <tz.stoyanov@gmail.com> wrote:
>
> Hi Dario,
>
> On Tue, Feb 9, 2021 at 7:32 AM Dario Faggioli <dfaggioli@suse.com> wrote:
> >
> > Hello,
> >
> > On Mon, 2021-02-08 at 08:17 +0200, Tzvetomir Stoyanov (VMware) wrote:
> > > Basic infrastructure for host - guest timestamp synchronization and a
> > > PoC implementation of PTP-like and KVM algorithms.
> > >
> > I'm trying to play with trace-cmd agent & clock syncronization, so I
> > applied this series.
> >
> > However, when I try to connect to a VM where I have the agent running,
> > I'm seeing this (on the host):
> >
> > # ./tracecmd/trace-cmd record --debug -p nop -e sched:* -e kvm:* -e timer:hrtimer* -A tumbleweed-jeos:8888 -e all sleep 1
> > trace-cmd: No such file or directory
> >   Failed to receive trace response -107
> >
> > I tried to do a strace, still on the host, and this is what I see (the
> > last part of the output):
> >
> > rt_sigaction(SIGINT, {sa_handler=0x4116a5, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f29f1b55b70}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
> > openat(AT_FDCWD, "/var/lib/trace-cmd/virt/(null)/trace-pipe-cpu0.out", O_RDONLY|O_NONBLOCK) = -1 ENOENT (No such file or directory)
> > socket(AF_VSOCK, SOCK_STREAM, 0)        = 4
> > connect(4, {sa_family=AF_VSOCK, sa_data="\0\0\270\"\0\0\3\0\0\0\0\0\0\0"}, 16) = 0
> > openat(AT_FDCWD, "/sys/kernel/debug/tracing/trace_clock", O_RDONLY) = 6
> > read(6, "local global counter uptime perf"..., 8192) = 62
> > read(6, "", 8192)                       = 0
> > close(6)                                = 0
> > write(4, "\0\0\0<\0\0\0\6\0\0\0\20\0\0\0\0\0\0\0\0\347\366+n\204\271\35\334", 28) = 28
> > write(4, "\0\0\0\0\0\0\0\v\0\0\0\2-e\0all\0\0\0\0\1\0\0\0\5ptp\0\0", 32) = 32
> > read(4, "", 12)                         = 0
> > dup(2)                                  = 6
> > fcntl(6, F_GETFL)                       = 0x402 (flags O_RDWR|O_APPEND)
> > fstat(6, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x9), ...}) = 0
> > write(6, "trace-cmd: No such file or direc"..., 37trace-cmd: No such file or directory
> > ) = 37
> > close(6)                                = 0
> > write(2, "  ", 2  )                       = 2
> > write(2, "Failed to receive trace response"..., 37Failed to receive trace response -107) = 37
> > write(2, "\n", 1
> > )                       = 1
> > exit_group(2)                           = ?
> > +++ exited with 2 +++
> >
> > Finally, if I use `--debug` both on the host and in the VM, here's what
> > I get.
> >
> > Guest:
> > # ./tracecmd/trace-cmd agent -p 8888 --debug
> > listening on @3:8888
> > msg received: 6 (TRACE_REQ) [60]
> > Segmentation fault
> >
> > Host:
> > # ./tracecmd/trace-cmd record --debug -p nop -e sched:* -e kvm:* -e timer:hrtimer* -A tumbleweed-jeos:8888 -e all sleep 1
> > msg send: 6 (TRACE_REQ) [60]
> > trace-cmd: No such file or directory
> >   Failed to receive trace response -107
> >
> > Am I doing something wrong? :-)
> >
> > If necessary, I can provide more info about my setup, or do more tests.
>
> There are a few limitations that we are working to address:
>  1. Ensure that vhost_vsock module is loaded on the host.
>  2. You should add a vsock device manually to your VM config, I use
> "virsh edit <vm name>" to add:
>    <vsock model='virtio'>
>       <cid auto='yes'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x09'
> function='0x0'/>
>     </vsock>
> somewhere in the <devices> </devices> section.
>
Also, please note that there are two patches that should be applied also,
not part of v28 version of the patchset:
  "trace-cmd: Fix plist allocation check in trace-msg.c"
   https://patchwork.kernel.org/project/linux-trace-devel/patch/20210203165431.792152a4@gandalf.local.home/
 "trace-cmd: Fix SEGFAULT when no tsync_protos are supplied"
   https://patchwork.kernel.org/project/linux-trace-devel/patch/20210203171018.5b82a0a7@gandalf.local.home/


> >
> > Thanks and Regards
> > --
> > Dario Faggioli, Ph.D
> > http://about.me/dario.faggioli
> > Virtualization Software Engineer
> > SUSE Labs, SUSE https://www.suse.com/
> > -------------------------------------------------------------------
> > <<This happens because _I_ choose it to happen!>> (Raistlin Majere)
>
>
>
> --
> Tzvetomir (Ceco) Stoyanov
> VMware Open Source Technology Center



-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

  reply	other threads:[~2021-02-09  6:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  6:17 [PATCH v28 0/8] Timestamp synchronization of host - guest tracing session Tzvetomir Stoyanov (VMware)
2021-02-08  6:17 ` [PATCH v28 1/8] trace-cmd: Save command lines in VM agent Tzvetomir Stoyanov (VMware)
2021-02-17 20:55   ` Steven Rostedt
2021-02-08  6:17 ` [PATCH v28 2/8] trace-cmd: Fix bug in getting tracing dir in trace-cmd agent Tzvetomir Stoyanov (VMware)
2021-02-08  6:17 ` [PATCH v28 3/8] trace-cmd: Removed unused s64 define Tzvetomir Stoyanov (VMware)
2021-02-08  6:17 ` [PATCH v28 4/8] trace-cmd: Add timestamp synchronization per vCPU Tzvetomir Stoyanov (VMware)
2021-02-08  6:17 ` [PATCH v28 5/8] trace-cmd: Add dummy function to initialize timestamp sync logic Tzvetomir Stoyanov (VMware)
2021-02-08  6:17 ` [PATCH v28 6/8] trace-cmd: [POC] PTP-like algorithm for host - guest timestamp synchronization Tzvetomir Stoyanov (VMware)
2021-02-08  6:17 ` [PATCH v28 7/8] trace-cmd: Debug scripts for " Tzvetomir Stoyanov (VMware)
2021-02-08  6:17 ` [PATCH v28 8/8] trace-cmd [POC]: Add KVM timestamp synchronization plugin Tzvetomir Stoyanov (VMware)
2021-02-16 20:48   ` Steven Rostedt
2021-02-09  5:32 ` [PATCH v28 0/8] Timestamp synchronization of host - guest tracing session Dario Faggioli
2021-02-09  6:03   ` Tzvetomir Stoyanov
2021-02-09  6:08     ` Tzvetomir Stoyanov [this message]
2021-02-09  7:28       ` Dario Faggioli
2021-02-09 11:44         ` Tzvetomir Stoyanov
2021-02-09 12:24           ` Dario Faggioli
2021-02-09 13:00             ` Tzvetomir Stoyanov
2021-02-09 15:28               ` Dario Faggioli
2021-02-09 17:01                 ` Tzvetomir Stoyanov
2021-02-10 22:02                   ` Steven Rostedt
2021-02-10 23:35                     ` Dario Faggioli
2021-02-10 21:59             ` Steven Rostedt
2021-02-10 23:33               ` Dario Faggioli
2021-02-09  7:18     ` Dario Faggioli

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=CAPpZLN7boZK+9921zJ+OvZ-yhT6DdAkWkj9+fgswV_g4PxsROg@mail.gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=dfaggioli@suse.com \
    --cc=linux-trace-devel@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;
as well as URLs for NNTP newsgroup(s).