lttng-dev Archive mirror
 help / color / mirror / Atom feed
From: Mathieu Desnoyers via lttng-dev <lttng-dev@lists.lttng.org>
To: Rouven Czerwinski <r.czerwinski@pengutronix.de>,
	lttng-dev@lists.lttng.org
Subject: Re: [lttng-dev] [PATCH lttng-modules] Add new tracepoints for dma_fence
Date: Fri, 23 Sep 2022 11:46:24 -0400	[thread overview]
Message-ID: <2647bf8d-19fb-93fb-f603-e5e37843917e@efficios.com> (raw)
In-Reply-To: <20220908082351.906021-1-r.czerwinski@pengutronix.de>

On 2022-09-08 04:23, Rouven Czerwinski via lttng-dev wrote:
> Allows usage of dma_fence tracepoints from lttng.
> 

Hi Rouven,

This patch looks good. Merged into the master branch of lttng-modules.

Thanks,

Mathieu

> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>   include/instrumentation/events/dma_fence.h | 83 ++++++++++++++++++++++
>   src/probes/Kbuild                          |  7 ++
>   src/probes/lttng-probe-dma-fence.c         | 32 +++++++++
>   3 files changed, 122 insertions(+)
>   create mode 100644 include/instrumentation/events/dma_fence.h
>   create mode 100644 src/probes/lttng-probe-dma-fence.c
> 
> diff --git a/include/instrumentation/events/dma_fence.h b/include/instrumentation/events/dma_fence.h
> new file mode 100644
> index 00000000..95d94ed5
> --- /dev/null
> +++ b/include/instrumentation/events/dma_fence.h
> @@ -0,0 +1,83 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM dma_fence
> +
> +#if !defined(LTTNG_TRACE_DMA_FENCE_H) || defined(TRACE_HEADER_MULTI_READ)
> +#define LTTNG_TRACE_DMA_FENCE_H
> +
> +#include <lttng/tracepoint-event.h>
> +
> +LTTNG_TRACEPOINT_EVENT_CLASS(dma_fence_class,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence),
> +
> +	TP_FIELDS(
> +		ctf_string(driver, fence->ops->get_driver_name(fence))
> +		ctf_string(timeline, fence->ops->get_timeline_name(fence))
> +		ctf_integer(unsigned int, context, fence->context)
> +		ctf_integer(unsigned int, seqno, fence->seqno)
> +	)
> +)
> +
> +LTTNG_TRACEPOINT_EVENT_INSTANCE(dma_fence_class,
> +	dma_fence_emit,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence)
> +)
> +
> +LTTNG_TRACEPOINT_EVENT_INSTANCE(dma_fence_class,
> +	dma_fence_init,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence)
> +)
> +
> +LTTNG_TRACEPOINT_EVENT_INSTANCE(dma_fence_class,
> +	dma_fence_destroy,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence)
> +)
> +
> +LTTNG_TRACEPOINT_EVENT_INSTANCE(dma_fence_class,
> +	dma_fence_enable_signal,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence)
> +)
> +
> +LTTNG_TRACEPOINT_EVENT_INSTANCE(dma_fence_class,
> +	dma_fence_signaled,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence)
> +)
> +
> +LTTNG_TRACEPOINT_EVENT_INSTANCE(dma_fence_class,
> +	dma_fence_wait_start,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence)
> +)
> +
> +LTTNG_TRACEPOINT_EVENT_INSTANCE(dma_fence_class,
> +	dma_fence_wait_end,
> +
> +	TP_PROTO(struct dma_fence *fence),
> +
> +	TP_ARGS(fence)
> +)
> +
> +#endif /*  LTTNG_TRACE_DMA_FENCE_H */
> +
> +/* This part must be outside protection */
> +#include <lttng/define_trace.h>
> diff --git a/src/probes/Kbuild b/src/probes/Kbuild
> index aa002534..7597389b 100644
> --- a/src/probes/Kbuild
> +++ b/src/probes/Kbuild
> @@ -97,6 +97,13 @@ endif # CONFIG_X86
>   
>   obj-$(CONFIG_LTTNG) += lttng-probe-signal.o
>   
> +ifneq ($(CONFIG_DMA_SHARED_BUFFER),)
> +  obj-$(CONFIG_LTTNG) += $(shell \
> +    if [ $(VERSION) -ge 5 \
> +       -o \( $VERSION -eq 4 -a $(PATCHLEVEL) -ge 9 \) ] ; then \
> +      echo "lttng-probe-dma-fence.o" ; fi;)
> +endif # CONFIG_DMA_SHARED_BUFFER
> +
>   ifneq ($(CONFIG_BLOCK),)
>     # need blk_cmd_buf_len
>     ifneq ($(CONFIG_EVENT_TRACING),)
> diff --git a/src/probes/lttng-probe-dma-fence.c b/src/probes/lttng-probe-dma-fence.c
> new file mode 100644
> index 00000000..a6c9cd12
> --- /dev/null
> +++ b/src/probes/lttng-probe-dma-fence.c
> @@ -0,0 +1,32 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
> + *
> + * probes/lttng-probe-dma-fence.c
> + *
> + * LTTng dma-fence probes.
> + *
> + * Copyright (C) 2022 Pengutronix, Rouven Czerwinski <entwicklung@pengutronix.de>
> + */
> +
> +#include <linux/dma-fence.h>
> +/*
> + * Create the tracepoint static inlines from the kernel to validate that our
> + * trace event macros match the kernel we run on.
> + */
> +#include <trace/events/dma_fence.h>
> +
> +/*
> + * Create LTTng tracepoint probes.
> + */
> +#define LTTNG_PACKAGE_BUILD
> +#define CREATE_TRACE_POINTS
> +#define TRACE_INCLUDE_PATH instrumentation/events
> +
> +#include <instrumentation/events/dma_fence.h>
> +
> +MODULE_LICENSE("GPL and additional rights");
> +MODULE_AUTHOR("Rouven Czerwinski <r.czerwinski@pengutronix.de>");
> +MODULE_DESCRIPTION("LTTng dma-fence probes");
> +MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "."
> +	__stringify(LTTNG_MODULES_MINOR_VERSION) "."
> +	__stringify(LTTNG_MODULES_PATCHLEVEL_VERSION)
> +	LTTNG_MODULES_EXTRAVERSION);


-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

      reply	other threads:[~2022-09-23 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  8:23 [lttng-dev] [PATCH lttng-modules] Add new tracepoints for dma_fence Rouven Czerwinski via lttng-dev
2022-09-23 15:46 ` Mathieu Desnoyers via lttng-dev [this message]

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=2647bf8d-19fb-93fb-f603-e5e37843917e@efficios.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=r.czerwinski@pengutronix.de \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).