diff mbox

[5/6] power: user: Standardize "Syncing filesystems ..." message

Message ID 06fdc51c7d2ab639729107a137b947704fd7d161.1433442778.git.joe@perches.com (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Joe Perches June 4, 2015, 6:36 p.m. UTC
Instead of a two individual printks that would generally be
emitted on a single line, emit 2 lines to make the start
and end of the synchronization more easily timeable.

Signed-off-by: Joe Perches <joe@perches.com>
---
 kernel/power/user.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Pavel Machek June 5, 2015, 10:37 a.m. UTC | #1
On Thu 2015-06-04 11:36:48, Joe Perches wrote:
> Instead of a two individual printks that would generally be
> emitted on a single line, emit 2 lines to make the start
> and end of the synchronization more easily timeable.
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  kernel/power/user.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/power/user.c b/kernel/power/user.c
> index 526e891..e22f6ad 100644
> --- a/kernel/power/user.c
> +++ b/kernel/power/user.c
> @@ -221,9 +221,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
>  		if (data->frozen)
>  			break;
>  
> -		printk("Syncing filesystems ... ");
> +		printk("Syncing filesystems ...\n");
>  		sys_sync();
> -		printk("done.\n");
> +		printk("Syncing filesystems: done\n");

You converted " ..." -> "..." elsewhere, so why not here?

Is splitting message to two lines a good idea?

Is it time to introduce helper function that does the sync with the
printing?

I must say that I'm to a great fan on adding more lines to hibernation
output. Eats too much vertical space on screen, etc. Do you see real
problems there or are you just trying to "improve" this?

I'm pretty sure sync timing can be easily obtained from other messages
around this one...

									Pavel
Joe Perches June 5, 2015, 3:07 p.m. UTC | #2
On Fri, 2015-06-05 at 12:37 +0200, Pavel Machek wrote:
> On Thu 2015-06-04 11:36:48, Joe Perches wrote:
> > Instead of a two individual printks that would generally be
> > emitted on a single line, emit 2 lines to make the start
> > and end of the synchronization more easily timeable.
[]
> > diff --git a/kernel/power/user.c b/kernel/power/user.c
[]
> > @@ -221,9 +221,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
> >  		if (data->frozen)
> >  			break;
> >  
> > -		printk("Syncing filesystems ... ");
> > +		printk("Syncing filesystems ...\n");
> >  		sys_sync();
> > -		printk("done.\n");
> > +		printk("Syncing filesystems: done\n");
> 
> You converted " ..." -> "..." elsewhere, so why not here?

Missed that one. 

> Is splitting message to two lines a good idea?

I think the "done" is unnecessary actually.

As there's no newline on the first, printk is
async and can be interleaved by other threads.


--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pavel Machek June 6, 2015, 1:36 p.m. UTC | #3
On Fri 2015-06-05 08:07:38, Joe Perches wrote:
> On Fri, 2015-06-05 at 12:37 +0200, Pavel Machek wrote:
> > On Thu 2015-06-04 11:36:48, Joe Perches wrote:
> > > Instead of a two individual printks that would generally be
> > > emitted on a single line, emit 2 lines to make the start
> > > and end of the synchronization more easily timeable.
> []
> > > diff --git a/kernel/power/user.c b/kernel/power/user.c
> []
> > > @@ -221,9 +221,9 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
> > >  		if (data->frozen)
> > >  			break;
> > >  
> > > -		printk("Syncing filesystems ... ");
> > > +		printk("Syncing filesystems ...\n");
> > >  		sys_sync();
> > > -		printk("done.\n");
> > > +		printk("Syncing filesystems: done\n");
> > 
> > You converted " ..." -> "..." elsewhere, so why not here?
> 
> Missed that one. 
> 
> > Is splitting message to two lines a good idea?
> 
> I think the "done" is unnecessary actually.

Well... if it is not neccessary for timing, this change can be safely
dropped, as timing will be provided for existing code, too.

> As there's no newline on the first, printk is
> async and can be interleaved by other threads.

...which will probably never happen here, due to feezer.

									Pavel
diff mbox

Patch

diff --git a/kernel/power/user.c b/kernel/power/user.c
index 526e891..e22f6ad 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -221,9 +221,9 @@  static long snapshot_ioctl(struct file *filp, unsigned int cmd,
 		if (data->frozen)
 			break;
 
-		printk("Syncing filesystems ... ");
+		printk("Syncing filesystems ...\n");
 		sys_sync();
-		printk("done.\n");
+		printk("Syncing filesystems: done\n");
 
 		error = freeze_processes();
 		if (error)