[PATCH 0/4] drm/amd/powerplay: introduce the cgs print helpers
Huang Rui
ray.huang at amd.com
Thu Dec 22 10:52:41 UTC 2016
On Thu, Dec 08, 2016 at 09:04:13PM +0800, Grazvydas Ignotas wrote:
> On Thu, Dec 8, 2016 at 11:50 AM, Huang Rui <ray.huang at amd.com> wrote:
> > On Thu, Dec 08, 2016 at 05:27:30PM +0800, Christian König wrote:
> >> Am 08.12.2016 um 10:02 schrieb Huang Rui:
> >> > On Thu, Dec 08, 2016 at 04:41:04PM +0800, Koenig, Christian wrote:
> >
> >> Using the dev_* prints in the powerplay code is fine, but don't use the
> >> CGS or any other abstraction layer for them.
> >>
> >
> > Powerplay is quite independent component without amdgpu object, it is
> > hard to use dev_* prints without any abstraction layer.
>
> Maybe you could use dev_set_name() with something powerplay related on
> relevant devices and then dev_* will print what you want?
>
> Alternatively you could do
>
> #define pr_fmt(fmt) "[powerplay] " fmt
>
> before #include <linux/...> and then all pr_* functions will prefix
> their messages.
>
Hi Grazvydas,
I tried to put that macro before all #include <linux/...>, but complier always get a redefined warnning.
CC [M] /home/ray/gpu/BUILD/x86_64/linux/drivers/gpu/drm/amd/amdgpu//../powerplay/amd_powerplay.o
/home/ray/gpu/BUILD/x86_64/linux/drivers/gpu/drm/amd/amdgpu//../powerplay/amd_powerplay.c:24:0: warning: "pr_fmt" redefined
#define pr_fmt(fmt) "[powerplay] " fmt
^
In file included from include/linux/kernel.h:13:0,
from include/linux/list.h:8,
from include/linux/agp_backend.h:33,
from include/drm/drmP.h:35,
from <command-line>:0:
include/linux/printk.h:248:0: note: this is the location of the previous definition
#define pr_fmt(fmt) fmt
^
Thanks,
Rui
More information about the amd-gfx
mailing list