* Re: [PATCH v2] ufs: core: add hba parameter to trace events
[not found] ` <16f26ea9-69d6-4f2f-9adc-c576c288a2f5@acm.org>
@ 2026-06-30 22:58 ` Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2026-06-30 22:58 UTC (permalink / raw)
To: Bart Van Assche
Cc: peter.wang, linux-scsi, martin.petersen, avri.altman, alim.akhtar,
jejb, sutoshd, wsd_upstream, linux-mediatek, chun-hung.wu,
alice.chao, cc.chou, chaotian.jing, jiajie.hao, yi-fan.peng,
qilin.tan, lin.gui, tun-yu.yu, eddie.huang, naomi.chu, ed.tsai,
Linux Trace Kernel
On Thu, 13 Feb 2025 09:19:42 -0800
Bart Van Assche <bvanassche@acm.org> wrote:
> On 2/13/25 3:35 AM, peter.wang@mediatek.com wrote:
> > diff --git a/drivers/ufs/core/ufs_trace.h b/drivers/ufs/core/ufs_trace.h
> > index 84deca2b841d..2f79982846b6 100644
> > --- a/drivers/ufs/core/ufs_trace.h
> > +++ b/drivers/ufs/core/ufs_trace.h
> > @@ -83,16 +83,18 @@ UFS_CMD_TRACE_TSF_TYPES
> >
> > TRACE_EVENT(ufshcd_clk_gating,
> >
> > - TP_PROTO(const char *dev_name, int state),
> > + TP_PROTO(struct ufs_hba *hba, int state),
> >
> > - TP_ARGS(dev_name, state),
> > + TP_ARGS(hba, state),
> >
> > TP_STRUCT__entry(
> > - __string(dev_name, dev_name)
> > + __field(struct ufs_hba *, hba)
> > + __string(dev_name, dev_name(hba->dev))
> > __field(int, state)
> > ),
>
> Please reduce the size of the tracing entries by removing dev_name from
> TP_STRUCT__entry() and by replacing 'dev_name' with 'dev_name(hba->dev)'
> in the TP_printk() calls.
For future references, please do not recommend moving dereferences into the
TP_printk() callers. Those happen when the event is read by the user and
the hba pointer may no longer exist.
-- Steve
^ permalink raw reply [flat|nested] only message in thread