linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock
       [not found] ` <20211119102117.22304-2-nsaenzju@redhat.com>
@ 2021-11-22 14:57   ` Steven Rostedt
  2021-11-24  9:45     ` Nicolas Saenz Julienne
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2021-11-22 14:57 UTC (permalink / raw)
  To: Nicolas Saenz Julienne
  Cc: linux-arm-kernel, maz, james.morse, alexandru.elisei,
	suzuki.poulose, catalin.marinas, will, linux-kernel, kvmarm,
	mingo, mtosatti, nilal, Linux Trace Devel

On Fri, 19 Nov 2021 11:21:17 +0100
Nicolas Saenz Julienne <nsaenzju@redhat.com> wrote:

> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_ARM64_TRACE_CLOCK_H
> +#define _ASM_ARM64_TRACE_CLOCK_H
> +
> +#include <linux/types.h>
> +
> +extern u64 notrace trace_clock_arm64_cntvct(void);
> +
> +# define ARCH_TRACE_CLOCKS \
> +	{ trace_clock_arm64_cntvct, "cntvct", .in_ns = 0 },
> +
> +#endif  /* _ASM_ARM64_TRACE_CLOCK_H */

So this will appear as a usable clock in trace-cmd.

And since this will be used to synchronize between host and guest like the
x86_tsc is used, that means that trace-cmd needs to know that this is the
an arch "CPU" clock. I wonder if we should rename x86_clock (or at least
make it an alias) to "kvm_clock". Then we can have trace-cmd use
"kvm_clock" as the clock for synchronization between host and guests for
all architectures?

Thinking about this, instead of renaming it, I'll add code to create an
alias to these clocks. Then every arch can pick what clock is used that is
the same between hosts and guests such that user space tooling doesn't have
to keep a database of what clocks are used for synchronization between
hosts and guests for each arch.

I'll go add some code ;-)

-- Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock
  2021-11-22 14:57   ` [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock Steven Rostedt
@ 2021-11-24  9:45     ` Nicolas Saenz Julienne
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Saenz Julienne @ 2021-11-24  9:45 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-arm-kernel, maz, james.morse, alexandru.elisei,
	suzuki.poulose, catalin.marinas, will, linux-kernel, kvmarm,
	mingo, mtosatti, nilal, Linux Trace Devel

On Mon, 2021-11-22 at 09:57 -0500, Steven Rostedt wrote:
> On Fri, 19 Nov 2021 11:21:17 +0100
> Nicolas Saenz Julienne <nsaenzju@redhat.com> wrote:
> 
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +#ifndef _ASM_ARM64_TRACE_CLOCK_H
> > +#define _ASM_ARM64_TRACE_CLOCK_H
> > +
> > +#include <linux/types.h>
> > +
> > +extern u64 notrace trace_clock_arm64_cntvct(void);
> > +
> > +# define ARCH_TRACE_CLOCKS \
> > +	{ trace_clock_arm64_cntvct, "cntvct", .in_ns = 0 },
> > +
> > +#endif  /* _ASM_ARM64_TRACE_CLOCK_H */
> 
> So this will appear as a usable clock in trace-cmd.
> 
> And since this will be used to synchronize between host and guest like the
> x86_tsc is used, that means that trace-cmd needs to know that this is the
> an arch "CPU" clock. I wonder if we should rename x86_clock (or at least
> make it an alias) to "kvm_clock". Then we can have trace-cmd use
> "kvm_clock" as the clock for synchronization between host and guests for
> all architectures?
>
> Thinking about this, instead of renaming it, I'll add code to create an
> alias to these clocks. Then every arch can pick what clock is used that is
> the same between hosts and guests such that user space tooling doesn't have
> to keep a database of what clocks are used for synchronization between
> hosts and guests for each arch.
> 
> I'll go add some code ;-)

I really like the idea, please keep me in the loop if you send something
upstream.

-- 
Nicolás Sáenz


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-24  9:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20211119102117.22304-1-nsaenzju@redhat.com>
     [not found] ` <20211119102117.22304-2-nsaenzju@redhat.com>
2021-11-22 14:57   ` [RFC PATCH 1/2] arm64/tracing: add cntvct based trace clock Steven Rostedt
2021-11-24  9:45     ` Nicolas Saenz Julienne

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).