devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yunfei Dong (董云飞)" <Yunfei.Dong@mediatek.com>
To: "wenst@chromium.org" <wenst@chromium.org>,
	"nfraprado@collabora.com" <nfraprado@collabora.com>,
	"nicolas@ndufresne.ca" <nicolas@ndufresne.ca>,
	"angelogioacchino.delregno@collabora.com" 
	<angelogioacchino.delregno@collabora.com>,
	"benjamin.gaignard@collabora.com"
	<benjamin.gaignard@collabora.com>,
	"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>,
	"frkoenig@chromium.org" <frkoenig@chromium.org>,
	"stevecho@chromium.org" <stevecho@chromium.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>,
	Project_Global_Chrome_Upstream_Group 
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"hsinyi@chromium.org" <hsinyi@chromium.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Subject: Re: [PATCH v2,2/7] media: mediatek: vcodec: Add debug params to control different log level
Date: Thu, 23 Mar 2023 01:40:49 +0000	[thread overview]
Message-ID: <fa719c9b76b82f9d0ca299a088b69ae90d2beb75.camel@mediatek.com> (raw)
In-Reply-To: <4da63f5b-87f3-89be-31fc-f574a1d7c9bd@collabora.com>

Hi AngeloGioacchino

Thanks for you suggestion.

On Wed, 2023-03-22 at 14:49 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Il 22/03/23 10:46, Yunfei Dong ha scritto:
> > Add parameter mtk_vcodec_dbg to open each codec log.
> > Add parameter mtk_v4l2_dbg_level to open each instance log
> > according to
> > the parameter value.
> > 
> > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> > ---
> >   .../mediatek/vcodec/mtk_vcodec_dbgfs.c        |  2 ++
> >   .../mediatek/vcodec/mtk_vcodec_util.c         |  8 ++++++
> >   .../mediatek/vcodec/mtk_vcodec_util.h         | 25
> > ++++++++++++++++---
> >   3 files changed, 32 insertions(+), 3 deletions(-)
> > 
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
> > b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
> > index fb9edd379af5..b5093e4e4aa2 100644
> > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
> > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
> > @@ -20,6 +20,8 @@ void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev
> > *vcodec_dev)
> >                       IS_ERR(vcodec_dev->dbgfs.vcodec_root));
> > 
> >       vcodec_root = vcodec_dev->dbgfs.vcodec_root;
> > +     debugfs_create_x32("mtk_v4l2_dbg_level", 0644, vcodec_root,
> > &mtk_v4l2_dbg_level);
> > +     debugfs_create_x32("mtk_vcodec_dbg", 0644, vcodec_root,
> > &mtk_vcodec_dbg);
> >   }
> >   EXPORT_SYMBOL_GPL(mtk_vcodec_dbgfs_init);
> > 
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c
> > b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c
> > index ace78c4b5b9e..f214e6f67005 100644
> > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c
> > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.c
> > @@ -13,6 +13,14 @@
> >   #include "mtk_vcodec_drv.h"
> >   #include "mtk_vcodec_util.h"
> > 
> > +#if defined(CONFIG_DEBUG_FS)
> > +int mtk_vcodec_dbg;
> > +EXPORT_SYMBOL(mtk_vcodec_dbg);
> > +
> > +int mtk_v4l2_dbg_level;
> > +EXPORT_SYMBOL(mtk_v4l2_dbg_level);
> > +#endif
> > +
> >   void __iomem *mtk_vcodec_get_reg_addr(struct mtk_vcodec_ctx
> > *data,
> >                                       unsigned int reg_idx)
> >   {
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h
> > b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h
> > index 71956627a0e2..938f03cab3c9 100644
> > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h
> > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h
> > @@ -35,15 +35,34 @@ struct mtk_vcodec_dev;
> >       pr_err("[MTK_VCODEC][ERROR][%d]: " fmt "\n",            \
> >              ((struct mtk_vcodec_ctx *)(h)->ctx)->id, ##args)
> > 
> > +#if defined(CONFIG_DEBUG_FS)
> > +extern int mtk_v4l2_dbg_level;
> > +extern int mtk_vcodec_dbg;
> > 
> > -#define mtk_v4l2_debug(level, fmt, args...) pr_debug(fmt, ##args)
> > +#define mtk_v4l2_debug(level, fmt,
> > args...)                           \
> > +     do
> > {                                                             \
> > +             if (mtk_v4l2_dbg_level >=
> > level)                         \
> > +                     pr_info("[MTK_V4L2] level=%d %s(),%d: " fmt
> > "\n", \
> 
> These shall still be *debug* and not *info*, even if you're
> controlling the
> log level from debugfs, as these are anyway debugging prints which
> can be
> automatically optimized out for a kernel build with *no debug at
> all*.
> 
I can change it from *info* to *debug*.
> The loglevel control is a commodity that should be meant to avoid too
> much
> spam for readability and/or selectively enable "components" logging,
> because
> then there's also the tracing framework providing maximum verbosity.
> 
I can't understand here very well. Whether you mean that just need to
print useful debug information, no need to add so many prefix
"[MTK_V4L2] level=%d %s(),"? 

> Besides, I'd be happy if this finally becomes dev_dbg instead of
> pr_debug.
> 
Need to change so many log to use dev_dbg, pr_debug should be also ok.
Maybe I can change it with dev_dbg in the future.
> Regards,
> Angelo
> 
Best Regards,
Yunfei Dong
> 

  reply	other threads:[~2023-03-23  1:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  9:46 [PATCH v2,0/7] media: mediatek: vcodec: Add debugfs file for decode and encode Yunfei Dong
2023-03-22  9:46 ` [PATCH v2,1/7] media: mediatek: vcodec: Add debugfs interface to get debug information Yunfei Dong
2023-03-22  9:46 ` [PATCH v2,2/7] media: mediatek: vcodec: Add debug params to control different log level Yunfei Dong
2023-03-22 13:49   ` AngeloGioacchino Del Regno
2023-03-23  1:40     ` Yunfei Dong (董云飞) [this message]
2023-03-22  9:46 ` [PATCH v2,3/7] media: mediatek: vcodec: Add a debugfs file to get different useful information Yunfei Dong
2023-03-22 12:12   ` AngeloGioacchino Del Regno
2023-03-22  9:46 ` [PATCH v2,4/7] media: mediatek: vcodec: Get each context resolution information Yunfei Dong
2023-03-22  9:46 ` [PATCH v2,5/7] media: mediatek: vcodec: Get get each instance format type Yunfei Dong
2023-03-22 12:12   ` AngeloGioacchino Del Regno
2023-03-23  1:57     ` Yunfei Dong (董云飞)
2023-03-22  9:46 ` [PATCH v2,6/7] media: mediatek: vcodec: Change dbgfs interface to support encode Yunfei Dong
2023-03-22  9:46 ` [PATCH v2,7/7] media: mediatek: vcodec: Add encode to support dbgfs Yunfei Dong

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=fa719c9b76b82f9d0ca299a088b69ae90d2beb75.camel@mediatek.com \
    --to=yunfei.dong@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=frkoenig@chromium.org \
    --cc=hsinyi@chromium.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nfraprado@collabora.com \
    --cc=nicolas@ndufresne.ca \
    --cc=stevecho@chromium.org \
    --cc=wenst@chromium.org \
    /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 NNTP newsgroup(s).