* [6/6] dma: tegra: add tracepoint for residual update
@ 2018-10-12 9:44 Ben Dooks
0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2018-10-12 9:44 UTC (permalink / raw)
To: dan.j.williams, vkoul
Cc: ldewangan, dmaengine, linux-tegra, Ben Dooks, Ingo Molnar,
Steven Rostedt
Add a tracepoint in the residual update instead of using dev_dbg()
to allow debugging via the trace pipe.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Ingo Molnar <mingo@redhat.com> (maintainer:TRACING)
Cc: Steven Rostedt <rostedt@goodmis.org> (maintainer:TRACING)
---
drivers/dma/tegra20-apb-dma.c | 5 ++---
include/trace/events/tegra_apb_dma.h | 27 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 96095a3b7edd..495cda6c21b9 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -886,9 +886,8 @@ static unsigned int tegra_dma_update_residual(struct tegra_dma_channel *tdc,
}
done:
- dev_dbg(tdc2dev(tdc), "residual: req %08lx, ahb@%08lx, wcount %08lx, done %d\n",
- sg_req->ch_regs.ahb_ptr, ahbptr, wcount, done);
-
+ trace_tegra_dma_tx_state(&tdc->dma_chan, ahbptr, status, result,
+ tmp, residual);
return result;
}
diff --git a/include/trace/events/tegra_apb_dma.h b/include/trace/events/tegra_apb_dma.h
index 80d6f0cf4c36..a686f98a9c8b 100644
--- a/include/trace/events/tegra_apb_dma.h
+++ b/include/trace/events/tegra_apb_dma.h
@@ -43,6 +43,33 @@ TRACE_EVENT(tegra_dma_complete_cb,
__entry->count, __entry->ptr)
);
+TRACE_EVENT(tegra_dma_tx_state,
+ TP_PROTO(struct dma_chan *dc, unsigned long ahb,
+ unsigned long wc, unsigned int done,
+ unsigned long byte_count, unsigned int residual),
+ TP_ARGS(dc, ahb, wc, done, byte_count, residual),
+ TP_STRUCT__entry(
+ __field(struct dma_chan *, dc)
+ __field(unsigned long, ahb)
+ __field(unsigned long, wc)
+ __field(unsigned long, done)
+ __field(unsigned int, residual)
+ __field(unsigned long, byte_count)
+ ),
+ TP_fast_assign(
+ __entry->dc = dc;
+ __entry->ahb = ahb;
+ __entry->wc = wc;
+ __entry->done = done;
+ __entry->residual = residual;
+ __entry->byte_count = byte_count;
+ ),
+ TP_printk("%s: txresidual: ahb %08lx wc %08lx => done %lu bc %lu residual %u",
+ dev_name(&__entry->dc->dev->device),
+ __entry->ahb, __entry->wc, __entry->done,
+ __entry->byte_count, __entry->residual)
+);
+
TRACE_EVENT(tegra_dma_isr,
TP_PROTO(struct dma_chan *dc, int irq),
TP_ARGS(dc, irq),
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [6/6] dma: tegra: add tracepoint for residual update
@ 2018-10-31 16:03 Ben Dooks
0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2018-10-31 16:03 UTC (permalink / raw)
To: dan.j.williams, vkoul
Cc: ldewangan, dmaengine, linux-tegra, Ben Dooks, Ingo Molnar,
Steven Rostedt
Add a tracepoint in the residual update instead of using dev_dbg()
to allow debugging via the trace pipe.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Fixes since v1:
- copy the devname instead of referencing the dmachan device
Cc: Ingo Molnar <mingo@redhat.com> (maintainer:TRACING)
Cc: Steven Rostedt <rostedt@goodmis.org> (maintainer:TRACING)
---
drivers/dma/tegra20-apb-dma.c | 5 ++---
include/trace/events/tegra_apb_dma.h | 27 +++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 22114c9a6e98..211efea67db6 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -886,9 +886,8 @@ static unsigned int tegra_dma_update_residual(struct tegra_dma_channel *tdc,
}
done:
- dev_dbg(tdc2dev(tdc), "residual: req %08lx, ahb@%08lx, wcount %08lx, done %d\n",
- sg_req->ch_regs.ahb_ptr, ahbptr, wcount, done);
-
+ trace_tegra_dma_tx_state(&tdc->dma_chan, ahbptr, status, result,
+ tmp, residual);
return result;
}
diff --git a/include/trace/events/tegra_apb_dma.h b/include/trace/events/tegra_apb_dma.h
index 1f55c2c6049d..8fa0f0974828 100644
--- a/include/trace/events/tegra_apb_dma.h
+++ b/include/trace/events/tegra_apb_dma.h
@@ -41,6 +41,33 @@ TRACE_EVENT(tegra_dma_complete_cb,
__get_str(chan), __entry->count, __entry->ptr)
);
+TRACE_EVENT(tegra_dma_tx_state,
+ TP_PROTO(struct dma_chan *dc, unsigned long ahb,
+ unsigned long wc, unsigned int done,
+ unsigned long byte_count, unsigned int residual),
+ TP_ARGS(dc, ahb, wc, done, byte_count, residual),
+ TP_STRUCT__entry(
+ __string(chan, 16)
+ __field(unsigned long, ahb)
+ __field(unsigned long, wc)
+ __field(unsigned long, done)
+ __field(unsigned int, residual)
+ __field(unsigned long, byte_count)
+ ),
+ TP_fast_assign(
+ __assign_str(chan, dev_name(&dc->dev->device));
+ __entry->ahb = ahb;
+ __entry->wc = wc;
+ __entry->done = done;
+ __entry->residual = residual;
+ __entry->byte_count = byte_count;
+ ),
+ TP_printk("%s: txresidual: ahb %08lx wc %08lx => done %lu bc %lu residual %u",
+ __get_str(chan),
+ __entry->ahb, __entry->wc, __entry->done,
+ __entry->byte_count, __entry->residual)
+);
+
TRACE_EVENT(tegra_dma_isr,
TP_PROTO(struct dma_chan *dc, int irq),
TP_ARGS(dc, irq),
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [6/6] dma: tegra: add tracepoint for residual update
@ 2018-10-31 14:08 Ben Dooks
0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2018-10-31 14:08 UTC (permalink / raw)
To: Steven Rostedt
Cc: dan.j.williams, vkoul, ldewangan, dmaengine, linux-tegra, Ingo Molnar
On 2018-10-12 18:04, Steven Rostedt wrote:
> On Fri, 12 Oct 2018 10:44:54 +0100
> Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>
>> Add a tracepoint in the residual update instead of using dev_dbg()
>> to allow debugging via the trace pipe.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>> Cc: Ingo Molnar <mingo@redhat.com> (maintainer:TRACING)
>> Cc: Steven Rostedt <rostedt@goodmis.org> (maintainer:TRACING)
>> ---
>> drivers/dma/tegra20-apb-dma.c | 5 ++---
>> include/trace/events/tegra_apb_dma.h | 27 +++++++++++++++++++++++++++
>> 2 files changed, 29 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/dma/tegra20-apb-dma.c
>> b/drivers/dma/tegra20-apb-dma.c
>> index 96095a3b7edd..495cda6c21b9 100644
>> --- a/drivers/dma/tegra20-apb-dma.c
>> +++ b/drivers/dma/tegra20-apb-dma.c
>> @@ -886,9 +886,8 @@ static unsigned int
>> tegra_dma_update_residual(struct tegra_dma_channel *tdc,
>> }
>>
>> done:
>> - dev_dbg(tdc2dev(tdc), "residual: req %08lx, ahb@%08lx, wcount %08lx,
>> done %d\n",
>> - sg_req->ch_regs.ahb_ptr, ahbptr, wcount, done);
>> -
>> + trace_tegra_dma_tx_state(&tdc->dma_chan, ahbptr, status, result,
>> + tmp, residual);
>> return result;
>> }
>>
>> diff --git a/include/trace/events/tegra_apb_dma.h
>> b/include/trace/events/tegra_apb_dma.h
>> index 80d6f0cf4c36..a686f98a9c8b 100644
>> --- a/include/trace/events/tegra_apb_dma.h
>> +++ b/include/trace/events/tegra_apb_dma.h
>> @@ -43,6 +43,33 @@ TRACE_EVENT(tegra_dma_complete_cb,
>> __entry->count, __entry->ptr)
>> );
>>
>> +TRACE_EVENT(tegra_dma_tx_state,
>> + TP_PROTO(struct dma_chan *dc, unsigned long ahb,
>> + unsigned long wc, unsigned int done,
>> + unsigned long byte_count, unsigned int residual),
>> + TP_ARGS(dc, ahb, wc, done, byte_count, residual),
>> + TP_STRUCT__entry(
>> + __field(struct dma_chan *, dc)
>> + __field(unsigned long, ahb)
>> + __field(unsigned long, wc)
>> + __field(unsigned long, done)
>> + __field(unsigned int, residual)
>> + __field(unsigned long, byte_count)
>> + ),
>> + TP_fast_assign(
>> + __entry->dc = dc;
>> + __entry->ahb = ahb;
>> + __entry->wc = wc;
>> + __entry->done = done;
>> + __entry->residual = residual;
>> + __entry->byte_count = byte_count;
>> + ),
>> + TP_printk("%s: txresidual: ahb %08lx wc %08lx => done %lu bc %lu
>> residual %u",
>> + dev_name(&__entry->dc->dev->device),
>
> Here too. Move the dev_name() up into TP_fast_assign() which gets
> executed at the time of call of the trace event. The TP_printk() can
> happen any time later, when someone reads the tracing buffer.
Ok, thanks for pointing that out. I will fix for next set.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [6/6] dma: tegra: add tracepoint for residual update
@ 2018-10-12 17:04 Steven Rostedt
0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2018-10-12 17:04 UTC (permalink / raw)
To: Ben Dooks
Cc: dan.j.williams, vkoul, ldewangan, dmaengine, linux-tegra, Ingo Molnar
On Fri, 12 Oct 2018 10:44:54 +0100
Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> Add a tracepoint in the residual update instead of using dev_dbg()
> to allow debugging via the trace pipe.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Cc: Ingo Molnar <mingo@redhat.com> (maintainer:TRACING)
> Cc: Steven Rostedt <rostedt@goodmis.org> (maintainer:TRACING)
> ---
> drivers/dma/tegra20-apb-dma.c | 5 ++---
> include/trace/events/tegra_apb_dma.h | 27 +++++++++++++++++++++++++++
> 2 files changed, 29 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
> index 96095a3b7edd..495cda6c21b9 100644
> --- a/drivers/dma/tegra20-apb-dma.c
> +++ b/drivers/dma/tegra20-apb-dma.c
> @@ -886,9 +886,8 @@ static unsigned int tegra_dma_update_residual(struct tegra_dma_channel *tdc,
> }
>
> done:
> - dev_dbg(tdc2dev(tdc), "residual: req %08lx, ahb@%08lx, wcount %08lx, done %d\n",
> - sg_req->ch_regs.ahb_ptr, ahbptr, wcount, done);
> -
> + trace_tegra_dma_tx_state(&tdc->dma_chan, ahbptr, status, result,
> + tmp, residual);
> return result;
> }
>
> diff --git a/include/trace/events/tegra_apb_dma.h b/include/trace/events/tegra_apb_dma.h
> index 80d6f0cf4c36..a686f98a9c8b 100644
> --- a/include/trace/events/tegra_apb_dma.h
> +++ b/include/trace/events/tegra_apb_dma.h
> @@ -43,6 +43,33 @@ TRACE_EVENT(tegra_dma_complete_cb,
> __entry->count, __entry->ptr)
> );
>
> +TRACE_EVENT(tegra_dma_tx_state,
> + TP_PROTO(struct dma_chan *dc, unsigned long ahb,
> + unsigned long wc, unsigned int done,
> + unsigned long byte_count, unsigned int residual),
> + TP_ARGS(dc, ahb, wc, done, byte_count, residual),
> + TP_STRUCT__entry(
> + __field(struct dma_chan *, dc)
> + __field(unsigned long, ahb)
> + __field(unsigned long, wc)
> + __field(unsigned long, done)
> + __field(unsigned int, residual)
> + __field(unsigned long, byte_count)
> + ),
> + TP_fast_assign(
> + __entry->dc = dc;
> + __entry->ahb = ahb;
> + __entry->wc = wc;
> + __entry->done = done;
> + __entry->residual = residual;
> + __entry->byte_count = byte_count;
> + ),
> + TP_printk("%s: txresidual: ahb %08lx wc %08lx => done %lu bc %lu residual %u",
> + dev_name(&__entry->dc->dev->device),
Here too. Move the dev_name() up into TP_fast_assign() which gets
executed at the time of call of the trace event. The TP_printk() can
happen any time later, when someone reads the tracing buffer.
-- Steve
> + __entry->ahb, __entry->wc, __entry->done,
> + __entry->byte_count, __entry->residual)
> +);
> +
> TRACE_EVENT(tegra_dma_isr,
> TP_PROTO(struct dma_chan *dc, int irq),
> TP_ARGS(dc, irq),
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-31 16:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-12 9:44 [6/6] dma: tegra: add tracepoint for residual update Ben Dooks
2018-10-12 17:04 Steven Rostedt
2018-10-31 14:08 Ben Dooks
2018-10-31 16:03 Ben Dooks
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.