From: Ross Zwisler <zwisler@google.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ross Zwisler <zwisler@chromium.org>,
linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
linux-trace-kernel@vger.kernel.org,
Jason Wang <jasowang@redhat.com>,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH 7/9] tools/virtio: use canonical ftrace path
Date: Wed, 1 Feb 2023 15:07:30 -0700 [thread overview]
Message-ID: <Y9rioglGan9fZdcv@google.com> (raw)
In-Reply-To: <20230130142616-mutt-send-email-mst@kernel.org>
On Mon, Jan 30, 2023 at 02:26:43PM -0500, Michael S. Tsirkin wrote:
> On Mon, Jan 30, 2023 at 11:19:13AM -0700, Ross Zwisler wrote:
> > The canonical location for the tracefs filesystem is at /sys/kernel/tracing.
> >
> > But, from Documentation/trace/ftrace.rst:
> >
> > Before 4.1, all ftrace tracing control files were within the debugfs
> > file system, which is typically located at /sys/kernel/debug/tracing.
> > For backward compatibility, when mounting the debugfs file system,
> > the tracefs file system will be automatically mounted at:
> >
> > /sys/kernel/debug/tracing
> >
> > A few spots in tools/virtio still refer to this older debugfs
> > path, so let's update them to avoid confusion.
> >
> > Signed-off-by: Ross Zwisler <zwisler@google.com>
> > ---
> > tools/virtio/virtio-trace/README | 2 +-
> > tools/virtio/virtio-trace/trace-agent.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/virtio/virtio-trace/README b/tools/virtio/virtio-trace/README
> > index b64845b823ab..cea29a2a4c0a 100644
> > --- a/tools/virtio/virtio-trace/README
> > +++ b/tools/virtio/virtio-trace/README
> > @@ -95,7 +95,7 @@ Run
> >
> > 1) Enable ftrace in the guest
> > <Example>
> > - # echo 1 > /sys/kernel/debug/tracing/events/sched/enable
> > + # echo 1 > /sys/kernel/tracing/events/sched/enable
> >
> > 2) Run trace agent in the guest
> > This agent must be operated as root.
> > diff --git a/tools/virtio/virtio-trace/trace-agent.c b/tools/virtio/virtio-trace/trace-agent.c
> > index cdfe77c2b4c8..805942d02e9f 100644
> > --- a/tools/virtio/virtio-trace/trace-agent.c
> > +++ b/tools/virtio/virtio-trace/trace-agent.c
> > @@ -19,7 +19,7 @@
> > #define PIPE_MIN_SIZE (PAGE_SIZE*PIPE_DEF_BUFS)
> > #define PIPE_MAX_SIZE (1024*1024)
> > #define READ_PATH_FMT \
> > - "/sys/kernel/debug/tracing/per_cpu/cpu%d/trace_pipe_raw"
> > + "/sys/kernel/tracing/per_cpu/cpu%d/trace_pipe_raw"
>
> Should we try both old and new path then?
Sure, I think it makes sense to have all the comments & documentation point
only to the preferred location, but I think for tools it makes sense to check
both places so that we don't see field regressions. This is what the BPF code
does:
https://elixir.bootlin.com/linux/latest/source/tools/bpf/bpftool/tracelog.c#L98
I'll add a check and fallback to this tool & send out v2. Thanks for the
review.
> > #define WRITE_PATH_FMT "/dev/virtio-ports/trace-path-cpu%d"
> > #define CTL_PATH "/dev/virtio-ports/agent-ctl-path"
> >
> > --
> > 2.39.1.456.gfc5497dd1b-goog
>
next prev parent reply other threads:[~2023-02-01 22:07 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 18:19 [PATCH 0/9] use canonical ftrace path whenever possible Ross Zwisler
2023-01-30 18:19 ` [PATCH 1/9] tracing: always use canonical ftrace path Ross Zwisler
2023-01-30 18:19 ` [PATCH 2/9] bpf: " Ross Zwisler
2023-01-30 18:19 ` [PATCH 3/9] selftests/bpf: " Ross Zwisler
2023-01-30 19:52 ` Alexei Starovoitov
2023-01-30 19:59 ` Steven Rostedt
2023-01-30 20:03 ` Alexei Starovoitov
2023-01-30 23:34 ` Steven Rostedt
2023-01-31 0:53 ` Alexei Starovoitov
2023-01-31 19:50 ` Steven Rostedt
2023-01-31 23:25 ` Alexei Starovoitov
2023-02-01 0:05 ` Ross Zwisler
2023-01-30 18:19 ` [PATCH 4/9] perf docs: " Ross Zwisler
2023-02-02 1:24 ` Arnaldo Carvalho de Melo
2023-01-30 18:19 ` [PATCH 5/9] tools/power: " Ross Zwisler
2023-02-02 14:47 ` Rafael J. Wysocki
2023-01-30 18:19 ` [PATCH 6/9] selftests: " Ross Zwisler
2023-01-30 18:19 ` [PATCH 7/9] tools/virtio: " Ross Zwisler
2023-01-30 19:26 ` Michael S. Tsirkin
2023-02-01 22:07 ` Ross Zwisler [this message]
2023-01-30 18:19 ` [PATCH 8/9] leaking_addresses: also skip " Ross Zwisler
2023-01-30 19:34 ` Tycho Andersen
2023-01-30 18:19 ` [PATCH 9/9] tools/kvm_stat: use " Ross Zwisler
2023-01-30 19:26 ` [PATCH 0/9] use canonical ftrace path whenever possible Michael S. Tsirkin
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=Y9rioglGan9fZdcv@google.com \
--to=zwisler@google.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=rostedt@goodmis.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=zwisler@chromium.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).