* [PATCH lttng-modules 2/2] Fix: tracing: Centralize preemptirq tracepoints (4.19)
[not found] <20180907162113.28162-1-mjeanson@efficios.com>
@ 2018-09-07 16:21 ` Michael Jeanson
2018-10-01 18:03 ` [PATCH lttng-modules 1/2] Fix: net: expose sk wmem in sock_exceed_buf_limit tracepoint (4.19) Mathieu Desnoyers
[not found] ` <20180907162113.28162-2-mjeanson@efficios.com>
2 siblings, 0 replies; 3+ messages in thread
From: Michael Jeanson @ 2018-09-07 16:21 UTC (permalink / raw)
To: lttng-dev
See upstream commit:
commit c3bc8fd637a9623f5c507bd18f9677effbddf584
Author: Joel Fernandes (Google) <joel@joelfernandes.org>
Date: Mon Jul 30 15:24:23 2018 -0700
tracing: Centralize preemptirq tracepoints and unify their usage
This patch detaches the preemptirq tracepoints from the tracers and
keeps it separate.
Advantages:
* Lockdep and irqsoff event can now run in parallel since they no longer
have their own calls.
* This unifies the usecase of adding hooks to an irqsoff and irqson
event, and a preemptoff and preempton event.
3 users of the events exist:
- Lockdep
- irqsoff and preemptoff tracers
- irqs and preempt trace events
The unification cleans up several ifdefs and makes the code in preempt
tracer and irqsoff tracers simpler. It gets rid of all the horrific
ifdeferry around PROVE_LOCKING and makes configuration of the different
users of the tracepoints more easy and understandable. It also gets rid
of the time_* function calls from the lockdep hooks used to call into
the preemptirq tracer which is not needed anymore. The negative delta in
lines of code in this patch is quite large too.
In the patch we introduce a new CONFIG option PREEMPTIRQ_TRACEPOINTS
as a single point for registering probes onto the tracepoints. With
this,
the web of config options for preempt/irq toggle tracepoints and its
users becomes:
PREEMPT_TRACER PREEMPTIRQ_EVENTS IRQSOFF_TRACER PROVE_LOCKING
| | \ | |
\ (selects) / \ \ (selects) /
TRACE_PREEMPT_TOGGLE ----> TRACE_IRQFLAGS
\ /
\ (depends on) /
PREEMPTIRQ_TRACEPOINTS
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
.../events/lttng-module/preemptirq.h | 37 ++++++++++++++++---
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/instrumentation/events/lttng-module/preemptirq.h b/instrumentation/events/lttng-module/preemptirq.h
index 4f9be85..2fc8117 100644
--- a/instrumentation/events/lttng-module/preemptirq.h
+++ b/instrumentation/events/lttng-module/preemptirq.h
@@ -12,6 +12,9 @@
#include <asm/sections.h>
#include <probes/lttng-tracepoint-event.h>
+/*
+ * The preemptirq probe is built when CONFIG_PREEMPTIRQ_EVENTS is defined.
+ */
LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template,
@@ -25,7 +28,19 @@ LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template,
)
)
-#ifndef CONFIG_PROVE_LOCKING
+/*
+ * Tracing of irq enable / disable events is enabled
+ * on >= 4.19 when CONFIG_TRACE_IRQFLAGS is defined.
+ * on previous kernels when CONFIG_PROVE_LOCKING is NOT defined.
+ */
+#if defined(CONFIG_TRACE_IRQFLAGS)
+#define LTTNG_TRACE_IRQ
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \
+ !defined(CONFIG_PROVE_LOCKING))
+#define LTTNG_TRACE_IRQ
+#endif
+
+#ifdef LTTNG_TRACE_IRQ
LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_disable,
preemptirq_irq_disable,
@@ -43,9 +58,21 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_enable,
TP_ARGS(ip, parent_ip)
)
-#endif /* !CONFIG_PROVE_LOCKING */
-
-#ifdef CONFIG_DEBUG_PREEMPT
+#endif /* LTTNG_TRACE_IRQ */
+
+/*
+ * Tracing of preempt enable / disable events is enabled
+ * on >= 4.19 when CONFIG_TRACE_PREEMPT_TOGGLE is defined.
+ * on previous kernels when CONFIG_DEBUG_PREEMPT is defined.
+ */
+#if defined(CONFIG_TRACE_PREEMPT_TOGGLE)
+#define LTTNG_TRACE_PREEMPT
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \
+ defined(CONFIG_DEBUG_PREEMPT))
+#define LTTNG_TRACE_PREEMPT
+#endif
+
+#ifdef LTTNG_TRACE_PREEMPT
LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_disable,
preemptirq_preempt_disable,
@@ -63,7 +90,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_enable,
TP_ARGS(ip, parent_ip)
)
-#endif /* CONFIG_DEBUG_PREEMPT */
+#endif /* LTTNG_TRACE_PREEMPT */
#endif /* LTTNG_TRACE_PREEMPTIRQ_H */
--
2.17.1
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH lttng-modules 1/2] Fix: net: expose sk wmem in sock_exceed_buf_limit tracepoint (4.19)
[not found] <20180907162113.28162-1-mjeanson@efficios.com>
2018-09-07 16:21 ` [PATCH lttng-modules 2/2] Fix: tracing: Centralize preemptirq tracepoints (4.19) Michael Jeanson
@ 2018-10-01 18:03 ` Mathieu Desnoyers
[not found] ` <20180907162113.28162-2-mjeanson@efficios.com>
2 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2018-10-01 18:03 UTC (permalink / raw)
To: Michael Jeanson; +Cc: lttng-dev
Merged into master, 2.11, 2.10, 2.9, thanks!
Mathieu
----- On Sep 7, 2018, at 12:21 PM, Michael Jeanson mjeanson@efficios.com wrote:
> See upstream commit:
>
> commit d6f19938eb031ee2158272757db33258153ae59c
> Author: Yafang Shao <laoar.shao@gmail.com>
> Date: Sun Jul 1 23:31:30 2018 +0800
>
> net: expose sk wmem in sock_exceed_buf_limit tracepoint
>
> Currently trace_sock_exceed_buf_limit() only show rmem info,
> but wmem limit may also be hit.
> So expose wmem info in this tracepoint as well.
>
> Regarding memcg, I think it is better to introduce a new tracepoint(if
> that is needed), i.e. trace_memcg_limit_hit other than show memcg info in
> trace_sock_exceed_buf_limit.
>
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> instrumentation/events/lttng-module/sock.h | 23 +++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/instrumentation/events/lttng-module/sock.h
> b/instrumentation/events/lttng-module/sock.h
> index 4bde039..a1032b3 100644
> --- a/instrumentation/events/lttng-module/sock.h
> +++ b/instrumentation/events/lttng-module/sock.h
> @@ -22,7 +22,28 @@ LTTNG_TRACEPOINT_EVENT(sock_rcvqueue_full,
> )
> )
>
> -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
> +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0))
> +
> +LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
> +
> + TP_PROTO(struct sock *sk, struct proto *prot, long allocated, int kind),
> +
> + TP_ARGS(sk, prot, allocated, kind),
> +
> + TP_FIELDS(
> + ctf_string(name, prot->name)
> + ctf_array(long, sysctl_mem, prot->sysctl_mem, 3)
> + ctf_integer(long, allocated, allocated)
> + ctf_integer(int, sysctl_rmem, sk_get_rmem0(sk, prot))
> + ctf_integer(int, rmem_alloc, atomic_read(&sk->sk_rmem_alloc))
> + ctf_integer(int, sysctl_wmem, sk_get_wmem0(sk, prot))
> + ctf_integer(int, wmem_alloc, refcount_read(&sk->sk_wmem_alloc))
> + ctf_integer(int, wmem_queued, sk->sk_wmem_queued)
> + ctf_integer(int, kind, kind)
> + )
> +)
> +
> +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
>
> LTTNG_TRACEPOINT_EVENT(sock_exceed_buf_limit,
>
> --
> 2.17.1
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH lttng-modules 2/2] Fix: tracing: Centralize preemptirq tracepoints (4.19)
[not found] ` <20180907162113.28162-2-mjeanson@efficios.com>
@ 2018-10-01 18:03 ` Mathieu Desnoyers
0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Desnoyers @ 2018-10-01 18:03 UTC (permalink / raw)
To: Michael Jeanson; +Cc: lttng-dev
Merged into master and 2.11 only, thanks!
Mathieu
----- On Sep 7, 2018, at 12:21 PM, Michael Jeanson mjeanson@efficios.com wrote:
> See upstream commit:
>
> commit c3bc8fd637a9623f5c507bd18f9677effbddf584
> Author: Joel Fernandes (Google) <joel@joelfernandes.org>
> Date: Mon Jul 30 15:24:23 2018 -0700
>
> tracing: Centralize preemptirq tracepoints and unify their usage
>
> This patch detaches the preemptirq tracepoints from the tracers and
> keeps it separate.
>
> Advantages:
> * Lockdep and irqsoff event can now run in parallel since they no longer
> have their own calls.
>
> * This unifies the usecase of adding hooks to an irqsoff and irqson
> event, and a preemptoff and preempton event.
> 3 users of the events exist:
> - Lockdep
> - irqsoff and preemptoff tracers
> - irqs and preempt trace events
>
> The unification cleans up several ifdefs and makes the code in preempt
> tracer and irqsoff tracers simpler. It gets rid of all the horrific
> ifdeferry around PROVE_LOCKING and makes configuration of the different
> users of the tracepoints more easy and understandable. It also gets rid
> of the time_* function calls from the lockdep hooks used to call into
> the preemptirq tracer which is not needed anymore. The negative delta in
> lines of code in this patch is quite large too.
>
> In the patch we introduce a new CONFIG option PREEMPTIRQ_TRACEPOINTS
> as a single point for registering probes onto the tracepoints. With
> this,
> the web of config options for preempt/irq toggle tracepoints and its
> users becomes:
>
> PREEMPT_TRACER PREEMPTIRQ_EVENTS IRQSOFF_TRACER PROVE_LOCKING
> | | \ | |
> \ (selects) / \ \ (selects) /
> TRACE_PREEMPT_TOGGLE ----> TRACE_IRQFLAGS
> \ /
> \ (depends on) /
> PREEMPTIRQ_TRACEPOINTS
>
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> .../events/lttng-module/preemptirq.h | 37 ++++++++++++++++---
> 1 file changed, 32 insertions(+), 5 deletions(-)
>
> diff --git a/instrumentation/events/lttng-module/preemptirq.h
> b/instrumentation/events/lttng-module/preemptirq.h
> index 4f9be85..2fc8117 100644
> --- a/instrumentation/events/lttng-module/preemptirq.h
> +++ b/instrumentation/events/lttng-module/preemptirq.h
> @@ -12,6 +12,9 @@
> #include <asm/sections.h>
> #include <probes/lttng-tracepoint-event.h>
>
> +/*
> + * The preemptirq probe is built when CONFIG_PREEMPTIRQ_EVENTS is defined.
> + */
>
> LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template,
>
> @@ -25,7 +28,19 @@ LTTNG_TRACEPOINT_EVENT_CLASS(preemptirq_template,
> )
> )
>
> -#ifndef CONFIG_PROVE_LOCKING
> +/*
> + * Tracing of irq enable / disable events is enabled
> + * on >= 4.19 when CONFIG_TRACE_IRQFLAGS is defined.
> + * on previous kernels when CONFIG_PROVE_LOCKING is NOT defined.
> + */
> +#if defined(CONFIG_TRACE_IRQFLAGS)
> +#define LTTNG_TRACE_IRQ
> +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \
> + !defined(CONFIG_PROVE_LOCKING))
> +#define LTTNG_TRACE_IRQ
> +#endif
> +
> +#ifdef LTTNG_TRACE_IRQ
> LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, irq_disable,
>
> preemptirq_irq_disable,
> @@ -43,9 +58,21 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template,
> irq_enable,
>
> TP_ARGS(ip, parent_ip)
> )
> -#endif /* !CONFIG_PROVE_LOCKING */
> -
> -#ifdef CONFIG_DEBUG_PREEMPT
> +#endif /* LTTNG_TRACE_IRQ */
> +
> +/*
> + * Tracing of preempt enable / disable events is enabled
> + * on >= 4.19 when CONFIG_TRACE_PREEMPT_TOGGLE is defined.
> + * on previous kernels when CONFIG_DEBUG_PREEMPT is defined.
> + */
> +#if defined(CONFIG_TRACE_PREEMPT_TOGGLE)
> +#define LTTNG_TRACE_PREEMPT
> +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0) && \
> + defined(CONFIG_DEBUG_PREEMPT))
> +#define LTTNG_TRACE_PREEMPT
> +#endif
> +
> +#ifdef LTTNG_TRACE_PREEMPT
> LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template, preempt_disable,
>
> preemptirq_preempt_disable,
> @@ -63,7 +90,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(preemptirq_template,
> preempt_enable,
>
> TP_ARGS(ip, parent_ip)
> )
> -#endif /* CONFIG_DEBUG_PREEMPT */
> +#endif /* LTTNG_TRACE_PREEMPT */
>
> #endif /* LTTNG_TRACE_PREEMPTIRQ_H */
>
> --
> 2.17.1
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-01 18:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20180907162113.28162-1-mjeanson@efficios.com>
2018-09-07 16:21 ` [PATCH lttng-modules 2/2] Fix: tracing: Centralize preemptirq tracepoints (4.19) Michael Jeanson
2018-10-01 18:03 ` [PATCH lttng-modules 1/2] Fix: net: expose sk wmem in sock_exceed_buf_limit tracepoint (4.19) Mathieu Desnoyers
[not found] ` <20180907162113.28162-2-mjeanson@efficios.com>
2018-10-01 18:03 ` [PATCH lttng-modules 2/2] Fix: tracing: Centralize preemptirq tracepoints (4.19) Mathieu Desnoyers
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.