* [PATCH net-next] net: cpmac: fix in debug messages
@ 2014-07-10 9:59 varkabhadram
2014-07-10 10:04 ` David Laight
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: varkabhadram @ 2014-07-10 9:59 UTC (permalink / raw)
To: netdev; +Cc: mugunthanvnm, linux, balbi, george.cherian, davem, Varka Bhadram
From: Varka Bhadram <varkab@cdac.in>
This patch fix the debug message format. This patch changes to the
commit f160a2d0b524eeebd97a68e2fbb59fad4cdd3fee: net: cpmac: dynamic debug fixes
When we use pr_debug()/netdev_dbg() new lines are inserting in b/w
the values. The format when i use the printk()
These formats used in skb dump and reg dump. This functions
called from the entire code. So this will be enabled all the lines.
Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
drivers/net/ethernet/ti/cpmac.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index b68c5b5..3809f4e 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -228,22 +228,22 @@ static void cpmac_dump_regs(struct net_device *dev)
for (i = 0; i < CPMAC_REG_END; i += 4) {
if (i % 16 == 0) {
if (i)
- pr_cont("\n");
- netdev_dbg(dev, "reg[%p]:", priv->regs + i);
+ printk("\n");
+ printk("%s: reg[%p]:", dev->name, priv->regs + i);
}
- pr_debug(" %08x", cpmac_read(priv->regs, i));
+ printk(" %08x", cpmac_read(priv->regs, i));
}
- pr_debug("\n");
+ printk("\n");
}
static void cpmac_dump_desc(struct net_device *dev, struct cpmac_desc *desc)
{
int i;
- netdev_dbg(dev, "desc[%p]:", desc);
+ printk("%s: desc[%p]:", dev->name, desc);
for (i = 0; i < sizeof(*desc) / 4; i++)
- pr_debug(" %08x", ((u32 *)desc)[i]);
- pr_debug("\n");
+ printk(" %08x", ((u32 *)desc)[i]);
+ printk("\n");
}
static void cpmac_dump_all_desc(struct net_device *dev)
@@ -261,16 +261,16 @@ static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
{
int i;
- netdev_dbg(dev, "skb 0x%p, len=%d\n", skb, skb->len);
+ printk("%s: skb 0x%p, len=%d\n", dev->name, skb, skb->len);
for (i = 0; i < skb->len; i++) {
if (i % 16 == 0) {
if (i)
- pr_cont("\n");
- netdev_dbg(dev, "data[%p]:", skb->data + i);
+ printk("\n");
+ printk("%s: data[%p]:", dev->name, skb->data + i);
}
- pr_debug(" %02x", ((u8 *)skb->data)[i]);
+ printk(" %02x", ((u8 *)skb->data)[i]);
}
- pr_debug("\n");
+ printk("\n");
}
static int cpmac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH net-next] net: cpmac: fix in debug messages
2014-07-10 9:59 [PATCH net-next] net: cpmac: fix in debug messages varkabhadram
@ 2014-07-10 10:04 ` David Laight
2014-07-10 17:31 ` Sergei Shtylyov
2014-07-10 23:55 ` David Miller
2 siblings, 0 replies; 5+ messages in thread
From: David Laight @ 2014-07-10 10:04 UTC (permalink / raw)
To: 'varkabhadram@gmail.com', netdev@vger.kernel.org
Cc: mugunthanvnm@ti.com, linux@rainbow-software.org, balbi@ti.com,
george.cherian@ti.com, davem@davemloft.net, Varka Bhadram
From: varkabhadram@gmail.com
> This patch fix the debug message format. This patch changes to the
> commit f160a2d0b524eeebd97a68e2fbb59fad4cdd3fee: net: cpmac: dynamic debug fixes
>
> When we use pr_debug()/netdev_dbg() new lines are inserting in b/w
> the values. The format when i use the printk()
>
> These formats used in skb dump and reg dump. This functions
> called from the entire code. So this will be enabled all the lines.
Actually it is much better to use a single print for each line.
Otherwise the output can get interleaved.
This might need a temporary buffer.
David
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
> ---
> drivers/net/ethernet/ti/cpmac.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
> index b68c5b5..3809f4e 100644
> --- a/drivers/net/ethernet/ti/cpmac.c
> +++ b/drivers/net/ethernet/ti/cpmac.c
> @@ -228,22 +228,22 @@ static void cpmac_dump_regs(struct net_device *dev)
> for (i = 0; i < CPMAC_REG_END; i += 4) {
> if (i % 16 == 0) {
> if (i)
> - pr_cont("\n");
> - netdev_dbg(dev, "reg[%p]:", priv->regs + i);
> + printk("\n");
> + printk("%s: reg[%p]:", dev->name, priv->regs + i);
> }
> - pr_debug(" %08x", cpmac_read(priv->regs, i));
> + printk(" %08x", cpmac_read(priv->regs, i));
> }
> - pr_debug("\n");
> + printk("\n");
> }
>
> static void cpmac_dump_desc(struct net_device *dev, struct cpmac_desc *desc)
> {
> int i;
>
> - netdev_dbg(dev, "desc[%p]:", desc);
> + printk("%s: desc[%p]:", dev->name, desc);
> for (i = 0; i < sizeof(*desc) / 4; i++)
> - pr_debug(" %08x", ((u32 *)desc)[i]);
> - pr_debug("\n");
> + printk(" %08x", ((u32 *)desc)[i]);
> + printk("\n");
> }
>
> static void cpmac_dump_all_desc(struct net_device *dev)
> @@ -261,16 +261,16 @@ static void cpmac_dump_skb(struct net_device *dev, struct sk_buff *skb)
> {
> int i;
>
> - netdev_dbg(dev, "skb 0x%p, len=%d\n", skb, skb->len);
> + printk("%s: skb 0x%p, len=%d\n", dev->name, skb, skb->len);
> for (i = 0; i < skb->len; i++) {
> if (i % 16 == 0) {
> if (i)
> - pr_cont("\n");
> - netdev_dbg(dev, "data[%p]:", skb->data + i);
> + printk("\n");
> + printk("%s: data[%p]:", dev->name, skb->data + i);
> }
> - pr_debug(" %02x", ((u8 *)skb->data)[i]);
> + printk(" %02x", ((u8 *)skb->data)[i]);
> }
> - pr_debug("\n");
> + printk("\n");
> }
>
> static int cpmac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: cpmac: fix in debug messages
2014-07-10 9:59 [PATCH net-next] net: cpmac: fix in debug messages varkabhadram
2014-07-10 10:04 ` David Laight
@ 2014-07-10 17:31 ` Sergei Shtylyov
2014-07-10 18:18 ` Joe Perches
2014-07-10 23:55 ` David Miller
2 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2014-07-10 17:31 UTC (permalink / raw)
To: varkabhadram, netdev
Cc: mugunthanvnm, linux, balbi, george.cherian, davem, Varka Bhadram
Hello.
On 07/10/2014 01:59 PM, varkabhadram@gmail.com wrote:
> From: Varka Bhadram <varkab@cdac.in>
> This patch fix the debug message format. This patch changes to the
> commit f160a2d0b524eeebd97a68e2fbb59fad4cdd3fee: net: cpmac: dynamic debug fixes
> When we use pr_debug()/netdev_dbg() new lines are inserting in b/w
> the values. The format when i use the printk()
Please use pr_cont() instead.
> These formats used in skb dump and reg dump. This functions
> called from the entire code. So this will be enabled all the lines.
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: cpmac: fix in debug messages
2014-07-10 17:31 ` Sergei Shtylyov
@ 2014-07-10 18:18 ` Joe Perches
0 siblings, 0 replies; 5+ messages in thread
From: Joe Perches @ 2014-07-10 18:18 UTC (permalink / raw)
To: Sergei Shtylyov, Jason Baron
Cc: varkabhadram, netdev, mugunthanvnm, linux, balbi, george.cherian,
davem, Varka Bhadram
On Thu, 2014-07-10 at 21:31 +0400, Sergei Shtylyov wrote:
> > When we use pr_debug()/netdev_dbg() new lines are inserting in b/w
> > the values. The format when i use the printk()
>
> Please use pr_cont() instead.
Using pr_cont to continue a <foo>_dbg statement is
ineffective.
There really should be a <foo>_dbg_cont mechanism,
but neither normal pr_debug nor dynamic debug support
such a thing.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: cpmac: fix in debug messages
2014-07-10 9:59 [PATCH net-next] net: cpmac: fix in debug messages varkabhadram
2014-07-10 10:04 ` David Laight
2014-07-10 17:31 ` Sergei Shtylyov
@ 2014-07-10 23:55 ` David Miller
2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2014-07-10 23:55 UTC (permalink / raw)
To: varkabhadram; +Cc: netdev, mugunthanvnm, linux, balbi, george.cherian, varkab
From: varkabhadram@gmail.com
Date: Thu, 10 Jul 2014 15:29:38 +0530
> From: Varka Bhadram <varkab@cdac.in>
>
> This patch fix the debug message format. This patch changes to the
> commit f160a2d0b524eeebd97a68e2fbb59fad4cdd3fee: net: cpmac: dynamic debug fixes
>
> When we use pr_debug()/netdev_dbg() new lines are inserting in b/w
> the values. The format when i use the printk()
>
> These formats used in skb dump and reg dump. This functions
> called from the entire code. So this will be enabled all the lines.
>
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
Applied, thank you.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-10 23:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-10 9:59 [PATCH net-next] net: cpmac: fix in debug messages varkabhadram
2014-07-10 10:04 ` David Laight
2014-07-10 17:31 ` Sergei Shtylyov
2014-07-10 18:18 ` Joe Perches
2014-07-10 23:55 ` David Miller
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).