[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aCYv5U5u238pH1uq@google.com>
Date: Thu, 15 May 2025 11:18:13 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Thomas Richter <tmricht@...ux.ibm.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ian Rogers <irogers@...gle.com>, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, linux-perf-users@...r.kernel.org,
agordeev@...ux.ibm.com, gor@...ux.ibm.com, sumanthk@...ux.ibm.com,
hca@...ux.ibm.com, Alexander Egorenkov <egorenar@...ux.ibm.com>
Subject: Re: [PATCH] perf ftrace: Restore to original trace settings on exit
Hello,
On Thu, May 15, 2025 at 01:10:56PM -0300, Arnaldo Carvalho de Melo wrote:
> On Thu, May 15, 2025 at 08:34:07AM +0200, Thomas Richter wrote:
> > Executing perf ftrace commands ftrace, profile and latency
> > leave tracing disabled as can seen in this output:
> >
> > # echo 1 > /sys/kernel/debug/tracing/tracing_on
> > # cat /sys/kernel/debug/tracing/tracing_on
> > 1
> > # perf ftrace trace --graph-opts depth=5 sleep 0.1 > /dev/null
> > # cat /sys/kernel/debug/tracing/tracing_on
> > 0
> > #
>
> > The tracing_on file is not restored to its value before the command.
> > Fix this behavior and restore the trace setting to what
> > is was before the invocation of the command.
> > On Fedora 41 and 42 tracing is turned on by default.
>
> This looks fragile as it takes a snapshot in time of what are the files
> in some particular directory to save them and then restore it at the
> end.
>
> The tool may at some point in the future go and touch other (added in
> the future) files in that directory, etc.
>
> I _think_ that instead we should move to use some "session mode" ftrace,
> which I _think_ is already available for quite some time, i.e. instead
> of touching the global ftrace files (which probably are there for
> historical reasons), we should use, lemme find the reference...
>
> I think the keyword to lookup is /sys/kernel/debug/tracing/instances/
>
> Ian did a lot of work on having 'perf test' run shell tests in parallel,
> so we need to think about ways of allowing for that by not touching
> global state.
>
> tldr; great idea, avoid global state.
Right, by using an tracing instance, you don't need to worry about the
original states.
Thanks,
Namhyung
Powered by blists - more mailing lists