2010-11-10 00:31:10

by David Brown

[permalink] [raw]
Subject: [PATCH] msm: smd: Reduce driver log chatter

The MSM smd driver logs numerous messages during startup that are
useful for debug purposes. Change these to pr_debug() to match their
purpose.

Signed-off-by: David Brown <[email protected]>
---
arch/arm/mach-msm/smd.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index f07dc7c..544e4de 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -89,7 +89,7 @@ static void smd_diag(void)
x = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG);
if (x != 0) {
x[SZ_DIAG_ERR_MSG - 1] = 0;
- pr_info("smem: DIAG '%s'\n", x);
+ pr_debug("smem: DIAG '%s'\n", x);
}
}

@@ -312,7 +312,7 @@ static void smd_state_change(struct smd_channel *ch,
{
ch->last_state = next;

- pr_info("SMD: ch %d %d -> %d\n", ch->n, last, next);
+ pr_debug("SMD: ch %d %d -> %d\n", ch->n, last, next);

switch (next) {
case SMD_SS_OPENING:
@@ -601,7 +601,7 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
ch->pdev.name = ch->name;
ch->pdev.id = -1;

- pr_info("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
+ pr_debug("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
ch->n, ch->fifo_size, ch->name);

mutex_lock(&smd_creation_mutex);
@@ -725,7 +725,7 @@ int smd_close(smd_channel_t *ch)
{
unsigned long flags;

- pr_info("smd_close(%p)\n", ch);
+ pr_debug("smd_close(%p)\n", ch);

if (ch == 0)
return -1;
@@ -939,7 +939,7 @@ int smsm_set_sleep_duration(uint32_t delay)
int smd_core_init(void)
{
int r;
- pr_info("smd_core_init()\n");
+ pr_debug("smd_core_init()\n");

/* wait for essential items to be initialized */
for (;;) {
@@ -992,14 +992,14 @@ int smd_core_init(void)
smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
#endif

- pr_info("smd_core_init() done\n");
+ pr_debug("smd_core_init() done\n");

return 0;
}

static int __devinit msm_smd_probe(struct platform_device *pdev)
{
- pr_info("smd_init()\n");
+ pr_debug("smd_init()\n");

/*
* If we haven't waited for the ARM9 to boot up till now,
--
1.7.3.2


2010-11-10 00:49:40

by David Brown

[permalink] [raw]
Subject: [PATCH v2] msm: smd: Reduce driver log chatter

The MSM smd driver logs numerous messages during startup that are
useful for debug purposes. Change these to pr_debug() to match their
purpose.

Cc: Brian Swetland <[email protected]>
Cc: Arve Hjønnevåg <[email protected]>
Signed-off-by: David Brown <[email protected]>
---
arch/arm/mach-msm/smd.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index f07dc7c..37b35fb 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -14,6 +14,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/fs.h>
@@ -89,7 +91,7 @@ static void smd_diag(void)
x = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG);
if (x != 0) {
x[SZ_DIAG_ERR_MSG - 1] = 0;
- pr_info("smem: DIAG '%s'\n", x);
+ pr_debug("smem: DIAG '%s'\n", x);
}
}

@@ -312,7 +314,7 @@ static void smd_state_change(struct smd_channel *ch,
{
ch->last_state = next;

- pr_info("SMD: ch %d %d -> %d\n", ch->n, last, next);
+ pr_debug("SMD: ch %d %d -> %d\n", ch->n, last, next);

switch (next) {
case SMD_SS_OPENING:
@@ -601,7 +603,7 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
ch->pdev.name = ch->name;
ch->pdev.id = -1;

- pr_info("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
+ pr_debug("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
ch->n, ch->fifo_size, ch->name);

mutex_lock(&smd_creation_mutex);
@@ -725,7 +727,7 @@ int smd_close(smd_channel_t *ch)
{
unsigned long flags;

- pr_info("smd_close(%p)\n", ch);
+ pr_debug("smd_close(%p)\n", ch);

if (ch == 0)
return -1;
@@ -939,7 +941,7 @@ int smsm_set_sleep_duration(uint32_t delay)
int smd_core_init(void)
{
int r;
- pr_info("smd_core_init()\n");
+ pr_debug("smd_core_init()\n");

/* wait for essential items to be initialized */
for (;;) {
@@ -992,14 +994,14 @@ int smd_core_init(void)
smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
#endif

- pr_info("smd_core_init() done\n");
+ pr_debug("smd_core_init() done\n");

return 0;
}

static int __devinit msm_smd_probe(struct platform_device *pdev)
{
- pr_info("smd_init()\n");
+ pr_debug("smd_init()\n");

/*
* If we haven't waited for the ARM9 to boot up till now,
--
1.7.3.2

2010-11-10 00:56:35

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v2] msm: smd: Reduce driver log chatter

On Tue, 2010-11-09 at 16:49 -0800, David Brown wrote:
> The MSM smd driver logs numerous messages during startup that are
> useful for debug purposes. Change these to pr_debug() to match their
> purpose.
> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
[]
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

If you add this, you probably want to strip
a few prefixes from the formats.

> +
> #include <linux/platform_device.h>
> #include <linux/module.h>
> #include <linux/fs.h>
> @@ -89,7 +91,7 @@ static void smd_diag(void)
[]
> - pr_info("smem: DIAG '%s'\n", x);
> + pr_debug("smem: DIAG '%s'\n", x);

probably just
pr_debug("DIAG '%s'\n", x);

> }
> }
>
> @@ -312,7 +314,7 @@ static void smd_state_change(struct smd_channel *ch,
[]
> - pr_info("SMD: ch %d %d -> %d\n", ch->n, last, next);
> + pr_debug("SMD: ch %d %d -> %d\n", ch->n, last, next);

pr_debug("ch %d %d -> %d\n", ch->n, last, next);

2010-11-10 17:59:34

by David Brown

[permalink] [raw]
Subject: [PATCH v3] msm: smd: Reduce driver log chatter

The MSM smd driver logs numerous messages during startup that are
useful for debug purposes. Change these to pr_debug() to match their
purpose.

Cc: Brian Swetland <[email protected]>
Cc: Arve Hjønnevåg <[email protected]>
Signed-off-by: David Brown <[email protected]>
---
This addresses all of the feedback I've gotten so far.

arch/arm/mach-msm/smd.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index f07dc7c..2673527 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -14,6 +14,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/fs.h>
@@ -89,7 +91,7 @@ static void smd_diag(void)
x = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG);
if (x != 0) {
x[SZ_DIAG_ERR_MSG - 1] = 0;
- pr_info("smem: DIAG '%s'\n", x);
+ pr_debug("DIAG '%s'\n", x);
}
}

@@ -312,7 +314,7 @@ static void smd_state_change(struct smd_channel *ch,
{
ch->last_state = next;

- pr_info("SMD: ch %d %d -> %d\n", ch->n, last, next);
+ pr_debug("ch %d %d -> %d\n", ch->n, last, next);

switch (next) {
case SMD_SS_OPENING:
@@ -601,7 +603,7 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
ch->pdev.name = ch->name;
ch->pdev.id = -1;

- pr_info("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
+ pr_debug("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
ch->n, ch->fifo_size, ch->name);

mutex_lock(&smd_creation_mutex);
@@ -621,7 +623,7 @@ static void smd_channel_probe_worker(struct work_struct *work)

shared = smem_find(ID_CH_ALLOC_TBL, sizeof(*shared) * 64);
if (!shared) {
- pr_err("smd: cannot find allocation table\n");
+ pr_err("cannot find allocation table\n");
return;
}
for (n = 0; n < 64; n++) {
@@ -725,7 +727,7 @@ int smd_close(smd_channel_t *ch)
{
unsigned long flags;

- pr_info("smd_close(%p)\n", ch);
+ pr_debug("smd_close(%p)\n", ch);

if (ch == 0)
return -1;
@@ -939,7 +941,7 @@ int smsm_set_sleep_duration(uint32_t delay)
int smd_core_init(void)
{
int r;
- pr_info("smd_core_init()\n");
+ pr_debug("smd_core_init()\n");

/* wait for essential items to be initialized */
for (;;) {
@@ -992,14 +994,14 @@ int smd_core_init(void)
smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
#endif

- pr_info("smd_core_init() done\n");
+ pr_debug("smd_core_init() done\n");

return 0;
}

static int __devinit msm_smd_probe(struct platform_device *pdev)
{
- pr_info("smd_init()\n");
+ pr_debug("smd_init()\n");

/*
* If we haven't waited for the ARM9 to boot up till now,
--
1.7.3.2

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

2010-11-10 18:24:21

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v3] msm: smd: Reduce driver log chatter

On Wed, 2010-11-10 at 09:59 -0800, David Brown wrote:
> arch/arm/mach-msm/smd.c | 18 ++++++++++--------

Hi again David. More trivia. Ignore at your pleasure.

> 1 files changed, 10 insertions(+), 8 deletions(-)
> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c

A moderately common kernel style uses macros like:

#define FUNC_ENTER() pr_debug("--> %s\n", __func__);
#define FUNC_EXIT() pr_debug("<-- %s\n", __func__);
or
#define FUNC_ENTER() pr_debug("Enter %s\n", __func__);
#define FUNC_EXIT() pr_debug("Exit %s\n", __func__);

The macro names vary.
I've seen enter, _enter, kenter, func_enter, etc.

> @@ -939,7 +941,7 @@ int smsm_set_sleep_duration(uint32_t delay)
> int smd_core_init(void)
> {
> int r;
> - pr_info("smd_core_init()\n");
> + pr_debug("smd_core_init()\n");

FUNC_ENTER();

> @@ -992,14 +994,14 @@ int smd_core_init(void)
> smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
> #endif
>
> - pr_info("smd_core_init() done\n");
> + pr_debug("smd_core_init() done\n");

FUNC_EXIT();

> static int __devinit msm_smd_probe(struct platform_device *pdev)
> {
> - pr_info("smd_init()\n");
> + pr_debug("smd_init()\n");

wrong function name? FUNC_ENTER();

2010-11-10 18:34:31

by Brian Swetland

[permalink] [raw]
Subject: Re: [PATCH v3] msm: smd: Reduce driver log chatter

At this point, I think we could just drop the printk()s on the init
functions. They date back from when we first brought up the driver
and I'm not sure they're of much value at all any more.

Brian

On Wed, Nov 10, 2010 at 10:24 AM, Joe Perches <[email protected]> wrote:
> On Wed, 2010-11-10 at 09:59 -0800, David Brown wrote:
>>  arch/arm/mach-msm/smd.c |   18 ++++++++++--------
>
> Hi again David.  More trivia. Ignore at your pleasure.
>
>>  1 files changed, 10 insertions(+), 8 deletions(-)
>> diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
>
> A moderately common kernel style uses macros like:
>
> #define FUNC_ENTER()    pr_debug("--> %s\n", __func__);
> #define FUNC_EXIT()     pr_debug("<-- %s\n", __func__);
> or
> #define FUNC_ENTER()    pr_debug("Enter %s\n", __func__);
> #define FUNC_EXIT()     pr_debug("Exit  %s\n", __func__);
>
> The macro names vary.
> I've seen enter, _enter, kenter, func_enter, etc.
>
>> @@ -939,7 +941,7 @@ int smsm_set_sleep_duration(uint32_t delay)
>>  int smd_core_init(void)
>>  {
>>       int r;
>> -     pr_info("smd_core_init()\n");
>> +     pr_debug("smd_core_init()\n");
>
>        FUNC_ENTER();
>
>> @@ -992,14 +994,14 @@ int smd_core_init(void)
>>       smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
>>  #endif
>>
>> -     pr_info("smd_core_init() done\n");
>> +     pr_debug("smd_core_init() done\n");
>
>        FUNC_EXIT();
>
>>  static int __devinit msm_smd_probe(struct platform_device *pdev)
>>  {
>> -     pr_info("smd_init()\n");
>> +     pr_debug("smd_init()\n");
>
> wrong function name? FUNC_ENTER();
>
>

2010-11-11 22:54:49

by David Brown

[permalink] [raw]
Subject: [PATCH v4] msm: smd: Reduce driver log chatter

The MSM smd driver logs numerous messages during startup that are
useful for debug purposes. Change some of these to pr_debug() to
match their purpose, and remove others that aren't really useful.

Cc: Brian Swetland <[email protected]>
Cc: Arve Hjønnevåg <[email protected]>
Signed-off-by: David Brown <[email protected]>
---
arch/arm/mach-msm/smd.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index f07dc7c..eec464f 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -14,6 +14,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/fs.h>
@@ -89,7 +91,7 @@ static void smd_diag(void)
x = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG);
if (x != 0) {
x[SZ_DIAG_ERR_MSG - 1] = 0;
- pr_info("smem: DIAG '%s'\n", x);
+ pr_debug("DIAG '%s'\n", x);
}
}

@@ -312,7 +314,7 @@ static void smd_state_change(struct smd_channel *ch,
{
ch->last_state = next;

- pr_info("SMD: ch %d %d -> %d\n", ch->n, last, next);
+ pr_debug("ch %d %d -> %d\n", ch->n, last, next);

switch (next) {
case SMD_SS_OPENING:
@@ -601,7 +603,7 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
ch->pdev.name = ch->name;
ch->pdev.id = -1;

- pr_info("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
+ pr_debug("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
ch->n, ch->fifo_size, ch->name);

mutex_lock(&smd_creation_mutex);
@@ -621,7 +623,7 @@ static void smd_channel_probe_worker(struct work_struct *work)

shared = smem_find(ID_CH_ALLOC_TBL, sizeof(*shared) * 64);
if (!shared) {
- pr_err("smd: cannot find allocation table\n");
+ pr_err("cannot find allocation table\n");
return;
}
for (n = 0; n < 64; n++) {
@@ -725,7 +727,7 @@ int smd_close(smd_channel_t *ch)
{
unsigned long flags;

- pr_info("smd_close(%p)\n", ch);
+ pr_debug("smd_close(%p)\n", ch);

if (ch == 0)
return -1;
@@ -939,7 +941,6 @@ int smsm_set_sleep_duration(uint32_t delay)
int smd_core_init(void)
{
int r;
- pr_info("smd_core_init()\n");

/* wait for essential items to be initialized */
for (;;) {
@@ -992,15 +993,11 @@ int smd_core_init(void)
smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
#endif

- pr_info("smd_core_init() done\n");
-
return 0;
}

static int __devinit msm_smd_probe(struct platform_device *pdev)
{
- pr_info("smd_init()\n");
-
/*
* If we haven't waited for the ARM9 to boot up till now,
* then we need to wait here. Otherwise this should just
--
1.7.3.2

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

2010-11-12 04:22:58

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v4] msm: smd: Reduce driver log chatter

On Thu, 2010-11-11 at 14:54 -0800, David Brown wrote:
> The MSM smd driver logs numerous messages during startup that are
> useful for debug purposes. Change some of these to pr_debug() to
> match their purpose, and remove others that aren't really useful.

Hi David.

> arch/arm/mach-msm/smd.c | 17 +++++++----------
> @@ -725,7 +727,7 @@ int smd_close(smd_channel_t *ch)
> {
> unsigned long flags;
>
> - pr_info("smd_close(%p)\n", ch);
> + pr_debug("smd_close(%p)\n", ch);

Why keep a printk for close without a printk for open?
I suggest removing this one too.

2010-11-12 21:49:44

by David Brown

[permalink] [raw]
Subject: [PATCH v5] msm: smd: Reduce driver log chatter

The MSM smd driver logs numerous messages during startup that are
useful for debug purposes. Change some of these to pr_debug() to
match their purpose, and remove others that aren't really useful.

Cc: Brian Swetland <[email protected]>
Cc: Arve Hjønnevåg <[email protected]>
Signed-off-by: David Brown <[email protected]>
---
arch/arm/mach-msm/smd.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index f07dc7c..657be73 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -14,6 +14,8 @@
*
*/

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/fs.h>
@@ -89,7 +91,7 @@ static void smd_diag(void)
x = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG);
if (x != 0) {
x[SZ_DIAG_ERR_MSG - 1] = 0;
- pr_info("smem: DIAG '%s'\n", x);
+ pr_debug("DIAG '%s'\n", x);
}
}

@@ -312,7 +314,7 @@ static void smd_state_change(struct smd_channel *ch,
{
ch->last_state = next;

- pr_info("SMD: ch %d %d -> %d\n", ch->n, last, next);
+ pr_debug("ch %d %d -> %d\n", ch->n, last, next);

switch (next) {
case SMD_SS_OPENING:
@@ -601,7 +603,7 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
ch->pdev.name = ch->name;
ch->pdev.id = -1;

- pr_info("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
+ pr_debug("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
ch->n, ch->fifo_size, ch->name);

mutex_lock(&smd_creation_mutex);
@@ -621,7 +623,7 @@ static void smd_channel_probe_worker(struct work_struct *work)

shared = smem_find(ID_CH_ALLOC_TBL, sizeof(*shared) * 64);
if (!shared) {
- pr_err("smd: cannot find allocation table\n");
+ pr_err("cannot find allocation table\n");
return;
}
for (n = 0; n < 64; n++) {
@@ -725,8 +727,6 @@ int smd_close(smd_channel_t *ch)
{
unsigned long flags;

- pr_info("smd_close(%p)\n", ch);
-
if (ch == 0)
return -1;

@@ -939,7 +939,6 @@ int smsm_set_sleep_duration(uint32_t delay)
int smd_core_init(void)
{
int r;
- pr_info("smd_core_init()\n");

/* wait for essential items to be initialized */
for (;;) {
@@ -992,15 +991,11 @@ int smd_core_init(void)
smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
#endif

- pr_info("smd_core_init() done\n");
-
return 0;
}

static int __devinit msm_smd_probe(struct platform_device *pdev)
{
- pr_info("smd_init()\n");
-
/*
* If we haven't waited for the ARM9 to boot up till now,
* then we need to wait here. Otherwise this should just
--
1.7.3.2

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.