Re: [PATCH v1 3/4] scsi: ufs: add trace events and dump prints for debug

From: Steven Rostedt
Date: Tue Feb 03 2015 - 11:54:05 EST


On Tue, 3 Feb 2015 17:37:19 +0200
Gilad Broner <gbroner@xxxxxxxxxxxxxx> wrote:

> Add trace events to driver to allow monitoring and profilig
> of activities such as PM suspend/resume, hibernate enter/exit,
> clock gating and clock scaling up/down.
> In addition, add UFS host controller register dumps to provide
> detailed information in case of errors to assist in analysis
> of issues.
>
> Signed-off-by: Dolev Raviv <draviv@xxxxxxxxxxxxxx>
> Signed-off-by: Subhash Jadavani <subhashj@xxxxxxxxxxxxxx>
> Signed-off-by: Lee Susman <lsusman@xxxxxxxxxxxxxx>
> Signed-off-by: Sujit Reddy Thumma <sthumma@xxxxxxxxxxxxxx>
> Signed-off-by: Yaniv Gardi <ygardi@xxxxxxxxxxxxxx>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 53 +++++
> drivers/scsi/ufs/ufshcd.c | 509 ++++++++++++++++++++++++++++++++++++++++---
> drivers/scsi/ufs/ufshcd.h | 49 ++++-
> drivers/scsi/ufs/ufshci.h | 1 +
> include/linux/ftrace_event.h | 3 +
> include/trace/events/ufs.h | 227 +++++++++++++++++++



> +static inline void ufshcd_cond_add_cmd_trace(struct ufs_hba *hba,
> + unsigned int tag, const char *str)
> +{
> + if (FTRACE_EVENT_ENABLED(ufshcd_command))

What's this? Not mentioned at all in the change log.

> + ufshcd_add_command_trace(hba, tag, str);
> +}
> +#else



> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> index 0bebb5c..54a4a63 100644
> --- a/include/linux/ftrace_event.h
> +++ b/include/linux/ftrace_event.h
> @@ -606,4 +606,7 @@ perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
> }
> #endif
>
> +#define FTRACE_EVENT_ENABLED(name) \
> + ((event_##name).flags & (1 << (TRACE_EVENT_FL_WAS_ENABLED_BIT)))\
> +
> #endif /* _LINUX_FTRACE_EVENT_H */

NACK!

Please use trace_<event>_enabled(), for instance,
trace_ufshcd_command_enabled().

This also uses jump_labels and is a nop when it is not enabled.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/